Sending and Receiving

Data is sent and received from the standard task.

The example program included sends data by way of different serial hardware interfaces.
At the same time data with correct prefix and suffix is received.
If a loop back adapter is connected to the serial hardware interfaces, the sent characters are received again and again.

Sending and Receiving 1:

Many other use cases exist. For example data can be sent by way of the serial PC interface to a printer. Or a bar code from a scanner that is connected to a serial bus terminal can be received.

Possible errors

More than one character may be transmitted during one PLC cycle, provided they can be accepted by the send buffer. If the send buffer overflows, the busy output of the send block will remain TRUE after it has been called. In that case the last character is not sent, and the block must be called again with the same input data in the next PLC cycle. How full a buffer is can be determined at any time (e.g. TxBuffer.Count or TxBuffer.FreeByte).