EmbeddedRelated.com
Forums

Best way to split modbus data over virtual com ports

Started by coreyfowler 8 years ago4 replieslatest reply 8 years ago187 views

Hi Guys,

What I have is sensors sending modbus data coming in via rs232 to say COM 1, I can only use this with one program in windows as the second program has error that COM is being used elsewhere.

Is there a virtual COM splitter where I can set data coming in on COM 1 to be duplicated to say COM 2 and COM 3 so both programs can use data.

The sensors I am pulling data from don't require a receive signal to send more data. 

Also is the a hardware options that I can buy or build that will have 1 serial in and 2-4 serial/usb outs.


Thanks in advance

Corey

[ - ]
Reply by mirceacDecember 20, 2016

Hi, the quick answer is:

http://www.eltima.com/products/serialshare/

Eltima is an old and established vendor for "strange" serial port on Windows, and you pay 99USD and voila, infinite shared serial ports, data is distributed to an unlimited number of virtual ports.

Cost a bit but less then an hour of work.

On the other hand, if you want to be cool you can produce your own DLL with a COM interface that will have this capability but this will take much longer do it and even longer to make it production quality.

DISCLAIMER: I have no relation with Eltima, except as a happy customer.



[ - ]
Reply by antedeluvianDecember 20, 2016

Although Modbus was originally designed for RS232, it seems to me that most devices moved to RS485, which of course allows for multidrop lines and hence a single COM port.

Of course that doesn't directly help you if you already have RS232 devices. 

There are units that convert USB to RS232 and/or RS485, look at b-b electronics ( http://www.bb-elec.com/ ), the Edgeport range from Digi (https://www.digi.com/products/usb-and-serial-conne...) or Sealevel (http://www.sealevel.com/store/serial/asynchronous-...). There must be some others as well. Just googling "usb to multi rs232 converter" shows up others like this (http://www.usconverters.com/usb-serial-converter-4...). Each hardware port translates to a new COM port. You will probably find the quickest solution in this lot.

Maxim  (and probably Linear Tech, Analog Devices, TI etc.) do RS232 chips with 3 state outputs, but you would still need to figure out how to enable each one onto the PC's serial port.


[ - ]
Reply by olzekeDecember 20, 2016

Can't help with the Windoze sharing COM data/ports.

You did ask about devices with 1 serial in and several serial outs.

Coridiumcorp @dot@ com  has a series of ARMbasic products that have 

multiple uarts on the chips - you'd have to program them but they have

Basic (pun intended) uart programs in their library.  They also have a

c compiler if you like that route.  Aruduino form factor, or go with

an mbed device for dev.  Most are 3.3v I/O !!!

Gary

[ - ]
Reply by JohnHPoteDecember 20, 2016

Other replies have some good ideas for software solutions. The eltima option looks very good.

If this is a 1 off job for lab/internal use you could try buying a couple of USB to serial converters (you can get them with 1, 2 or more 9 pin 'RS232' ports) and simply wire them in parallel. I would guess there will be enough drive current for at least 2 RS232 ports. Check with an oscilloscope and as long as the signal levels are greater than +- 3V all will be well. BUT only connect 0V and the pin 2s (rx data) on the 9 pin PC connectors. You don't want multiple outputs from the PC driving the same lines to the modbus end. Of course if you want one of the applications to control the modbus device then connect the other signals to just one of the RS232 ports. In fact you may have to if the modbus device is expecting Data Terminal Ready and/or Request To Send to be asserted.