The function allows the modification of the settings of the serial interface.
This function overwrites settings in the PLC configuration (Object "COM"). The display in the PLC configuration is not update, and therefore may not correspond to the modified settings of the serial interface.
This function enables other parameterization and control functions. Certain functions allow access to the HW driver. Only use these functions with exact knowledge of their effect on the driver. The following table lists the supported control functions. Use of this function is not necessary for standard applications.
The parameter i_diArg has two meanings:
SET:
Set values, i. e. the value in the table is transferred.
GET:
Reading values; that is, the address of a DINT variable must be transferred in i_diArg. The desired value is stored there.
Function |
Func |
Argument |
Case |
Argument |
---|---|---|---|---|
SIO_BAUD_SET Set baud rate |
16#1003 |
- |
SET |
- |
SIO_BAUD_GET Read baud rate |
16#1004 |
- |
GET |
- |
SIO_HW_OPTS_SET |
16#1005 |
CLOCAL (ignore modem status lines) CREAD (enable receiver) CSIZE (mask to encode the size) CS5 (5 bits) CS6 (6 bits) CS7 (7 bits) CS8 (8 bits) HUPCL (hang up on last close) STOPB (two stop bits, else one) PARENB (parity enabled, else disabled) PARODD (odd parity, else even) |
SET |
16#01 16#02 16#0C 16#00 16#04 16#08 16#0C 16#10 16#20 16#40 16#80 |
SIO_HW_OPTS_GET |
16#1006 |
- |
GET |
- |
SIO_MODE_SET |
16#1007 |
SIO_MODE_POLL SIO_MODE_INT SIO_MODE_AUTO_POLL – Poll automatically |
SET |
1 2 4 |
SIO_MODE_GET |
16#1008 |
- |
GET |
- |
SIO_AVAIL_MODE_GET |
16#1009 |
- |
GET |
- |
SIO_RX_FIFO_SET Size received FIFO |
16#100A |
- |
SET |
- |
SIO_RX_FIFO_GET Determine transmission FIFO size |
16#100B |
- |
GET |
- |
SIO_TX_FIFO_SET Set reception FIFO size |
16#100C |
- |
SET |
- |
SIO_TX_FIFO_GET Determine transmission FIFO size |
16#100D |
- |
GET |
- |
SIO_RX_FIFO_PURGE Delete reception FIFI |
16#100E |
- |
SET |
- |
SIO_TX_FIFO_PURGE Delete transmission FIFO |
16#100F |
- |
SET |
- |
SIO_FIFO_FLUSH Empty reception FIFO, transfer to driver |
16#1010 |
- |
SET |
- |
Set SIO_TYPE_SET interface type |
16#1014 |
SIO_TYPE_RS232 SIO_TYPE_RS422 SIO_TYPE_RS485_4_WIRE SIO_TYPE_RS485_2_WIRE |
SET |
0 1 2 3 |
SIO_TYPE_GET Determine interface type |
16#1015 |
- |
GET |
- |
SIO_FLUSH_TICKS_SET Set frequencies for FIFO flush |
16#1020 |
Processing time in ticks (currently 250 µs) |
SET |
- |
SIO_FLUSH_TICKS_GET Read frequencies for FIFI flush |
16#1021 |
- |
GET |
- |
SIO_FIFO_PURGE Delete transmission and reception FIFO, reset echo cancelation |
16#1022 |
- |
SET |
- |
SIO_PROTOCOLTYP_SET |
16#1040 |
Set protocol type - no protocol - XON/XOFF (not yet available) - Hardware protocol (RTS/CTS) |
SET |
0 1 2 |
SIO_PROTOCOLTYP_GET |
16#1041 |
Read protocol type |
GET |
- |
Input |
Data type |
Description |
---|---|---|
i_stComIecId |
ST_LogicalAddress |
Device selection |
i_diFunc |
DINT |
Device-specific function code |
i_diArg |
DINT |
Function-specific argument or address of the result buffer |