02-12-2024 09:42 AM
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?
02-12-2024 01:55 PM
Does the WAGO has a RS 232 module ? Does it work as a trasnsparent bridge between the TCP and rs 232 ?
02-12-2024 02:18 PM
@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:
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.
02-12-2024 03:39 PM
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...
02-13-2024 01:07 AM
@majocomp wrote:
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.
02-13-2024 01:12 AM - edited 02-13-2024 01:15 AM
@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:
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.
02-13-2024 01:16 AM
@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.
02-13-2024 01:25 AM
@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.
02-13-2024 04:42 PM
@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 :