Write to Serial Interface
This tool is set as legacy. It is still available to provide backward compatibility but it will no longer be maintained or updated in upcoming MERLIC versions.
Use this tool to write data to a serial interface.
Before trying to connect to a serial interface, please make sure that you have the required permissions.
Select the device for the writing from the parameter "Port Name" and establish the connection to the interface by setting the parameter "Connect" to 1. Use the button for executing MERLIC once to execute this tool in single steps. This gives you the possibility to write the data step by step.
If a "Serial Handle" is connected from a previous tool, the parameters will be adopted from the first tool only. Thus, if you want to adjust the parameter settings in the current tool, you have to make the adjustments in the first tool, else the parameter changes will be ignored.
Execution Behavior
The behavior of this tool regarding the execution differs from the default behavior. Usually a MERLIC tool is executed in the following cases:
- The MERLIC Vision App is explicitly executed in continuous mode.
- The MERLIC Vision App is explicitly executed in "Run Once" mode.
- A MERLIC Vision App with the tool is opened in the MERLIC Creator.
- A parameter value of the tool has been changed in the MERLIC Creator.
However, the tool "Write to Serial Interface" is only executed in the following cases:
- The MERLIC Vision App is explicitly executed in continuous mode.
- The MERLIC Vision App is explicitly executed in "Run Once" mode.
This ensures that read and write operations are not applied when loading an MVApp or changing a parameter value of the tool. However, if the parameter Connect is set to 1, the tool still tries to establish a connection to the remote device.
Parameters
Values that are set to 0 by default (e.g., "Baud Rate", "Number of Data Bits"), are actually not 0, but are defined automatically.
Basic Parameters
Port Name:
This parameter defines the name of the device to which the data are written. It is set to "COM3" by default. The "Port Name" is operating system specific. On Windows machines typically the ports "COM1" - "COM4" are used. However, you can also change its value by typing the desired port name into the input field of the connector.
Connect:
This parameter defines if the connection to the serial interface is activated or deactivated. The parameter is set to 0 by default. This means that the connection to the serial interface is not active and therefore the connection is not established for writing. If you want to start writing the data to the serial interface, you have to set the parameter to '1' to open the connection for writing.
Since the tool is executed with every change of values, we recommend to set the parameter "Connect" to '0' until the tool has been completely configured.
Data:
This parameter contains the data that are written to the serial interface. It contains the number 65 by default. The data may either be represented by an integer value in the range between '0' and '255' or string values. If you want to write the result of a previous tool, you can connect the parameter to the respective result of the previous tool. Then, the connected data will be written to the serial interface.
Baud Rate:
This parameter determines the input and output speed of the serial interface. It is set to 9600 by default. You can change the "Baud Rate" at the corresponding connector.
Number of Data Bits:
This parameter defines the number of the sent data bits. The parameter is set to 0 by default. You can change the "Number of Data Bits" at the corresponding connector.
Number of Stop Bits:
This parameter defines the number of the sent stop bits. The parameter is set to 0 by default. You can change the "Number of Stop Bits" at the corresponding connector.
Additional Parameters
Serial Handle:
This parameter can be used to specify the handle of the serial interface to which the data are written, i.e., from the previous tool, where a "Serial Handle" is already defined. If the "Serial Handle" is set, all control parameters, e.g., "Port Name", "Baud Rate" and so on, will be adopted from this previous tool.
Flow Control:
This parameter determines what kind of data flow control should be used. It is set to "unchanged" by default. You can change the Flow Control type at the corresponding connector.
|
Value |
Description |
|---|---|
|
none |
No flow control is used. |
|
cts_rts |
Hardware control is used. |
|
dtr_dsr |
Hardware control is used. |
|
xon_xoff |
Software control is used. |
|
dtr_dsr xon_xoff |
A combination of hardware control and software control is used. |
|
cts_rts xon_xoff |
A combination of hardware control and software control is used. |
|
cts_rts dtr_dsr |
A combination of hardware controls is used. |
|
cts_rts dtr_dsr xon_xoff |
A combination of hardware controls and software control is used. |
|
unchanged |
The current flow control is used. |
Parity:
This parameter defines what kind of parity check of the transmitted data is performed. It is set to "unchanged" by default. You can change its value at the corresponding connector.
|
Value |
Description |
|---|---|
|
none |
No parity check is performed. |
|
odd |
Checks, if the number of bits in the data with the value one is odd. |
|
even |
Checks, if the number of bits in the data with the value one is even. |
|
unchanged |
The current parity check type is used. |
Results
Basic Results
Serial Handle Used:
This parameter represents the handle of the serial interface to which the data are written. It can be used by a subsequent tool to write or read. It should be avoided that several tools use the same handle to read from or write to the same socket simultaneously since this may lead to unexpected effects.
Tool State:
"Tool State" returns information about the state of the tool and thus can be used for error handling. For more information, see Tool State Result
Additional Results
Processing Time:
This result returns the duration of the most recent execution of the tool in milliseconds. The result is provided as additional result. Therefore, it is hidden by default but it can be displayed via the button beside the tool results. For more information see the section Processing Time in the tool reference overview.