What Is a SCADA Tag? Four Bindings, and Three of Them Fail Silently
A SCADA tag binds an address, a data type, a scaling and a quality code. Why a NAMUR NE 43 fault current reads as -2.5% on the screen, why a REAL totalizer stops counting at 16,777,216, and what OPC UA Part 8 separates EURange from InstrumentRange for.
A tank level tag showed -2.5% on the screen. The operator moved on — negative readings had shown up before. The transmitter was already dead by then.
That -2.5% is not a bug. It is the correct answer. Feed 3.6 mA — the current NAMUR NE 43 reserves for a downscale failure — into the linear map that stretches 4-20 mA onto 0-100%, and you get (3.6 - 4) / 16 x 100 = -2.5. The formula did its job. It took a fault current and turned it into a number. The orange stage below is where that happens.
If a tag is a name, that incident makes no sense
Treat a tag as "the variable name the screen uses" and the story above has no explanation. The name was fine. A tag is not a name. It is the place where four bindings are tied together.
- Address — where this value actually comes from. A Modbus register, an OPC UA NodeId, an MQTT topic.
- Data type — what those bits are to be read as.
- Scaling — the map from a raw number to engineering units.
- Quality — whether this value is worth believing right now.
Alarm limits, historian collection rules and the description string hang off a tag too, but those are policy. The path the value actually travels is those four.
The point is not the list. It is that they fail in different ways. A wrong address fails loudly. The other three produce a number even when they are wrong — a plausible number. So incidents land, almost always, on 2, 3 and 4.
Address: the only binding that fails loudly
In Modbus TCP a holding register is one 16-bit word. A tag holding a 32-bit value therefore claims two addresses, not one. Read Holding Registers (FC3) accepts a quantity of 1 to 125 (0x7D) registers per request — MODBUS Application Protocol Specification V1.1b3, section 6.3. "One tag, one register" only holds for an INT.
Get an address wrong and you usually know at once. Past the end of the map you get an exception response; with the device gone you get a timeout. OPC UA behaves the same way: a wrong NodeId puts Bad_NodeIdUnknown in the log. That is what makes this the easiest of the four bindings to live with. It tells you.
One case does go quiet: the address is right but the word order is reversed. Swap the high and low register of a 32-bit value and you get a completely different number with no error anywhere. That one has its own write-up in Modbus register byte and word order.
Data type: the first binding that fails silently
Start with the widths IEC 61131-3 fixes. INT is a 16-bit signed integer (-32768 to 32767), UINT is 16-bit unsigned (0 to 65535), DINT is 32-bit, and REAL is 32-bit IEEE 754 single precision.
REAL carries a trap. The significand of an IEEE 754 single is 24 bits, so above 2^24 = 16,777,216 it can no longer represent a step of 1. Park a totalizer in a REAL and the moment the value reaches 16,777,216, adding 1 does nothing — rounding puts it straight back.
>>> import numpy as np
>>> np.float32(16777216.0) + np.float32(1.0)
16777216.0
No error. No alarm. The total simply stops climbing, and whoever reads the production report finds it weeks later. A value that only grows, like a flow total, belongs in a DINT or a 64-bit integer with a reset per shift. Overflow itself is covered in counter rollover and totalizer wraparound.
Scaling: where the incident actually happens
This is the stage where raw counts become engineering units, and it has two sets of numbers you cannot work without.
The bottom end — the raw range. This is a vendor rule, not a standard. Siemens S7 analog modules put the nominal range of a 4-20 mA input at raw 0 to 27648, use up to 32511 for overrange, and reserve 32767 for overflow. Other vendors run 0 to 32767. It is a value to confirm in the card manual, never to guess. Write 32767 where the card means 27648 and the whole span compresses by about 18%. There is no error. Everything just reads low.
The top end — the fault currents. NAMUR NE 43 keeps 3.8 to 20.5 mA as the real measuring band and reserves ≤3.6 mA for a downscale failure and ≥21 mA for an upscale failure. The linear map does not know about those bands. It answers anyway.
| Current | What NE 43 means by it | (mA-4)/16 x 100 |
|---|---|---|
| ≤3.6 mA | downscale failure — broken wire, lost loop power | ≤ -2.50 % |
| 3.8 mA | bottom of the measuring band | -1.25 % |
| 4.0 mA | 0 % | 0.00 % |
| 20.0 mA | 100 % | 100.00 % |
| 20.5 mA | top of the measuring band | 103.12 % |
| ≥21.0 mA | upscale failure — transmitter failed high | ≥ 106.25 % |
The common mistake here is clamping. The -2.5 looks wrong, so someone pins the output to 0-100. Now the fault is disguised as a healthy end of range. A level tag on a broken wire reads 0.0% on the screen, and that is indistinguishable from an empty tank. The -2.5% was better. At least it looked odd.
The way I do it: judge the bands on the raw signal, and when the value lands in a fault band, do not touch the value — change the quality to Bad. Publish the number and mark it as not to be trusted. The two steps must not be mixed.
OPC UA holds those two sets of numbers as separate properties. In OPC UA Part 8 Data Access, EURange is the normal range in engineering units and InstrumentRange is the full range the instrument can physically deliver. The point is that they differ. EngineeringUnits is not a string either — it is an EUInformation structure, and the unit arrives as a code from UN/CEFACT Recommendation 20. That is the real argument against putting units in the description field: there is already a slot for the code.
The scaling arithmetic and unit conversion itself is in SCADA analog scaling and unit conversion, and the band checks are in analog input signal fault detection.
Quality: do not put it in the same slot as the value
-9999, 0, hold-last-value. None of those is a quality. Each is an attempt to say "the value" and "there is no value" with the same number, and the receiving side has no way to tell them apart. Let -9999 into a report that averages, and the result is quietly wrong.
Quality has to be its own field. OPC UA uses a 32-bit StatusCode whose top two bits are the severity: Good is 0x00000000, Uncertain is 0x40000000, Bad is 0x80000000. You rarely need the full table — code & 0xC0000000 sorts you into a bucket. The names that turn up in logs are Bad_SensorFailure, Bad_NoCommunication and Uncertain_LastUsableValue.
Uncertain existing matters. Between "trustworthy" and "not trustworthy" sits "this is the last value I received, not the current one", and without that slot a stale value travels onward as Good. Masking per code scheme is in handling tag quality codes; what to store in the historian so Bad does not poison an average is in bad quality gaps and interpolation.
Naming the tag is a separate problem, and a more constrained one than it looks. That is written up in the SCADA tag naming guide.
A check you can run now
Work out what your own 4-20 mA tags put on the screen when they are handed a fault current.
awk 'BEGIN{split("3.6 3.8 4.0 20.0 20.5 21.0",a," ");
for(i=1;i<=6;i++) printf "%5.2f mA -> %8.2f %%\n", a[i], (a[i]-4)/16*100}'
Then take one analog tag and fill in four boxes: address, data type, both ends of the raw range, and where the quality goes. In my experience the first two are nearly always written down and the last two nearly always are not. Those two empty boxes are where the incident at the top of this article lives.
Equipment values on the SECS/GEM side do not arrive as tags at all — they arrive as SVIDs, and the notion of quality is different there. If that is what you are looking at, the faster route is to pull an S1F11/S1F12 NAMELIST yourself with the SECS/GEM simulator.