If you have multiple data sources from existing COM ports or from other data sources (TCP, UDP etc), you can use
Serial Router device (fan-out mode) and
Virtual Connector device.
Please note that even though Serial Router has "Data source" and "Target COM ports", it is reading/writing in both directions and in this case Targets are considered sources, and Source is considered target.
To avoid write conflicts (when partial data from multiple sources is mixed in output), it is highly recommended to add Wait for complete data transformer to Serial Router configuration.
- Add Connector device COM1 (unless COM1 already exists)
- Add Serial Router device (in Fan-Out mode, which is default)
- Select source COM port COM1
- Add target COM ports: COM255 and COM256 and configure them (COM port speed etc)
- Add Wait for complete data transformer into the flow before Data Processor. This will ensure that the data read from COM255 or COM256 is complete before sending it to COM1. In this scenario, both data sources are sending ASCII strings ending with 0x0d 0x0a and you can use one transformer for both data sources. If the data sources have different line endings, you should add transformer for every COM port (in "Selected COM port settings")
- Binary format: yes
- End marker: 0D 0A
Connector and Serial Router devices
Serial Router configuration
Write transformer configuration
In this scenario, you need to create additional Connector (COM2 as an example) and use it with
TCP Client device device. This way, Serial Router will be able to use COM2 as additional data source.
- Add Connector device COM1 (unless COM1 already exists)
- Add Connector device COM2 (it will be used to connect TCP data source later)
- Add TcpClient device
- COM Port: COM2
- Specify Remote TCP host IP address/host name and TCP data port (leave TCP Control port as empty)
- Add Serial Router device (in Fan-Out mode, which is default)
- Select source COM port COM1
- Add target COM port COM255 and configure it (COM port speed etc)
- Add target COM port COM2
- Add Wait for complete data transformer into the flow before Data Processor. This will ensure that the data read from COM255 or COM256 is complete before sending it to COM1. In this scenario, both data sources are sending ASCII strings ending with 0x0d 0x0a and you can use one transformer for both data sources. If the data sources have different line endings, you should add transformer for every COM port (in "Selected COM port settings")
- Binary format: yes
- End marker: 0D 0A
- See also:
-