Comparison
Read sensor data from SCADA server: OPC, Modbus or capture
Short answer
Read sensor data from the SCADA server's OPC interface first: it already carries tag names, scaling and quality. Fall back to a documented PLC protocol read such as Modbus TCP. Reserve passive capture on a switch mirror port for diagnostics, because it returns raw frames with no tag names, and nothing at all once the traffic is encrypted.
On this page
Sensor values in a running SCADA system can leave through three doors, and they are not equal. Read the SCADA server's OPC interface first: it already carries the tag names, engineering units and quality your screens use, and it loads the server instead of the PLC. When no OPC interface is exposed, poll the PLC directly over a documented protocol such as Modbus TCP, on TCP port 502 with read function codes 01, 02, 03 and 04. Passive capture on a switch mirror port is a diagnostic, not a data path: it returns raw frames with no tag names, and nothing at all once the traffic is encrypted. The table below compares the three paths, and the worked example sizes a Modbus poll you can defend.
What each access path returns #
| Access path | Connects to | What you get | Load added | Main limitation |
|---|---|---|---|---|
| OPC client on the SCADA server's interface | The SCADA server or its OPC server process; an OPC UA endpoint listens on port 4840 unless the project moves it | Named tags, engineering units, quality and timestamp | One subscriber on the server | The server must expose OPC and grant your client access |
| Modbus TCP read on the PLC | The PLC's Ethernet port, on TCP port 502 | Raw register and coil values at addresses you choose | Polling sessions against the PLC's connection budget | No tag names; you need the register map |
| Passive capture on a mirror port or TAP | The switch between SCADA and PLC | Raw frames you decode yourself | Nothing on the PLC | No tag names; unreadable once the traffic is encrypted |
The first two are documented, supported interfaces that the system owner can grant and revoke. The third is a view of traffic that was never addressed to you, which is why it belongs to diagnostics rather than to a standing data link.
What a screen value is made of #
A number on an operator screen passes through a chain, and each path taps a different link:
- The field sensor produces an analog signal or a digital state.
- The PLC input card converts it to a raw count, and the PLC logic scales it into an engineering value held in a register or tag.
- The SCADA driver polls or subscribes to that register and binds it to a SCADA tag.
- The screen object displays the tag.
An OPC read taps in after the third step, so it returns the same named, scaled value the screen shows, with its quality. A Modbus read taps in after the second step, so it returns the register as the PLC holds it, which may be raw counts or different units. A capture shows the traffic of steps two and three: register numbers and bytes, never names. Before you pick a path, open the SCADA configuration, find the tag, and note its driver, device address and scaling; that record is the map every other step depends on.
Read the SCADA server's OPC interface #
Get the system owner's written approval and a read-only client identity before the first connection, and never attach a client that can write to a running process: that single rule keeps the exercise safe.
The server documentation states which interface it exposes. Classic OPC DA rides on DCOM and needs the documented DCOM configuration on both machines; OPC UA uses an endpoint URL taken from the server settings, with certificates trusted in both directions. The interface may run inside the SCADA server itself or as a separate process; where an OPC UA server sits when Python reads PLC data works through that placement question.
Install an OPC client on a machine the network permits to reach the server, browse the address space, and put the sensor tags into a subscription. Set the update rate to match the process, slow for temperatures and faster for pressures, rather than the fastest the server allows. Check the quality code on every item: bad quality means the driver or the link to the PLC has failed, so the number is a fault state, not a reading. If the client connects but the browse comes back empty, the cause is almost always access rights or an unpublished tag group rather than the network; why an OPC UA browse returns no properties under a tag works one such case in detail.
Read the PLC over Modbus TCP #
Use this path when the server exposes no OPC interface but the PLC serves Modbus TCP and its owner approves extra sessions. The settings the PLC needs first are exactly those in what you must configure on the PLC side for Modbus TCP, and the register map must come from the PLC documentation, because the protocol carries no tag names.
| Data in the PLC | Read function code | Check before you trust it |
|---|---|---|
| Coils | 01 Read Coils | The address base the map uses |
| Discrete inputs | 02 Read Discrete Inputs | The address base the map uses |
| Holding registers | 03 Read Holding Registers | 16-bit versus 32-bit values and word order for floats |
| Input registers | 04 Read Input Registers | Scaling: raw counts or engineering units |
Connect the master tool to the PLC's address on the Modbus TCP port, 502 by default for the protocol, with the unit ID from the PLC project. Configure the tool with read functions only, poll a small block at a modest rate, and compare each register with the SCADA screen for the same sensor. A value off by a constant factor is a raw integer with an implied decimal point; take the scaling from the PLC or the tag. A value one register early or late means the map counts from 40001 while the wire address is zero, or the reverse. Floats that look like garbage are word order: swap the two words in the tool.
Keep the tap read-only for a second reason as well: writes from outside the control logic fight the program that owns the process, and write contention is exactly what two SCADA servers writing to one PLC over Modbus TCP documents. On a serial Modbus line the limit is harder, one master at a time, so a second master corrupts the SCADA polling; use a gateway or the server's OPC interface there. If the PLC speaks EtherNet/IP rather than Modbus, the same discipline applies, and how a SCADA system reads EtherNet/IP adapter sensor data walks the adapter path.
Counting the bytes in one Modbus TCP read of 8 registers at 1 poll per second #
The question named no particular plant, so this is the typical case: eight adjacent holding registers, one temperature per register, read once per second. The register count and the poll rate are example inputs for a slow process value; the frame sizes are the documented Modbus TCP message structure, not estimates.
The rule in words: every Modbus TCP message opens with a 7-byte header, made of a 2-byte transaction identifier, a 2-byte protocol identifier, a 2-byte length field and a 1-byte unit identifier. A function 03 request adds the function code (1 byte), the first register address (2 bytes) and the register quantity (2 bytes); its response adds the function code (1 byte), a byte count (1 byte) and 2 bytes per register read.
For one block read of the 8 registers:
- Request: 7 + 1 + 2 + 2 = 12 bytes.
- Response: 7 + 1 + 1 + (8 × 2) = 25 bytes.
- Per poll: 12 + 25 = 37 bytes, so at 1 poll per second the payload is 37 bytes per second, about 296 bits per second of application data.
For the same eight values as eight single-register reads:
- Request: 12 bytes each; response: 7 + 1 + 1 + 2 = 11 bytes each, so 12 + 11 = 23 bytes per read.
- Per second: 8 × 23 = 184 bytes, spread over 8 request-response transactions instead of 1.
The result: batching turns 184 bytes per second and eight transactions into 37 bytes per second and one transaction, a fifth of the payload and an eighth of the transactions. TCP/IP and Ethernet framing add fixed bytes on top of every frame; they shift both totals the same way and change no comparison. The decision: bytes are never the binding limit on a 100 Mbit/s control network, so the real budget is the PLC's connection count and scan time. Whenever the values sit in adjacent registers, read them as one block; poll at the rate the value changes, and one read per second is already generous for these temperatures; hold the client one session below the PLC's documented connection limit.
When passive capture is worth doing #
Capture answers what the other two paths cannot: what the SCADA actually polls, which addresses it uses, why a link drops intermittently. Treat it as a bounded diagnostic session, not the standing way to collect sensor data.
Have the network owner set up a mirror, also called a SPAN, port on the switch between the SCADA and PLC, or fit a network TAP, and mirror only the SCADA and PLC ports. Never configure a mirror that sends traffic back into the control network. Run the analyzer on a machine that has a port to receive the mirror feed; an industrial mini PC in the cabinet is the kind of host that takes that role. Filter on the PLC's address and the Modbus TCP port so the decode shows function codes and register addresses only, then match the decoded addresses against the register map to put names on the values.
If the link runs OPC UA with signing and encryption, or any other encrypted protocol, the payload is unreadable in a capture: only headers and ports are visible. That is the encryption doing its job, so the OPC client route is the read that still works.
The decision for each case #
- The SCADA server exposes OPC and grants a read-only identity: read there. Named tags, scaling, quality and timestamp come with the value, and the PLC never sees your traffic.
- No OPC interface, but the PLC serves Modbus TCP and you hold the register map: poll the PLC with the read function codes only, batch adjacent registers into single reads, match the poll rate to how fast the value changes, and stay one session under the documented connection limit.
- You need to know what is already on the wire, or the link misbehaves: capture on a mirror port for a bounded diagnostic, decode against the register map, and close the session afterwards. Encrypted traffic ends this path; the OPC interface is then the only supported read.
Questions asked
Which Modbus function codes are safe for a read-only sensor tap?
Use only the four read codes: 01 for coils, 02 for discrete inputs, 03 for holding registers and 04 for input registers, on TCP port 502. Leave out 05, 06, 15 and 16, which write coil or register values. Configure the master tool so only reads exist in its scan, and confirm the PLC's register map before the first request.
How many extra Modbus TCP clients can one PLC serve?
There is no shared number: each PLC model documents how many simultaneous server connections its Modbus TCP interface accepts, and every master takes one. Count the SCADA driver, any gateway and your read-only client against that figure, and keep at least one connection free. If adding the client pushes you to the limit, batch registers into fewer, slower reads instead of adding sessions.
What does an OPC quality flag of bad or uncertain tell me?
In OPC a quality of bad means the server has no valid value for the item, usually because the SCADA driver lost the PLC or the device, so treat it as a communications fault rather than a sensor reading. Uncertain means the value is stale, substituted or outside its valid range, so note the timestamp before using it. Only good quality carries a usable process value.
How fast should I poll a slow sensor over Modbus TCP?
Match the request rate to how fast the value changes, not to the fastest the PLC answers. For a temperature, level or similar slow process value, one read per second is generous, and slower rates cut transactions further. Batch adjacent registers into one read so each cycle is a single request and response, and verify the PLC's scan time still absorbs the added traffic.