Jump to content

GEN Protocol with Unitronics PLC RS485 communication


sachinda

Recommended Posts

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...?

  • Like 1
Link to comment
Share on other sites

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

@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

  • MVP 2023

So let's start at the beginning of the receive logic and work through each block.

In this network

image.png.81c589d481046053d74a1f00ce191a21.png

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

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.

com_test1.JPG

Link to comment
Share on other sites

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.

com_test1.JPG

@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

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

  • MVP 2023
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

  • MVP 2023

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-

image.png.605e3d1385ed7ae7d1f55a97cb671dc1.png

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

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

  • MVP 2023
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

  • MVP 2023

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.

image.png.1fd796fbaf0a1adf99fc3750523d5c39.png  

 

Here's what came out in the "last byte copy" array tag:

image.png.cd27da29cd2836677c3f1cccaa5dad5d.png

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:

image.png.4e3d5297a54e82f44181eeff7bb39930.png

 

I hate leaving incorrect information out there for the world to see 😉

Joe T.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...