4. Configuration
206
SERIAL_TX
This function block is used to transmit a data buffer through serial port and it is only finalized after
all bytes were transmitted or after time-out (generating errors).
Figure 4-101. Block for Values Transmission by the Serial
This variable, when true, enables the
function block use.
Select the serial port, as described in the
SERIAL_PORT data type.
Pointer of a byte array to transmit the buffer
values.
Specify the expected character number in
the byte array to be transmitted (TX queue
maximum size is 1024 characters).
Specify the time-out to complete the
transmission including the handshake
phase. The specified value, in ms, must be
positive and different than zero.
Specified the delay, in ms, between the
function block call and the transmission
beginning. This variable can be used in
communications with some modems.
When true, the RX queue and the UART
FIFO RX are erased before the transmission
beginning. This behavior is typical in half-
duplex master/slave protocols.
Table 4-145. SERIAL_RX Input Parameters
This variable is true when the block is completely
executed. It is false otherwise.
This variable is true while the block is being executed.
It is false otherwise.
This variable is true when the block concludes the
execution with an error. It is false otherwise. It is
connected to the variable DONE, as its status is
showed after the block conclusion.
In case the ERROR variable is true, the STATUS
structure will show the error found during the block
execution. The possible states, already described in
the SERIAL_STATUS data type, are:
- NO_ERROR
- ILLEGAL_SERIAL_PORT
- PORT_BUSY
- HW_ERROR_UART
- HW_ERROR_REMOTE
- ILLEGAL_TX_BUFF_LENGTH
- CTS_TIME-OUT_ON
- CTS_TIME-OUT_OFF
- TX_TIME-OUT_ERROR
- NOT_CONFIGURED
Returns the transmitted byte number which must be
equal to TX_BUFFER_LENGTH, but can be smaller in