Modbus RTU to TCP via virtual com port?


Thread Starter


Brief Problem:

Getting software that only scans for COM ports (MOdbus RTU) to connect to a Modbus TCP device.

We have third party software that communicates only via Modbus RTU (so the software looks for COM ports to connect to). This software communicates with Modbus Sensors, and we have this setup connected via a RTU/TCP gateway to the PC. So I use modbus TCP from the PC.

Now I am looking for a driver or something that creates a virtual COM port for RS 485 and converts/tunnels this to my pc RJ 45 port.

Normally connecting the RTU sensor with USB/RS485 converter directly to PC works, but in this case I do not have this option (sensor built into apparatus)

Of course better or other solutions are welcome.<pre>
SENSOR-RTU <-->RTU/TCP Gateway <-->PC PROBLEM <-Software that is RTU only
2 wire RS485 RJ-45 Ethernet</pre>

Lynn August Linse

Most companies selling 'device servers' or 'ethernet/serial converters' will include or reference a third-party product which allows a PC to create a virtual COM port linked via IP. It is often called a 'redirector'. Wikipedia even has a whole page on this!

As example, Digi sells the Digi One SP with 232 & 485, plus you can install a 'realPort' driver as COM3 or COM252, whatever.

Just be aware that not all applications work with all products.

For example, realPort makes a huge effort to move & sync things like RTS/CTS remotely. Some tool do NOT offer this, so if the software expects to assert RTS and see CTS rise ... some Virtual Com ports will do that, some will not.

Ethernet may also screw up the timing. For example older Allen-Bradley RSLinx (era: 1990's) didn't work with our realport because say I poll the PLC, it returns a DLE-ACK rapidly, followed by the actual response. Over Ethernet, these bytes likely returned within the same TCp segment. So you could watch the Windows PORT calls - the tool first asked Windows "Are there 2 bytes?" Windows would say sue, here they are. Then the software would ask Windows "Tell me when more data arrives". But the problem is ALL the data has already arrived! The full response is buffered in Windows, but the tool was assuming there was enough of a delay (at 9600 baud) that more data would arrive after the ACK did. They fixed this, but I'd expect other software tools to suffer similar issues.
>Now I am looking for a driver or
>something that creates a virtual COM
>port for RS 485 and converts/tunnels
>this to my pc RJ 45 port.

This open-source project has some neat tools:

The associated com2tcp tool might work for what you are describing.

You can configure the virtual ports to slow things down according to the chosen baud rate.

A year ago I used the associated program Hub4Com and configured a virtual "radio network" so I can run multiple copies of software that works via radio and each of the programs "hear" everything sent by the other systems (but they don't "hear" themselves). Very useful tool!

Paul Breneman
I am currently using B&B serial servers. I am not using them in a virtual com port option but that option does exist.

Keep in mind that if you are doing custom programming that you can open these things as a standard TCP socket and read the serial data that way. This is how I'm using it, but if your code is all written or you don't want to learn TCP sockets (They can be simple to difficult depending on what you want to do) by all means try their driver.

Thank you all for the responses, we are trying some of the suggested options and I will come back with the results!!

If u are willing to spend why don't you go for buying pattern controller which can directly convert Rs485 to rj45.Usually this can be configured using a gate way which avoids probs with ip conflict issues if you are connecting many device with it

I worked with this product in one of my project

you can try any other companies like santeliequip etc

Tallak Tveide

> Getting software that only scans for COM ports (MOdbus RTU) to connect to a Modbus TCP device.

Schneider TSXETG100 can do this.

Check manual figure 6: Electric/Automation/Modicon Networks/Ethernet/TSXETG100 Gateway/User Guide.pdf

I have not used this myself yet, but we are planning to use it in my current project. Price in Norway is around 4000 NOK (~700 USD)

(I am assuming that you install a physical serial port to the macine that uses serial communications)

A simple serial-to-tcpip gateway will not work out of the box as modbus-tcpip and modbus-rtu are not compatible byte by byte (even though they are very similar)

Good luck!
> Nice, paired with the software this looks perfect.
> I'm doing almost the same thing as the OP. I'll let you guys know how it goes.

Ok, so I tried this thing out. TL;DR, I couldn't get it to work too well.

Setup was really easy, I even got it working with a wifi bridge. The issue is that the connection's not too reliable. I was trying to log the output from some temp controllers, but I couldn't leave it for more than 45 minutes without the connection dropping.

The VxComm software is pretty nice, when the connection drops, it automatically reconnects. The software Solo PID controllers come with is awful though. Once the connection blips, everything fails and stops.

In the end, I just switched back to using a USB adapter and a spare laptop. Not pretty, but it works.