Redirecting COM port data to anoter COM port after transformation
I need to capture scale data from COM1, transform it and redirect to COM2.
1. Delete all existing configurations: Main menu - Options – Manage Configurations – Delete All
2. Create a new configuration using the “Plus” button in the main window (fig. 1). This configuration will receive scale data from COM1.
Fig.1. "Plus" button
3. Specify the COM1 settings. Set the communication parameters according to the scale settings.
Fig.2. COM port settings
4. Configure the ASCII data parser to extract tare, gross and weight values (fig. 3-5). The filter modules (Expressions and Data redirecting) are also required and will be used in the next steps.
Fig.3. Module selection
We assume that you have configured your scale to add the CR character at the end of a data packet. If you use some other character, you need to specify its code in the “Data packets end with” field.
Fig.4. Parser settings
We have added three parser items for each weight value. We assume that you have configured the scale to send data values as 0.0;0.0;0.0 (three values in a row delimited by a semicolon).
Fig.5. Parser items
5. Enable and configure the Expressions module. This module will build a new data packet that will be redirected to COM2 (fig. 6). In this example, we have changed the order of items in a data packet and added the new prefix “New data packet: ”. CHR(13) at the end of the expression means that the CR character will be added to the end of the new data packet.
Fig.6. Building a new data packet
6. Enable and configure the Data redirecting module. This module will redirect the prepared data packet to COM2 (fig. 7). Please note that the parser item name should match the name that you defined in the Expressions module.
Fig.7. Redirecting data
7. Configure data export to Excel. We assume that you have configured the scale to send data values as 0.0;0.0;0.0 (three values in a row delimited by a semicolon). The data format is compatible with the CSV format that can be easily opened in Excel. Here you just need to configure the log file (fig. 8).
Fig.8. Log files
8. Create a new configuration using the “Plus” button in the main window (fig. 1). This configuration will receive scale data from COM2. Specify the necessary COM port settings. All other settings you should be left unchanged.
Now you can test your configuration. Try to receive data from your scale. If your settings are correct, you will see outgoing data in the COM2 window (fig. 9). You can see the corresponding message at the bottom of the main window.
Fig.9. Redirected data
Ready-to-use configuration that you can restore from the "File" menu you can download here.