For the complete documentation index, see llms.txt. This page is also available as Markdown.

ModbusMasterTCP

ModbusMasterTCP (FB)

FUNCTION_BLOCK ModbusMasterTCP IMPLEMENTS IModbusConnector

InOut:

Scope
Name
Type
Initial
Comment

Input

xEnable

BOOL

TRUE

Input

xResetAuto

BOOL

Reset manual override of the connected slaves.

Input

sIPAddress

STRING(15)

‘192.168.60.10’

Input Const

uiPort

UINT

502

Network port for ModbusTCP

Input Const

tConnectTimeout

TIME

TIME#5s0ms

Timeout time for establishing the connection. When the time has elapsed, a repeating reconnect occurs after the time has elapsed tWatchdogDisconnect.

Input Const

tReplyTimeout

TIME

TIME#1s0ms

Reply timeout for Modbus requests; this applies to all connected slaves.1

Input Const

tWatchdogDisconnect

TIME

TIME#25s0ms

Watchdog that monitors an active connection and performs a reconnect after the time has elapsed.

Output

xConnected

BOOL

TRUE = connection to Modbus TCP participant established

Output

itfModbusConnector

IModbusConnector

THIS^

Output

udiConnectedSlaves

UDINT

Number of connected Modbus participants

Output

udiLastModbusRequestTime

UDINT

Modbus request transaction time in milliseconds

Output

udiNumberOfMsgSent

UDINT

Number of sent Modbus requests

Output

udiNumberOfMsgReply

UDINT

Number of received Modbus requests

Last updated