Jump to content

Modbus communication by USB


louisgermain6

Recommended Posts

Hey guys, I wish you could help me with this one...

I'm currently doing a project using a pump that communicates by Modbus RTU to my US7-B5-TR22. The serial communication and code is done by USB.

 I'm aware that you recommend to use a Prolific USB to serial converter, I have a FTDI one that worked perfectly in an other configuration but still modbus using serial by USB. 

Now I can't understand why on my new configuration it fails. I "sniffed" the communication between the PLC and my pump using my computer and a serial terminal, the request of the PLC and response of the pump are correctly sent. The problem is that the PLC doesn't seem to receive or decode well the response because every sessions in my remote slave are failed.

Thanks in advance for your help, I attach a piece of code for you to have a look of what I've done.

Cheers,

Louis

test.ulpr

Link to comment
Share on other sites

  • MVP 2023

We always talk about the Prolific converter when communicating from a PC to a Unitronics device.  It appears you are plugging the USB converter into the USB port of a UniStream and trying to configure the UniStream as a Modbus Master.

I have no idea how and if this works.  Maybe one of the Creators can chime in ( @Saragani ) and tell us if there are any local USB converter drivers built into the US5/7.  The Help on Panel USB port lists that the Panel USB Port can be configured as a Modbus Panel but it's not clear as to whether this Modbus Panel is capable of Master operation, Slave Operation, and the rest of the details.

The easy thing to do if you're using the unit as a Master is to add a real serial port to he US7.  They plug into the back and are not expensive-

UAC-CX-01RS2 - RS232 port

UAC-CX-01RS4 - RS485 port

Joe T.

 

Link to comment
Share on other sites

  • 3 weeks later...

You can enable the Panel USB Port for serial device, and then define the USB Port for a Modbus Panel communication.

I never done it, but our QA guy showed it to me. He just connected a USB to Serial converter to the USB Host, and the other side to the serial device. This is how he also connects modems.

Link to comment
Share on other sites

@Saragani yes, this is the way I'm using it. 

I was telling in the first post that I'm using it the same way in another project but with another host (PLC=Master, Host=Slave) and it works properly but with my new program it doesn't.

As I said, I sniffed the serial transmission and the messages from the PLC and the pumps are correct. The problem seems to be the RS485 to USB conversion or the PLC because my registers never get the returned values. (In my first project I didn't had this problem)

Thank you for your help.

Cheers

Louis

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