DataTalk

Modbus TCP / UDP

On this page

Modbus is the most widely deployed industrial communication protocol. It connects PLCs, energy meters, variable-speed drives, and sensors over Ethernet using a simple request/response model.

Modbus TCP communicates over TCP/IP — reliable, connection-oriented, suitable for the majority of installations.

Modbus UDP uses a connectionless transport that is faster but without delivery guarantees — suited for time-critical or read-only applications on reliable local networks.

Strings not supported

Modbus communication supports numerical values only. String read/write is not supported.

Modbus connection parameters

Connection parameters

ParameterDescription
IP AddressIP address of the Modbus device
PortTCP/UDP port — default 502
Unit IDModbus slave address (1–247). Use 1 for most devices; 0 for TCP-only devices
Polling intervalHow often tags are read from the device (ms)
Byte OrderLittle Endian — least significant byte first (e.g. 0x123434 12). Big Endian — most significant byte first (e.g. 0x123412 34)
Bit OrderStandard — bit 7 to bit 0. Reverse — bit 0 to bit 7
Max Data LengthMaximum number of words read in a single request. Reduce for devices with limited read capacity
Max Data GapMaximum allowed gap between data blocks read continuously. Used for optimization — leave unchanged unless needed
Max wait timeMaximum time to wait for a response from the device (ms). Increase for slow networks or devices
Single value write onlyWhen enabled, uses FC5/FC6 (single write) instead of FC15/FC16 (multiple write)

Address mapping

DataTalk uses a short addressing format. Addresses start from 0 (not from 1 as in Modicon notation):

AreaModicon rangeAccessPrefixExample
Discrete Outputs (Coils)00001–09999Read/WriteO:O:0 → 00001
Discrete Inputs10001–19999Read onlyI:I:0 → 10001
Input Registers30001–39999Read onlyR:R:0 → 30001
Holding Registers40001–49999Read/WriteH:H:0 → 40001

Multiple devices on one line

When multiple devices share the same IP (e.g. RS-485 to Ethernet converter with multiple meters), each device is identified by its Device ID set in the tag’s address field in the Tag Database.

Example: four power meters on one converter — assign Device IDs 1, 2, 3, 4 per meter.

Modbus Device ID in tag address field

Batch optimization

Batch optimization groups multiple tags into a single Modbus request, reducing communication overhead and improving throughput:

SettingDescription
Max tag countMaximum number of tags grouped into one request
Max wait timeMaximum time to collect tags before sending the batch

Larger batches mean fewer requests and better efficiency, but may add slight latency for individual tags.

Modbus batch optimization settings