sachinda Posted February 5, 2019 Report Share Posted February 5, 2019 Hi, I am trying to interface GEN Protocol which is in the TDK Lambda Z+ Power Supply. I need to build the communication with the RS485 com port in the USP-104-B10 model. I wrote the ladder program and tried to read the address in the power supply and tried to read voltage and current. But there was error messages coming. Please anyone who could give any feedback for this...? 1 Link to comment Share on other sites More sharing options...
MVP 2023 Joe Tauser Posted February 5, 2019 MVP 2023 Report Share Posted February 5, 2019 We can not troubleshoot in the dark. 1. Upload your program. 2. Post a link to a manual for the GEN protocol. 3. List the exact error messages you are getting. Joe T. Link to comment Share on other sites More sharing options...
sachinda Posted February 6, 2019 Author Report Share Posted February 6, 2019 Dear Joe, Thank you for the reply. Herewith I will upload the details. I tried at first to read the address and voltage from the power supply. Z+ 60-7 power supply data sheet. Protocol details under page 86 https://uk.tdk-lambda.com/KB/Zplus-User-Manual-low-voltage-models-10V-to-100V.pdf error messages were, Some unknown characteristics like"??", "*" C01 : ( C01 is mentioned as illegal command or quarry in the data sheet ) TEST1.ulpr Link to comment Share on other sites More sharing options...
sachinda Posted February 6, 2019 Author Report Share Posted February 6, 2019 Dear Joe, I did the communication with Hyper terminal and Termite with the PLC RS 485 terminal. when I input from the PLC messages can received to the Termite. But unable to transmit to the PLC. Could you please guide me for this. Test4.ulpr Link to comment Share on other sites More sharing options...
dg450 Posted February 7, 2019 Report Share Posted February 7, 2019 @sachinda, I happen to be trying to interface with a TDK Lambda Z+ instrument as well right now. After a week I figured something out. This is for a z100-8-u model. I wanted to get SCPI to work, but I found a way to get the GEN protocol to work, which is what you need. Download the USB driver for the Z+ unit here, Z+ USB Drivers Download Zip. or find it on the webpage, https://uk.tdk-lambda.com/technical-centre/software-tools.aspx plug in a USB cable from your computer to the unit. Setup the unit for Interface-USB, BAUD-9600, LANG-GEN, ADR-6 Download Putty Start a default Putty session and change the following parameters. Set connection type to serial line to COM("""this number will be based on your computer""") Go to terminal and check, "implicit CR in every LF", and "Implicit LF in every CR". Also, under line discipline options, make sure local echo is "Force on" Under connection>serial>Baud-9600, data bit-8, stop bit-1, parity-none,flow control-none. Start the session It should be a blank screen, but it shouldn't exit out. Type the following to get started: ADR 06 press enter "OK" should be returned. Link to comment Share on other sites More sharing options...
MVP 2023 Joe Tauser Posted February 7, 2019 MVP 2023 Report Share Posted February 7, 2019 So let's start at the beginning of the receive logic and work through each block. In this network You're triggering the receive with the Last Byte Count = 0. Why? Have you tried hanging the COM Rx block right on the power rail? If so, does anything show up in the Rx_Buffer tag at all? Joe T. Link to comment Share on other sites More sharing options...
sachinda Posted February 7, 2019 Author Report Share Posted February 7, 2019 Hi dg450 I think you mentioned the COM test with the power supply and the PC. Here I attached the picture in the manual. I test the serial communication according to the guidance in the picture. The "OK" message came. and also able to read the voltage in the hyper terminal and also can set voltage to the power supply using the communication between power supply and PC. baud rate adjusted, set LANG to GEN etc. Link to comment Share on other sites More sharing options...
dg450 Posted February 7, 2019 Report Share Posted February 7, 2019 2 hours ago, sachinda said: Hi dg450 I think you mentioned the COM test with the power supply and the PC. Here I attached the picture in the manual. I test the serial communication according to the guidance in the picture. The "OK" message came. and also able to read the voltage in the hyper terminal and also can set voltage to the power supply using the communication between power supply and PC. baud rate adjusted, set LANG to GEN etc. @sachinda, that is correct. The main difference was that I used PuTTY. I re-read your post and noticed you need RS485 communication. I misread that! I tried to connect using RS485 using a usb to RS-485 cable, but I am unable to communicate with the device. However, my putty session doesn't timeout. It makes me think one of my settings is off... Link to comment Share on other sites More sharing options...
sachinda Posted February 8, 2019 Author Report Share Posted February 8, 2019 Hi Joe, I tried the last bytes waiting in buffer [0-3]. In my post TEST1 program could see this. 'hanging the COM Rx block right on the power rail' could you please tell me what this is mean? ( I tried COM Rx separately having in the program but it did not work) Could you please guide me. Link to comment Share on other sites More sharing options...
MVP 2023 Joe Tauser Posted February 8, 2019 MVP 2023 Report Share Posted February 8, 2019 4 hours ago, sachinda said: hanging the COM Rx block right on the power rail This means you put it on the rightmost position of the network with no conditions. 4 hours ago, sachinda said: I tried COM Rx separately having in the program but it did not work Is that what you mean by this? Posting screen shots is often very helpful for clarification. Joe T. Link to comment Share on other sites More sharing options...
MVP 2023 Flex727 Posted February 8, 2019 MVP 2023 Report Share Posted February 8, 2019 8 hours ago, Joe Tauser said: This means you put it on the rightmost position of the network with no conditions. Leftmost? Link to comment Share on other sites More sharing options...
MVP 2023 Joe Tauser Posted February 8, 2019 MVP 2023 Report Share Posted February 8, 2019 1 hour ago, Flex727 said: Leftmost? OK, so I'm hand dyslexic. 😄 Which is why I use screenshots so often. And I wish other people would, too. The language barrier on the forum often causes an answer to take days while we try to figure out what each other is saying. Joe T. Link to comment Share on other sites More sharing options...
sachinda Posted February 9, 2019 Author Report Share Posted February 9, 2019 Hi Joe, Here I attached a program. Is that the way what do you mean regarding the COM Rx ? I tried with this program also but could not read the data. PSU_v1.ulpr Link to comment Share on other sites More sharing options...
sachinda Posted February 13, 2019 Author Report Share Posted February 13, 2019 Hi Joe, Did you go through my program. Is there anything I have written incorrect? Was that the way COM Rx means? Link to comment Share on other sites More sharing options...
MVP 2023 Joe Tauser Posted February 16, 2019 MVP 2023 Report Share Posted February 16, 2019 Had to update my UniLogic vesion and finally looked at it. I'm still learning myself on the UniStream, so bear with me. I think the Help has been updated. Take a look at this- So it looks like I was wrong - you need to trigger the COM Rx with some condition based on the tag linked to the COM port. This is different from the Vision. Only problem is this is for an RS232 com module. I poked at your program with the RS485 struct and hopefully duplicated this. I don't know if your string contains a carriage return, but it doesn't hurt. If it does, you may need to change the array element - I used [0]. Joe T. PSU_v1_JT.ulpr Link to comment Share on other sites More sharing options...
sachinda Posted February 21, 2019 Author Report Share Posted February 21, 2019 Hi Joe, I will try with the method used in the help tutorial. Another clarification I need from you. In Unitronics PLC for RS485 in built port has D+, D-, SG and GND only. In power supply it has TX+, TX-, RX+, RX-,SG. So I connected TX+ AND RX+ together and connected PLC side to D+. TX- and RX- together connected with D-. and SG for SG in PLC. Is this correct? Link to comment Share on other sites More sharing options...
MVP 2023 Ausman Posted February 21, 2019 MVP 2023 Report Share Posted February 21, 2019 On 2/9/2019 at 3:08 AM, Joe Tauser said: OK, so I'm hand dyslexic. 😄 You're forgiven! But it really depends on how you view the screen...if you're the screen looking out it is on the right! 🤪 cheers, Aus Link to comment Share on other sites More sharing options...
MVP 2023 Joe Tauser Posted February 22, 2019 MVP 2023 Report Share Posted February 22, 2019 On 2/20/2019 at 9:39 PM, sachinda said: So I connected TX+ AND RX+ together and connected PLC side to D+. TX- and RX- together connected with D-. and SG for SG in PLC. Is this correct? Generally, yes, if the power supply supports half-duplex RS485. Read all about it here- http://www.bb-elec.com/Learning-Center/All-White-Papers/Serial/RS-485-Connections-FAQ.aspx Joe T. Link to comment Share on other sites More sharing options...
sachinda Posted February 26, 2019 Author Report Share Posted February 26, 2019 Thank you. I tried with serial communication with RS232 protocol I could obtain the voltage readings and can set for power supply also. RS 485 communication also can communicate but there is a little bit delay. Link to comment Share on other sites More sharing options...
MVP 2023 Joe Tauser Posted March 4, 2019 MVP 2023 Report Share Posted March 4, 2019 @sachinda Would you post your program that worked? Joe T. Link to comment Share on other sites More sharing options...
MVP 2023 Joe Tauser Posted March 5, 2019 MVP 2023 Report Share Posted March 5, 2019 Update- Further research now that I have a UAC-02RS2 RS232 module, an RS232 barcode scanner, and a terminal connected with a null modem cable on my UniStream for a project. On 2/15/2019 at 10:22 PM, Joe Tauser said: I don't know if your string contains a carriage return, but it doesn't hurt. If it does, you may need to change the array element - I used [0]. The example in the Help didn't specify which element to use, so I took a guess. USING ARRAY ELEMENT ZERO TO SENSE THE CR (13d) IS WRONG. The local values of the RX buffer only stay around until the Rx COM block is called, which then resets them. So it's kind of hard to troubleshoot without a little extra effort. I made a UINT8[4] array to copy the Last Bytes Waiting in the Buffer array tag of the port in question. I was curious about the Time from First Byte, too. Here's what came out in the "last byte copy" array tag: As you can see, the CR is in the highest element of the array (3). It's also interesting that the whole transaction took 1 millisecond. ! Note that your string must be at least four bytes (characters) long ! If your string only has one or two characters with a CR then you have to go looking for it in the array. Replace the = 13 block with this: I hate leaving incorrect information out there for the world to see 😉 Joe T. Link to comment Share on other sites More sharing options...
sachinda Posted March 5, 2019 Author Report Share Posted March 5, 2019 HI Joe, Thank you for the support given me. Here I posted my code which i tested in RS485 serial communication. This will take little bit delay to read voltage in power supply when I changed the voltage. PSU_Edited_RS485 - Copy.ulpr Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now