5. CONFIGURATION
Purge_Queue();
//OUTPUTS:
Purge_Queue.DONE;
Purge_Queue.EXEC;
Purge_Queue.ERROR;
Status := Purge_Queue.STATUS; //If it is necessary to treat the error.
5.12.1.6. SERIAL_RX
This function block is used to receive a serial port buffer, using the RX queue normal mode. In this mode, each character
in the RX queue occupy a single byte which has the received data, storing 5, 6, 7 or 8 bits, according to the serial interface
configuration.
Figure 144: Block Used to Read the Reception Buffer Values
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.
RX_BUFFER_
POINTER
POINTER TO BYTE
Pointer of a byte array to receive the buffer
values.
RX_BUFFER_
LENGTH
UINT
Specify the expected character number in
the byte array. In case more than the ex-
pected bytes are available, only the ex-
pected quantity will be read from the byte
array, the rest will be leaved in the RX
queue (maximum size equal to 1024 char-
acters).
RX_TIMEOUT UINT
Specify the time-out to receive the ex-
pected character quantity. In case it is
smaller than the necessary to receive the
characters, the RX_TIME-OUT_ERROR
output from the STATUS parameter will be
indicated. When the specified value, in ms,
is equal to zero, the function will return the
data within the buffer.
Table 181: SERIAL_RX Input Parameters
243