5. CONFIGURATION
Output parameters Type Description
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
PARAMETERS SERIAL_PARAMETERS
This structure receives the serial port con-
figuration parameters, as described in the
SERIAL_PARAMETERS data type.
Table 174: SERIAL_GET_CFG Output Parameters
Utilization example in ST language, after the library is inserted in the project:
PROGRAM UserPrg
VAR
GetConfig: SERIAL_GET_CFG;
Port: SERIAL_PORT := COM1;
Parameters: SERIAL_PARAMETERS;
Status: SERIAL_STATUS;
END_VAR
//INPUTS:
GetConfig.REQUEST := TRUE;
GetConfig.PORT := Port;
//FUNCTION:
GetConfig();
//OUTPUTS:
GetConfig.DONE;
GetConfig.EXEC;
GetConfig.ERROR;
Status := GetConfig.STATUS; //If it is necessary to treat the error.
Parameters := GetConfig.PARAMETERS; //Receive the parameters of desired serial
port.
5.12.1.3. SERIAL_GET_CTRL
This function block is used to read the CTS, DSR and DCD control signals, in case they are available in the serial port. A
false value will be returned when there are not control signals.
238