Explainer
How digital inputs reach a Modbus TCP SCADA read
Short answer
A digital input reaches a Modbus TCP SCADA read through three matched pieces: the input module's on and off voltage thresholds fit the measured field signal, the rack's Ethernet I/O processor runs the Modbus TCP slave, and the SCADA driver's register reference lands on the channel's documented place in the slave's data map. Miss one and the read returns nothing, an exception, or the wrong channel.
On this page
- How does a field digital input become a Modbus TCP register?
- Which device answers the SCADA read request?
- Which input module suits a 24 to 124 VDC field signal?
- Where in the slave's data map does the channel live?
- How do I turn a channel number into a register reference?
- How do I prove the SCADA read end to end?
- Why does a valid response show the wrong channel?
- Which computer should run the SCADA client at the machine?
- Questions asked
A digital input reaches a Modbus TCP SCADA read through three matched pieces, and the Ethernet run is the easiest of them. The field signal terminates on an input module in a remote I/O rack; the rack's Ethernet I/O processor runs the Modbus TCP slave and serves every channel as a bit in its documented data map; the SCADA driver must ask for exactly that bit with the right function code and reference. The modules themselves never touch the network. This article traces the path from field terminal to screen point, names the Modbus specification numbers worth checking — the four data areas, the read function codes, and the reference-versus-address offset — works a 16-channel mapping example in full arithmetic, and ends with the decision for each case.
How does a field digital input become a Modbus TCP register? #
A field input never reaches Ethernet by itself: the 24-124 VDC signal lands on an input module in a rack, and the rack's Ethernet I/O processor — not the module — serves each channel as a Modbus TCP bit that the SCADA client reads.
Two separate paths meet only at the processor. The electrical path is the field voltage into the module terminals; the data path is a TCP conversation between the SCADA PC and the processor. Verifying one proves nothing about the other, and most first-time faults sit on the electrical half.
- Field device to module terminals: a DC voltage with polarity and a common reference. The module's guaranteed on and off thresholds decide when the channel reads ON, not the nominal voltage printed on the drawing.
- Module to rack backplane: the channel state becomes a value the processor reads locally.
- Processor to Ethernet: the processor is the Modbus TCP slave — one IP address, one unit identifier, the Modbus service live on its Ethernet port.
- SCADA PC to processor: the client sends read requests by function code and reference, then decodes the reply.
The decision that orders all later checks: confirm the channel changes state at the processor itself before touching any SCADA configuration. An input that sits OFF at the processor will read OFF through Modbus no matter how correct the driver's address is.
Which device answers the SCADA read request? #
The Ethernet I/O processor in the rack answers: it is the Modbus TCP server (slave), while the SCADA PC connects as the client (master) to the processor's IP address, the Modbus TCP port and the unit identifier, and the input modules stay behind the rack backplane.
Input modules are backplane devices: they terminate field wires and hand channel state to the rack's processor, which is the part with the Ethernet connector. Ethernet remote I/O processors are built to serve data this way — the Modbus TCP slave function on the Ethernet port is the documented mechanism by which remote SCADA software reads data and I/O states.
The connection targets three documented values. The port is 502, the one registered to Modbus in the Modbus Messaging on TCP/IP implementation guide. The unit identifier byte travels in every request; the processor's own documentation names the right value for the role. The IP address is the processor's, from its configuration records.
The decision: point the driver at the processor, because the input modules have no network address of their own, and treat a successful ping as IP reachability only — it says nothing about the Modbus service.
Which input module suits a 24 to 124 VDC field signal? #
Match the module's documented thresholds to the voltages you measure: a 24 VDC-class input accepts a 1 signal only up to 30 VDC, so it cannot take the 124 VDC end of the span; signals that high belong on an input whose datasheet range covers at least 124 VDC.
Measure before you order: energize each field circuit and read the voltage at the module terminals against the circuit's own common, because contact resistance and long cable runs pull the ON voltage well below the supply's nominal figure. Treat the top of this span as the hazard it is: a 124 VDC control circuit is a different shock and arc hazard from 24 VDC, so follow the plant's live-work rules when measuring it. Then compare the measurement with the module's guaranteed thresholds, which datasheets list in the style of the IEC 61131-2 DC input classes: Type 1, guaranteed ON from 15 VDC and up with OFF at 5 VDC or less; Type 3, the wide-threshold variant, guaranteed ON from 11 VDC. A remote I/O module may not claim the standard itself, so read its own threshold numbers, not the nominal label.
Threshold check, illustrative: the field supply is nominal 24 VDC, but a long run leaves 12.4 VDC at the terminal when the limit switch closes. A Type 1 input is not guaranteed to see that as ON, because 12.4 VDC sits below its 15 VDC threshold; a Type 3 input is guaranteed ON, because 12.4 VDC clears 11 VDC. The selection rule this drives: choose the module whose ON threshold sits below the lowest energized voltage you measured and whose OFF threshold sits above the highest voltage you measured with the contact open.
The top of the span is the second decision. The 24 VDC classes accept their 1 signal only up to 30 VDC, so no 24 VDC-class module may see the 124 VDC end of the field list. Group the signals by voltage class and put the high group on an input whose documented DC range covers at least 124 VDC.
While the datasheet is open, check two more things: the off-state leakage budget, so a two-wire sensor cannot hold the channel ON, and the common-terminal arrangement, because shared commons tie circuits the drawings treat as separate — the mechanics of that isolation are the subject of How discrete PLC I/O modules isolate and switch field signals. Choosing the rack itself, by channel count and signal type, is the same exercise as for analog points, as laid out in Selecting multi-channel Modbus analog input remote I/O.
Where in the slave's data map does the channel live? #
The channel lives where the processor's documented Modbus data map puts it: physical digital inputs normally appear either as discrete-input bits read with function code 02, or packed into 16-bit words read with function codes 03 and 04, and the map — not the word digital — chooses the area.
The Modbus Application Protocol Specification V1.1b3 defines the data model as four areas: coils referenced 0xxxx and read with function code 01; discrete inputs 1xxxx, read-only with function code 02; input registers 3xxxx with function code 04; holding registers 4xxxx with function code 03, written with 06 and 16. A physical digital input reaches the client in one of two legitimate shapes:
- one bit per channel in the discrete-input area, read with function code 02, up to 2000 bits in one request;
- sixteen channels packed into a 16-bit word in the input- or holding-register area, read with function codes 03 or 04, up to 125 registers in one request.
Which shape holds your channels is not a Modbus decision; it is the processor vendor's documented map, and that map table is the first document to open. A request can also name an address the map skips, and the processor then answers exception 02 — the failure behind Modbus exception 02 when a read crosses a register map gap. The decision: build the SCADA point list from the processor's map document, never from the phrase digital input alone.
How do I turn a channel number into a register reference? #
Subtract one from the reference: the Modbus specification addresses every object as a PDU address from 0 to 65535, while the common 3xxxx and 4xxxx reference notation stands one higher, so input register reference 30001 is PDU address 0 and channel 13 of a 16-point word is bit 12.
A driver either speaks one-based references or raw zero-based addresses; its manual states which, and one test against a known word pins the convention down.
Worked example, illustrative: a 16-channel digital input module whose processor maps it to input register reference 30001, channel 1 on bit 0. The SCADA driver is set as a Modbus TCP client for the processor's IP address, function code 04, reference 30001. Channels 1, 13 and 16 are energized, so the processor serves the word
2^0 + 2^12 + 2^15 = 1 + 4096 + 32768 = 36865 = 0x9001
(binary 1001 0000 0000 0001). On the wire the reference leaves as PDU address 0, the driver receives 0x9001, and extracting bit 12 returns channel 13 = ON. The arithmetic generalizes: the PDU address is the reference minus 30001 for input registers (reference minus 40001 for holding registers), provided the map's first register sits at PDU address 0, which the map document confirms; then index the bit the map assigns to the channel.
The off-by-one case is the common fault: a zero-based driver handed reference 30001 sends PDU address 30000, where the map holds nothing, and the processor answers exception 02 — or worse, serves an adjacent live object that decodes plausibly and masks as a wiring fault. The controller-side view of the same word-to-image mapping is covered in What CODESYS %IW0 means for a Modbus TCP holding register.
How do I prove the SCADA read end to end? #
Prove it in order: confirm the processor sees the channel change locally, read one known point with the right function code, decode the returned word bit by bit, then widen to the full point list — a passing ping proves IP reachability but not that port 502 serves Modbus.
- Exercise the field signal and watch the processor's own diagnostics: the channel must change state there first. If it does not, the fault is on the electrical path and no driver setting will help.
- Configure the driver for the processor's IP address, the Modbus TCP port and the documented unit identifier, and poll exactly one known point — function code 02 for discrete-input bits, or the mapped function code 03/04 reference.
- Decode the reply against the hand-computed word. If function code 02 returns nothing at all, the steps in Fix Modbus TCP FC02 discrete inputs returning no data trace that specific failure.
- Widen to the full point list, keeping every read within the specification limits of 2000 discrete bits or 125 registers per request; a larger quantity draws exception 03, illegal data value.
- Measure the response time with a single request, then set the poll interval several times longer, so a busy processor or a loaded network cannot stack timeouts.
Read the symptom and you have the layer: no TCP connection at all points to address, port or route; a connection that opens but times out points to unit identifier or server load; exception 02 points to the reference; exception 03 points to the quantity; a valid value that decodes wrong points to the bit mapping, which the next section settles.
Why does a valid response show the wrong channel? #
Three mismatches cause it: a one-based driver pointed at a zero-based map or the reverse, a bit-to-channel assignment that differs from the processor's documented map, and a read of the wrong area — coils instead of discrete inputs — which returns a valid object that simply is not your input.
The bit assignment deserves the sharpest statement: the transport's byte order is big-endian as the specification fixes it, but which bit of the word belongs to channel 1 is the processor vendor's documented choice, and vendors differ — some put channel 1 on bit 0, some on bit 15, and some drivers add a swap setting of their own. The offset case shifts every bit by a whole word, as the previous section showed with references 30001 and 30000.
The decisive test: read the whole word as a raw integer, compute the expected value by hand from the energized channel list, and compare. If the number matches but the screen channel is wrong, the point list extracted the wrong bit; if it does not match, the offset or the area is wrong. Change one variable per test.
Which computer should run the SCADA client at the machine? #
The computer that runs the SCADA client at the machine is an industrial panel PC or a compact industrial PC in the cabinet: a Modbus TCP client is light — one TCP connection, a poll cycle and alarm handling — but it must survive the panel environment.
The client side of this read is undemanding compute; what the machine needs is continuity against dust, heat, vibration and hours that never end. When you specify it — the screen in the cabinet door or on the console, client and alarms live around the clock — an industrial panel PC is the class of hardware built for that duty, and a compact industrial PC mounted beside the controller in the cabinet covers the same role without a display.
The decision: choose that machine by environment and uptime duty, because the protocol load itself will never be the constraint — the constraint, as every section above shows, is the match between field voltage, data map and reference.
Questions asked
Can a Modbus TCP master write to a digital input?
No. The discrete-input area of the Modbus data model is read-only, and the write functions (05, 06, 15 and 16) act on coils and registers only. A compliant server answers a write aimed at an input object with exception 01, illegal function. If an operator screen must change something at the rack, the processor's map has to document a coil or holding register for that purpose; the input image itself is never writable.
What do Modbus exception codes 02 and 03 mean on this read?
Exception 02, illegal data address, means the request named an object the processor's data map does not contain, in practice an off-by-one reference or a read past the end of the input area. Exception 03, illegal data value, means the request structure itself is unacceptable to that server, most often a quantity above the specification limits of 2000 discrete bits or 125 registers in one read.
Do the input modules need IP addresses of their own?
No. One IP address belongs to the Ethernet I/O processor; the input modules behind it have no network presence at all. That is why replacing a module or repositioning channels changes the data map but never the network configuration, and why every point on the rack shares the processor's unit identifier.
Can several SCADA clients read the same processor at once?
Yes. Modbus TCP serves multiple client connections to one server, unlike the serial bus where a single master polls. The practical ceilings are the processor's documented connection count and transaction rate. Stagger the poll cycles of the SCADA client, the historian and any maintenance laptop so each sees a consistent snapshot instead of interleaved reads of a changing word.
How often can the display refresh the input bits?
The specification sets no refresh rate; the pace comes from your poll interval and the processor's measured response time. Poll several times slower than that response time so a loaded network cannot stack timeouts. A field event shorter than one poll period will never appear on screen, so a processor-side latch or counter register is the only dependable way to capture it.