All articles
Industrial IoTAutomation

Modbus TCP vs OPC UA: Which One Does Your Plant Need?

Hardik PatelNov 19, 20265 min read
Modbus TCP vs OPC UA: Which One Does Your Plant Need?

If you want machine data to leave the factory floor and appear on a dashboard, two protocols come up almost immediately: Modbus TCP and OPC UA. Most current PLCs support at least one of them, and many support both. Both get values out of a controller, but they work very differently. The choice affects how long the project takes and how easy the system is to maintain afterwards.

This is a practical comparison from the software side. It covers what each protocol gives you, where each one causes trouble, and how to decide.

Modbus TCP in one minute

Modbus was published in 1979 and is still everywhere because it is simple. A controller exposes numbered memory areas: coils and discrete inputs for on/off values, holding and input registers for numbers. A client reads them by address, over TCP port 502.

That simplicity is both its strength and its weakness. A Modbus read returns raw 16-bit numbers. Nothing in the response says what the value means, what unit it is in, or whether it is half of a larger value. That knowledge lives in a register map, usually a spreadsheet or PDF from the machine builder. It tells you, for example, that holding register 40101 is spindle speed in rpm and that registers 40103–40104 together hold motor temperature as a 32-bit float.

  • Good at: drives, energy meters, older PLCs and simple devices; quick wins with a handful of values.
  • Watch out for: missing or outdated register maps; the off-by-one gap between documented addresses (40001) and the offsets actually sent on the wire (0); and 32-bit values split across two registers, where the word order differs between vendors.
  • Security: none built in. There is no authentication and no encryption. Anyone who can reach port 502 can read values, and often write them too. The network has to provide the protection.

OPC UA in one minute

OPC UA (Open Platform Communications Unified Architecture) is a newer standard, designed for exactly this job: exchanging industrial data between systems from different vendors. There are no numbered registers. Instead, the server exposes a browsable address space of named, typed nodes, such as Line1 › Filler › MotorTemp: a floating-point value in °C, with a timestamp and a quality status.

  • Good at: larger systems with many tags and mixed vendors, and anything you will need to maintain for years.
  • Watch out for: certificate exchange between client and server; licensing (on some PLCs the OPC UA server is a paid or separately enabled option); and session and item limits on smaller controllers.
  • Security: built in. It supports signed and encrypted connections, application certificates and user authentication.

OPC UA also supports subscriptions. The client tells the server which values it needs and how often to sample them, and the server sends only the changes. With Modbus, the client polls every register on a timer, whether the value has changed or not.

Side by side

Modbus TCPOPC UA
Data modelNumbered registers holding raw valuesNamed, typed tags with timestamps and quality
Finding the dataNeeds a register map from the machine builderBrowse the server’s address space
UpdatesClient polls on a timerSubscriptions send changes
SecurityNone built inCertificates, signing, encryption, user login
Setup effortLow per device, high per tagHigher per server, low per tag
Typical devicesDrives, meters, older PLCsCurrent PLCs, SCADA systems, OPC servers
Default port5024840

How to choose

In practice, the equipment often makes the choice for you. A simple rule that works on most floors:

  1. If the PLC has an OPC UA server, use it. Named tags and built-in security save time over the life of the system, especially when the machine program changes and a register map would drift out of date.
  2. If a device only speaks Modbus, use Modbus and request the register map on day one. It is usually the slowest document to obtain.
  3. If a device speaks neither, a protocol gateway or an OPC server can translate its native protocol into Modbus TCP or OPC UA.
  4. Expect a mix. Most plants end up using both. The software that collects the data should normalise everything into one set of named tags, so dashboards and reports do not depend on which protocol a value came from.

Where MQTT fits

MQTT often comes up in the same conversation, but it does a different job. Modbus TCP and OPC UA are typically used to talk to the controller. MQTT is a lightweight publish/subscribe protocol for moving the collected data onwards: from an edge device to a server or the cloud. It copes well with unreliable networks and lets many systems subscribe to the same stream.

A common pattern is an edge service that reads PLCs over Modbus TCP or OPC UA, then publishes clean, named values over MQTT.

Start read-only

Both protocols can write as well as read, which is useful for setpoints, recipe changes and remote resets. But writing to a running machine from a dashboard is a safety and process decision, not a software convenience. We recommend connecting read-only first. Add write actions later, deliberately, with role-based access, confirmations, an audit trail and sign-off from your controls engineer.

See both running

We have a working demo that reads live data over both Modbus TCP and OPC UA and shows it on dashboards. It is the quickest way to see the difference in practice, and to talk through what connecting your own machines would involve.

Read more about our industrial IoT and automation software, our HMI and SCADA design work, or the machine monitoring and OEE solution. Or book the Modbus TCP and OPC UA demo.

Let's Talk

Drop an inquiry to get connected and drive the innovations for your dynamic mobile app ideas.

Let's build your next product.