5. CONFIGURATION
Figure 143: Block Used to Clean the RX Queue
Input parameters Type Description
REQUEST BOOL
This variable, when true, enables the func-
tion block use.
PORT SERIAL_PORT
Select the serial port, as described in the
SERIAL_PORT data type.
Table 179: SERIAL_PURGE_RX_QUEUE Input Parameters
Output parameters Type Description
DONE BOOL
This variable is true when the block is com-
pletely executed. It’s false otherwise.
EXEC BOOL
This variable is true while the block is be-
ing executed. It’s false otherwise.
ERROR BOOL
This variable is true when the block con-
cludes the execution with an error. It’s
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
Table 180: SERIAL_PURGE_RX_QUEUE Output Parameters
Utilization example in ST language, after the library is inserted in the project and the serial port configured:
PROGRAM UserPrg
VAR
Purge_Queue: SERIAL_PURGE_RX_QUEUE;
Port: SERIAL_PORT := COM1;
Status: SERIAL_STATUS;
END_VAR
//INPUTS:
Purge_Queue.REQUEST := TRUE;
Purge_Queue.PORT := Port;
//FUNCTION:
242