LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Modbus ASCII over TCP

Hi,

 

I'am trying to establish a communication between a PC and a scale. The scale uses Modbus ASCII protocol and RS232. The PC uses a TCP protocol. The communication is converted thru a WAGO 879-9000 Communication Module (Baud rate, parity are set in the configuration tool). My best so far was to establish the connection via the VISA library but could not yet reach a working VI. Do you have a clue how it might work?

0 Kudos
Message 1 of 9
(822 Views)

Does the WAGO has a RS 232 module ? Does it work as a trasnsparent bridge between the TCP and rs 232 ? 

 

0 Kudos
Message 2 of 9
(778 Views)

@majocomp wrote:

Hi,

 

I'am trying to establish a communication between a PC and a scale. The scale uses Modbus ASCII protocol and RS232. The PC uses a TCP protocol. The communication is converted thru a WAGO 879-9000 Communication Module (Baud rate, parity are set in the configuration tool). My best so far was to establish the connection via the VISA library but could not yet reach a working VI. Do you have a clue how it might work?


Are you restricted to TCP? You can grab one of these: 

 

https://www.digikey.com/en/products/detail/ftdi,-future-technology-devices-international-ltd/US232R-...

 

and be up and running in no time. Even if you must eventually use TCP sometimes it is easier to use a native connection then figure out the protocol bridging as a next step. 

______________________________________________________________
Have a pleasant day and be sure to learn Python for success and prosperity.
0 Kudos
Message 3 of 9
(773 Views)

You need a Modbus TCP to Modbus ASCII Gateway. I've used this product sucessfully.
https://www.anybus.com/products/gateway-index/specific-gateways/anybus-gateways/anybus-modbus-rtu-to...

—Ben
Prevent your computer from sleeping programmatically!
Use Power Requests
Download from GitHub

0 Kudos
Message 4 of 9
(763 Views)

@majocomp wrote:

 

scale_vi

This code is not Modbus, but a simpler ASCII protocol. This is probably better for you, as it makes things simpler. Also, I think the device you refer to doesn't actually do what you want, even if your device does support Modbus, but I didn't look it closely.

 

Most likely, you just need a converter which will allow you to connect to the RS232 device. This can be a USB to serial adapter, as already linked to, or an Ethernet to serial adapter, if you prefer to use an Ethernet connection (I used such devices from Tibbo, Lantronix and Advantech, off the top of my head, and they all work OK). In both cases, the adapters can usually be configured as a virtual COM port on the PC, allowing you to simply use the VISA code.

 

For the Ethernet devices, you can usually also use a listening port on them to forward the serial communication back and forth and then you can use them without installing drivers on the PC and either use code like what you show or use the TCP primitives.


___________________
Try to take over the world!
0 Kudos
Message 5 of 9
(742 Views)

@Jay14159265 wrote:

@majocomp wrote:

Hi,

 

I'am trying to establish a communication between a PC and a scale. The scale uses Modbus ASCII protocol and RS232. The PC uses a TCP protocol. The communication is converted thru a WAGO 879-9000 Communication Module (Baud rate, parity are set in the configuration tool). My best so far was to establish the connection via the VISA library but could not yet reach a working VI. Do you have a clue how it might work?


Are you restricted to TCP? You can grab one of these: 

 

https://www.digikey.com/en/products/detail/ftdi,-future-technology-devices-international-ltd/US232R-...

 

and be up and running in no time. Even if you must eventually use TCP sometimes it is easier to use a native connection then figure out the protocol bridging as a next step. 


 

Not necessarily but it would ease things. I already have it running with a USB cable.

0 Kudos
Message 6 of 9
(736 Views)

@LVNinja wrote:

Does the WAGO has a RS 232 module ? Does it work as a trasnsparent bridge between the TCP and rs 232 ? 

 


According to WAGO it should exactly do what I am intended to do.

0 Kudos
Message 7 of 9
(731 Views)

@tst wrote:

Most likely, you just need a converter which will allow you to connect to the RS232 device. This can be a USB to serial adapter, as already linked to, or an Ethernet to serial adapter, if you prefer to use an Ethernet connection (I used such devices from Tibbo, Lantronix and Advantech, off the top of my head, and they all work OK). In both cases, the adapters can usually be configured as a virtual COM port on the PC, allowing you to simply use the VISA code.

 

For the Ethernet devices, you can usually also use a listening port on them to forward the serial communication back and forth and then you can use them without installing drivers on the PC and either use code like what you show or use the TCP primitives.


Thanks, the USB-serial adapter works but I havent tried Ethernet yet. I'll try this next, also the TCP listener.

0 Kudos
Message 8 of 9
(726 Views)

@majocomp wrote:

@tst wrote:

Most likely, you just need a converter which will allow you to connect to the RS232 device. This can be a USB to serial adapter, as already linked to, or an Ethernet to serial adapter, if you prefer to use an Ethernet connection (I used such devices from Tibbo, Lantronix and Advantech, off the top of my head, and they all work OK). In both cases, the adapters can usually be configured as a virtual COM port on the PC, allowing you to simply use the VISA code.

 

For the Ethernet devices, you can usually also use a listening port on them to forward the serial communication back and forth and then you can use them without installing drivers on the PC and either use code like what you show or use the TCP primitives.


Thanks, the USB-serial adapter works but I havent tried Ethernet yet. I'll try this next, also the TCP listener.


Speaking of ethernet to serial adapters, I have used this one in quite a few SCADA projects and it is rock solid, very little configuration, up and running fast. The hardest part is working with the IT departments to get onto the local network at the site, if you don't have to worry about that, should be a breeze : 

 

https://www.moxa.com/en/products/industrial-edge-connectivity/serial-device-servers/general-device-s...

 

 

______________________________________________________________
Have a pleasant day and be sure to learn Python for success and prosperity.
0 Kudos
Message 9 of 9
(678 Views)