SERIAL_CONF: Structure of the Serial Line Configuration Data Type

Structure Description

The SERIAL_CONF structure contains configuration information about the serial line port. It contains these variables:

Variable

Type

Description

Bauds

DWORD

baud rate

InterframeDelay

WORD

minimum time (in ms) between 2 frames in Modbus (RTU, ASCII)

FrameReceivedTimeout

WORD

In the ASCII protocol, FrameReceivedTimeout allows the system to conclude the end of a frame at reception after a silence of the specified number of ms. If 0 this parameter is not used.

FrameLengthReceived

WORD

In the ASCII protocol, FrameLengthReceived allows the system to conclude the end of a frame at reception, when the controller received the specified number of characters. If 0, this parameter is not used.

Protocol

BYTE

0: Modbus RTU or Machine Expert (see CodesysCompliant)

1: Modbus ASCII

2: ASCII

Address

BYTE

Modbus address 0 to 255 (0 for Master)

Parity

BYTE

0: none

1: odd

2: even

Rs485

BYTE

0: RS232

1: RS485

ModPol (polarization resistor)

BYTE

0: no

1: yes

DataFormat

BYTE

7 bits or 8 bits

StopBit

BYTE

1: 1 stop bit

2: 2 stop bits

CharFrameStart

BYTE

In the ASCII protocol, 0 means there is no start character in the frame. Otherwise, the corresponding ASCII character is used to detect the beginning of a frame in receiving mode. In sending mode, this character is added at the beginning of the user frame.

CharFrameEnd1

BYTE

In the ASCII protocol, 0 means there is no end character in the frame. Otherwise, the corresponding ASCII character is used to detect the end of a frame in receiving mode. In sending mode, this character is added at the end of the user frame.

CharFrameEnd2

BYTE

In the ASCII protocol, 0 means there is no second end character in the frame. Otherwise, the corresponding ASCII character is used (along with CharFrameEnd1) to detect the end of a frame in receiving mode. In sending mode, this character is added at the end of the user frame.

CodesysCompliant

BYTE

0: Modbus RTU

1: Machine Expert (when Protocol = 0)

CodesysNetType

BYTE

not used