Skip to content

Modbus TCP SCADA driver

Read and write Modbus TCP registers.

The Modbus TCP driver reads and writes the registers and coils of your devices. Each tag reads one address, polled on the connection's interval. It comes with the core.

How you connect it

From a Modbus TCP device to live values.

  1. Add the device

    Under Connections, choose Modbus TCP and add a device: its host, the port (502 unless you change it) and the unit id. Poll interval and reply timeout have defaults you can change.

  2. Choose the word order

    A value of 32 bits or more spans several registers, and the standard does not say in which order a device sends them. Choose ABCD, CDAB, BADC or DCBA for the connection, or for a single tag. If a float reads as nonsense, try the others.

  3. Browse or type the addresses

    Browse lists the four areas, then ranges of addresses, then what the device holds at each one in decimal, in hex and as the PLC manual numbers it. You can also type an address, such as holding:100, or a manual's number, such as 40101.

  4. Make the tags

    Tick the addresses, choose a data type and create the tags. A type of two or four registers starts at the address you ticked.

What it does

What the Modbus TCP driver does for you.

Four areas, ten data types

Holding registers, input registers, coils and discrete inputs, read as bool, int16, uint16, int32, uint32, int64, uint64, float32, float64 or text. A single bit of a register can be a tag.

Addresses as the device counts them

Addresses count from 0, as the device receives them. The register a PLC manual calls 40001 is address 0 in holding.

As few requests as it can

Tags of the same area and unit that touch, or lie within the gap you set, share one request, up to the registers-per-request limit.

One bad address does not stop the rest

When a device refuses a request that holds several tags, each of those tags is read alone from then on, so the good ones keep working. The refused tag is bad, with the device's own words as the detail.

Writes with the right function code

Coils and holding registers can be written. A value that does not fit the type, such as 70000 for a uint16, is refused with a sentence. Input registers and discrete inputs cannot be written.

No third-party dependency

The driver speaks the protocol itself. The link is a tag too: its state, error and request counts are published with history.

Settings

What you set, and what it starts as.

The settings of a Modbus TCP connection
SettingWhat it doesDefault
Host and portThe device's address, and the port from 1 to 65535.Port 502
Unit id0 to 255, also called the slave id. A gateway to serial devices uses it to pick one.1
Poll intervalHow often every tag on the connection is read, from 20 ms to 1 hour.1000 ms
Reply timeoutHow long to wait for an answer before the link counts as lost, from 100 ms to 60 s.3000 ms
Word and byte orderHow a value of more than one register is laid out. A tag can use its own.ABCD
Registers per requestThe most registers one request reads, from 1 to 125. Lower it for a device that refuses long reads.100
Read across gaps ofUnused registers to read through to join two tags into one request.0

What has been tried

As far as it has been tested, and no further.

Modbus TCP

The driver has run against a Modbus TCP device written for its tests. No real PLC or meter has been tried yet.

The driver comes with the core.

Questions

Questions people ask.

Does it work with my PLC or meter?

It follows the Modbus TCP standard and has run against a device written for its own tests. No real PLC or meter has been tried yet, so use Test and Browse on yours before you rely on it.

Why do my values read as nonsense?

The Modbus standard does not fix the order of the registers of a 32-bit or 64-bit value. Try the four orders, ABCD, CDAB, BADC and DCBA, on the connection or on the tag.

How often does it read?

Every tag on a connection is read on the connection's poll interval, 1,000 ms unless you change it. A value is published when it changes, when its quality changes, and every 30 seconds even if neither did.

Can Scadex act as a Modbus server too?

Yes. The Modbus server is a separate add-on that serves tags to Modbus TCP clients, such as PLCs, HMIs and other SCADA, through a register map.

Other ways in

Connect more than one kind of equipment.

Interested in learning more?

Tell us about your plant and what you run today, or what you want to build on it. We answer in plain language.