5. CONFIGURATION
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.
RTS_VALUE BOOL Value to be written on RTS signal.
RTS_EN BOOL
Enables the RTS_VALUE parameter writ-
ing.
DTR_VALUE BOOL Value to be written on DTR signal.
DTR_EN BOOL
Enables the DTR_VALUE parameter writ-
ing.
BREAK BOOL
In case it’s true, enables logic 0 (busy) in
the transmission line.
Table 185: SERIAL_SET_CTRL Input Parameters
Output parameters Type Description
DONE BOOL
This variable is true when the block is com-
pletely executed. It is false otherwise.
EXEC BOOL
This variable is true while the block is be-
ing executed. It is false otherwise.
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
- FB_SET_CTRL_NOT_ALLOWED
- NOT_CONFIGURED
Table 186: SERIAL_SET_CTRL Output Parameters
Utilization example in ST language, after the library is inserted in the project and the serial port configured:
PROGRAM UserPrg
VAR
Set_Control: SERIAL_SET_CTRL;
Port: SERIAL_PORT := COM1;
Status: SERIAL_STATUS;
END_VAR
//INPUTS:
Set_Control.REQUEST := TRUE;
248