5. CONFIGURATION
Output parameters Type Description
ERROR BOOL
This variable is true when the block con-
cludes the execution with an error. It is
false otherwise. It is connected to the vari-
able DONE, as its status is showed after the
block conclusion.
STATUS SERIAL_STATUS
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
- NOT_CONFIGURED
RXQ_STATUS
SERIAL_RX_
QUEUE_STATUS
Returns the RX queue status/er-
ror, as described in the SE-
RIAL_RX_QUEUE_STATUS data
type.
Table 178: SERIAL_GET_RX_QUEUE_STATUS Output Parameters
Utilization example in ST language, after the library is inserted in the project and the serial port configured:
PROGRAM UserPrg
VAR
Get_Status: SERIAL_GET_RX_QUEUE_STATUS;
Port: SERIAL_PORT := COM1;
Status: SERIAL_STATUS;
Status_RX: SERIAL_RX_QUEUE_STATUS;
END_VAR
//INPUTS:
Get_Status.REQUEST := TRUE;
Get_Status.PORT := Port;
//FUNCTION:
Get_Status();
//OUTPUTS:
Get_Status.DONE;
Get_Status.EXEC;
Get_Status.ERROR;
Status := Get_Status.STATUS; //If it is necessary to treat the error.
Status_RX := Get_Status.RXQ_STATUS; //If it is necessary to treat the error of
the RX.
5.12.1.5. SERIAL_PURGE_RX_QUEUE
This function block is used to clean the serial port RX queue, local and remote. The UART RX FIFO is restarted too.
241