4. Configuration
199
SERIAL_GET_RX_QUEUE_STATUS
This block is used to read some status information regarding the RX queue, specially developed for
the normal mode, but it can also be used in the extended mode.
Figure 4-96. Block Used to Visualize the RX Queue Status
This variable, when true, enables the function
block use.
Select the serial port, as described in the
SERIAL_PORT data type.
Table 4-135. SERIAL_GET_RX_QUEUE_STATUS 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
- NOT_CONFIGURED
Returns the RX queue status/error, as
described in the
SERIAL_RX_QUEUE_STATUS data type.
Table 4-136. 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 MainPrg
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;