HMI vs SCADA vs MES vs Historian: Which One Owns the Official Record?
Separating the four layers by ISA-95 level, the ISA-18.2 alarm definition and OPC UA StatusCode — and why the same equipment stop is recorded differently in each of them.
Three numbers land in the Monday morning meeting and none of them agree. MES booked 47 minutes of downtime on line 2 yesterday. In the historian trend, the equipment-stopped bit is on for 52 minutes. The operator says no alarm ever came up. An hour goes into finding out who is wrong.
Nobody is wrong. The three systems answered three different questions. What splits these layers is not the product name on the licence — it is who owns which record, and this meeting re-teaches that lesson every time.
The level attaches to the decision cycle, not to the product
The functional hierarchy in IEC 62264-1 (ISA-95 Part 1) splits the plant into L0 through L4. L0 is the process itself, L1 is sensing and manipulating, L2 is monitoring and supervisory control, L3 is manufacturing operations management, L4 is business planning and logistics.
One thing jumps out of that list immediately. HMI and SCADA are both L2. Shipping the two inside one piece of software is therefore not an architectural mistake. MES is L3; ERP is L4.
What separates the levels is the decision cycle, not the feature list. L2 answers "do I close this valve now" in seconds to minutes. L3 answers "do I close this lot, do I release this tool to maintenance" across shifts and days. Having a trend screen or not having one does not move a system between levels.
Drawing the boundary from vendor catalogues fails every time. A panel HMI logs trends to an SD card, a SCADA product arrives with a historian bundled in, an MES dashboard shows live tags. Overlap is normal. The thing that must not overlap is not the feature — it is ownership of the record.
Alarms belong to L2, and the definition is already written
The odds that the operator lied about the alarm are low. The odds that the equipment-stopped bit was never designed as an alarm are much higher.
ISA-18.2 defines an alarm as an audible or visible indication that requires an operator response. If there is nothing for the operator to do, it is an event, and events go to a log. The standard's alarm management lifecycle runs through ten stages, and the rationalization stage forces you to write down, per alarm, what the operator is supposed to do about it. Any bit that produces no answer there drops off the alarm list. Equipment-stopped bits usually produce no answer.
The reverse direction costs the same. Promote everything to an alarm and the alarm list stops being usable. EEMUA 191 puts the long-term average at roughly one alarm per ten minutes per operator, and treats more than one per minute as beyond what a person can work through. Once you have seen those numbers, "let's just alarm all of it" stops being an option. Cutting the list down happens in a rationalization workshop; the traps people walk into are in the alarm design mistakes that keep recurring.
The red row on the MES screen does not pass this definition. It is a management roll-up, not a signal for the operator to act now.
A historian that stores only the value is not enough
The historian's 52 minutes usually comes from one of two places.
First, quality. OPC UA Part 4 carries a StatusCode with every value, and the top two bits of that code hold the severity. Good is 0x00000000, Uncertain starts with 0x4, Bad starts with 0x8. So a value carrying a non-zero code must not have its number stripped out and used. Whether the communication-loss window was stored as Bad or as the last good value held flat moves the same stop by minutes. What interpolating across that window does is covered in interpolating Bad quality gaps; the SCADA-side handling is in quality code handling.
The two timestamps in the same DataValue matter here too. SourceTimestamp is when the value was produced; ServerTimestamp is when the server got hold of it. A historian that stores ServerTimestamp lets network delay and polling period masquerade as process time. Reading back a past window is governed separately, by OPC UA Part 11 (IEC 62541-11) Historical Access. Telling the symptoms apart is in StatusCode and SourceTimestamp troubleshooting.
On a 4-20 mA loop it breaks one stage earlier. NAMUR NE 43 uses anything at or below 3.6 mA and at or above 21.0 mA as a failure signal, not a measurement. If the PLC scales that value through unchanged, the historian stores -3% pressure as a normal reading. That is not the historian's fault — quality information was thrown away between L1 and L2.
Second, compression. A stored trend is not the raw value. With a 2% deadband and exception-based storage, 52 minutes can read as 51 or 53. For the bits that feed downtime accounting I store the transitions uncompressed and accept the extra tags; a handful of tags costs less than a weekly one-hour meeting. The settings are in deadband and compression.
MES cuts the same bit along shift boundaries
The MES figure of 47 minutes does not come from a different bit. It comes from the same bit cut by different rules.
Three common rules all shrink the number. Stops under a minute get rolled into micro-stops or dropped. A stop straddling a shift boundary is booked to one shift only. Windows with no reason code entered are excluded from the roll-up. The gap between 47 and 52 is almost always one of those three, and none of them is a bug. The bug is that the rule is not written down anywhere. The input side is in downtime reason codes; the order to reconcile in is in shift production count reconciliation.
Recipe authority splits at the same seam. IEC 61512-1 (ISA-88 Part 1) separates the master recipe from the control recipe: the master is the product-level definition, and the control recipe is built at run time for one specific unit. Leave recipe parameters writable from a SCADA screen and the values the equipment actually ran will drift quietly away from the master recipe MES is holding. The difference surfaces six months later in a quality investigation, and by then there is no way to tell which one was right.
The boundary argument never ends while the clocks disagree
Give four layers four clocks and the same stop carries four timestamps. However cleanly you divided responsibility, the meeting reopens. Start by checking that the PLC, the SCADA server, the historian and the MES server all follow the same NTP source. What drift looks like from the historian side is in historian time synchronization.
Four lines to write down before the project starts
- Pick one official record per question. Downtime minutes: MES. Process values: historian. Operator actions: the SCADA audit log. Two systems answering the same question is how the Monday meeting gets created.
- Exactly one system may write setpoints and recipes. Two, and the ISA-88 master recipe stops meaning anything.
- Only what passes the ISA-18.2 definition is an alarm. The rest gets demoted to events.
- Find the layer that drops the quality code and SourceTimestamp. One layer dropping them makes every number below it unexplainable.
And when the three numbers disagree, check whether they answered three different questions before concluding that one of them is wrong. In my experience that is the answer more often.