4. Configuration
207
case some error has occurred during transmission.
Table 4-146. SERIAL_RX Output Parameters
Utilization example in ST language, after the library is inserted in the project and the serial port
configured:
PROGRAM MainPrg
VAR
Transmit: SERIAL_TX;
Port: SERIAL_PORT := COM1;
Buffer_Pointer: ARRAY [0..9] OF BYTE := [0,1,2,3,4,5,6,7,8,9];
Status: SERIAL_STATUS;
END_VAR
//INPUTS:
Transmit.REQUEST := TRUE;
Transmit.PORT := Port;
Transmit.TX_BUFFER_POINTER := ADR(Buffer_Pointer);
Transmit.TX_BUFFER_LENGTH := 10;
Transmit.TX_TIMEOUT := 10000;
Transmit.DELAY_BEFORE_TX := 1000;
Transmit.CLEAR_RX_BEFORE_TX := TRUE;
//FUNCTION:
Transmit();
//OUTPUTS:
Transmit.DONE;
Transmit.EXEC;
Transmit.ERROR;
Status := Transmit.STATUS; // If it’s necessary to treat the error.
Transmit.TX_TRANSMITTED;
Inputs and Outputs Update
Functionality used to update inputs and outputs in the applicative. It is not necessary to wait until the
cycle is finished.
When the function blocks to update the inputs and outputs are not used, the update is performed at
every cycle of the MainTask.
ATTENTION:
At the startup of a Nexto CPU, the inputs and outputs are only updated for reading and prepared for
writing when the MainTask is performed. All other system tasks that run before MainTask will be
with the inputs and outputs invalid.