To share existing COM port with multiple applications, you can use
Virtual Splitter device device.
For example, if you want to share existing serial port COM1 with multiple applications, you need to do the following:
- Close application which is using COM1
- Create new Splitter device (COM1 -> COM5)
- Open COM5 with multiple applications
Data flow diagram
Splitter configuration
To share existing COM port with multiple applications, you can also use
Serial Router device device. It gives you more control over data splitting logic compared to
Virtual Splitter device (and has special modes such as SmartRouter and Switch mode to handle specific communications protocols). It also allows you to add
Transformers to avoid write conflicts and modify data.
For example, if you want to share existing serial port COM1 with multiple applications, you need to do the following:
- Close application which is using COM1
- Create Virtual Connector device devices for every application (for example, COM2,3,4,5,6)
- Create Serial Router device in desired mode, specify source port (COM1) and target ports (COM2, 3, 4, 5, 6)
- Open COM2,3,4,5,6 with respective application
If multiple clients are sending partially formatted commands (not full command, but by small chunks), there is a chance that this will result in write conflict when request from client1 is incorrectly merged with request from client2. To address that (for Serial Router is in fan-out mode) you should add Transformers to split data into consistently formatted chunks so that every chunk is a complete request.
Serial Router (fan-out) data flow diagram
Serial router settings
- Create TcpServer device
- Source serial port=COM1
- Local TCP port = 5555
- Control port=6666
- Create Connector COM5
- Create TcpClient device
- Source serial port=COM5
- Remote TCP host=127.0.0.1
- Remote TCP port=5555
- Control port=6666
- Create Connector COM6
- Create TcpClient device
- Source serial port=COM6
- Remote TCP host=127.0.0.1
- Remote TCP port=5555
- Control port=6666
Alternative: TcpServer + Connector + TcpClient
- See also:
-