Modbus/TCP Connection Properties

host (string, required)

Hostname or IP address of the modbus device

Example: "126.4.10.52"

port (integer, required)

Port of the Modbus device

Example: 15200

Additional restrictions:

  • Minimum: 1

  • Maximum: 65535

unitId (integer)

Default: 1

Additional restrictions:

  • Maximum: 255

socketTimeout (integer)

Default: 30000

Additional restrictions:

  • Minimum: 2000

batchReadEnabled (boolean)

Enables batching of read requests. When enabled, contiguous Modbus addresses sharing the same unit ID and function code are grouped into fewer, larger read requests, reducing the number of Modbus transactions per scan cycle.

Default: false

maxBatchSize (integer)

Maximum number of holding registers (FC3) or input registers (FC4) to read in a single batch request. Must be ≤ (PDU −2)/2, where the Modbus protocol defines a maximum PDU of 253 bytes, giving an upper limit of 125. However, some devices implement a smaller PDU, in which case maxBatchSize must be reduced accordingly. For coils (FC1) or discrete inputs (FC2), up to 2000 bits can be read per batch.

Default: 120

Additional restrictions:

  • Minimum: 1

  • Maximum: 125

connectionStrategy (object)

If a connection attempt fails, retries will be performed with increasing delay (waiting time) in between. The following parameters control how these delays behave.

Properties of the connectionStrategy object:

initialDelay (integer)

Delay (waiting time) of the first connection retry (in milliseconds). For subsequent retries, the delay will be increased according to the parameter incrementFactor which has a default value of 2.

Default: 1000

Additional restrictions:

  • Minimum: 1000

maxDelay (integer)

Maximum delay (waiting time) to wait until the next retry (in milliseconds). The delay (waiting time) for any subsequent connection retry will not be larger than this value. Must be strictly greater than initialDelay.

Default: 30000

incrementFactor (integer)

The factor used to increment initialDelay up to maxDelay. For example if initialDelay is set to 1000 and maxDelay to 5000 the values for the delay would be 1000, 2000, 4000, 5000.

Default: 2

Additional restrictions:

  • Minimum: 2

Last updated

Was this helpful?