Troubleshooting
Why tag history misses short-lived alarm codes
Short answer
A sampled register only shows what it holds at the read instant, so an alarm code the PLC clears before the next read never reaches tag history. Set the historical tag group to Direct at a rate faster than the shortest dwell — 100 ms in the bench case — set each tag's Sample Mode to Tag Group, and bring Min Time Between Samples down to the group rate. Any code that dwells longer than one scan is then guaranteed a stored record.

On this page
A PLC alarm-code register is a sampled value, not a latched event: the gateway sees only what the register holds at the instant it reads. When the fault routine writes a code and the reset logic clears it again before the next read lands, both reads legitimately return 0000 and the historian records a clean, fault-free line. On the bench behind this article — Ignition 8.1.10 (b2021090812), an Omron NX1P2 polled over Modbus, MySQL on the same machine — the reported fix was the historical tag group set to Direct at 100 ms, each tag's Sample Mode set to Tag Group, and Min Time Between Samples brought down from its 1 s setting to the group rate. Set all three and any code that dwells longer than one scan is guaranteed a stored record.
Why history shows 0000 around a real fault #
The register is memory the PLC rewrites, and each read is a photograph of one instant. In the reported case the Modbus fault handling wrote the nonzero code, and the alarm reset cleared it back to 0000 before the next communication cycle began — a cycle that starts 2 s after the last of seven devices, two reads each, has been processed. A scan that misses the whole nonzero window photographs 0000 before the fault and 0000 after it, which is exactly what the history tags stored. The codes were reported to stick for up to 2 s; that figure is a maximum, not a minimum, and the codes that vanished were the ones clearing sooner — inside the gap between two reads, or inside the historian's store gate.
The same dwell-versus-scan arithmetic that hides a short pulse from a PLC input hides a cleared register from a historian; the companion page on why a PLC misses short input pulses and how to catch them works that case in detail.
The useful split this produces: when the live tag shows the code while history holds only 0000 before and after, the driver did its job and the settings between the read and the database are at fault.
Prove which stage drops the value #
Work the fault through the chain in order; each step either clears a stage or points at the fix.
- Prove the PLC emits the code. Watch the live register in Sysmac while triggering a controlled, repeatable communication fault — on the bench, or in a maintenance window; never by interrupting communications on a running line. Record the appearance time, the return to 0000, and the shortest dwell you must catch.
- Check the driver lands its reads. In the Gateway, the device connection's diagnostics page under Connections → Devices shows request timing and response statistics for the NX1P2 connection. On this bench the workload was one request on the fast group and four at 500 ms, completing on schedule. Treat the displayed overload percentage with suspicion — judge capacity by mean response times against the requested cadence; if more tags or faster groups are coming, the headroom question is the same arithmetic as sizing one Ignition gateway for a large OPC UA tag count.
- Watch the live Ignition tag during the fault. If it never shows the nonzero code, the miss is acquisition: reads are not landing inside the dwell, and storage settings will not help.
- If the live tag shows the code and history does not, query raw rows. Pull the stored records across the fault window directly, with chart aggregation and interpolation off; an aggregated trend can sit on two stored rows and still look empty. Raw rows separate a storage miss from a display miss.
History that stops altogether while live values stay good is a different failure, covered in why Ignition historian tags stopped recording but live data is good.
The bench itself was part of the problem: one laptop carried a browser, a debugging IDE, Sysmac online, MySQL and the full Ignition runtime at once, leaving little headroom for precise execution timing. A permanent installation gives the historian its own host — an industrial mini PC as a dedicated gateway and database box is the usual replacement for a loaded development laptop.
Set the historical tag group to Direct #
Execution mode decides when reads happen. Subscription-based execution rides on OPC subscription updates and falls back to polling only when subscriptions fail, so effective read timing moves with traffic; leased execution runs one rate while a session views the tags and a slower one when none does — exactly backwards for unattended fault capture, which must run hardest when nobody is watching. Direct execution reads on the group's fixed rate, every rate period, watched or not.
Record the group's current settings before changing anything, and confirm the group actually governs the tags you are chasing — on this bench it was the group named Default Historical. Set the execution mode to Direct with the group rate at 100 ms, save, and confirm the applied mode and rate before touching tag-side settings. The bench had already run a Rate of 100 under the old mode and still missed, which is the point: a rate number only spaces executions. Commission mode and tag-side settings together, then prove the combination with a controlled fault — the reported outcome after the change was every nonzero code reaching history almost as soon as the PLC wrote it.
Per-tag Sample Mode and the Min Time gate #
Storage has two settings of its own on each tag, and they can throw away what the reads brought home. By default the historian stores a record only when a value changes. The tag's Sample Mode selects what triggers a store: set it to Tag Group on every affected tag, pointed at the historical group, and verify the applied setting on each tag rather than trusting the first — the reported fix set the mode tag by tag.
Min Time Between Samples is the gate: the documentation is explicit that it blocks storage more often than its interval even when a change exceeds the deadband. The tags in this case carried a one-second gate, ten rate periods wide at the new scan — wide enough to hold the door shut through an entire short fault. Lower it to the group rate so storage never waits on the gate; the worked example below puts numbers on both sides.
Two neighbours, for completeness. The deadband only matters if it can merge neighbouring codes, so for integer fault codes keep it below one code step. Max Time Between Samples forces a periodic record even while the value is unchanged, and the documentation notes it bypasses the deadband but not the sample rate: it proves the tag was alive around the fault, but it cannot store a value the reads never brought in. Where deadband and Max Time decide whether an unchanged value such as 0000 earns rows at all, tag historian zero values, deadband and Max Time covers that split. A wide gate interval is also why some systems record on a fixed coarse cadence — why Ignition tag history records only every 10 seconds is that case. Faster groups and more history-enabled tags both raise the write rate the database absorbs; how tag count and write rate drive historian database sizing carries that arithmetic.
Worked example: catching the NX1P2 fault codes with a 100 ms scan and a 1 s gate #
Inputs, and where each comes from:
- Historical tag group after the change: Direct, rate 100 ms — the working configuration reported in the case.
- Min Time Between Samples on the affected tags: 1 s, flagged for lowering — from the case's history settings.
- Longest observed code dwell: 2 s, with codes able to clear earlier, before the next communication cycle begins — from the case's fault sequence.
- Storage rule: Min Time Between Samples blocks records more often than its interval, even when a change exceeds the deadband — Ignition 8.1 and 8.3 manuals.
Rule in words: a code reaches the database only if a read lands while the register is nonzero and that read falls after the gate opened. Capture is guaranteed when the dwell is longer than the gap between reads and the gate is no wider than that gap — no nonzero window can then fit between two reads, and no read that sees the code is held back.
Arithmetic. Reads at the group rate: 1000 ÷ 100 = 10 reads per second, one read every 0.1 s. The old gate spanned 1000 ÷ 100 = 10 executions, so a code that appeared just after a stored record and cleared before the gate reopened had every one of its nonzero reads held inside the gate, and the first read after it opened found 0000 — no row for the fault, matching the stored 0000 on both sides. The longest codes dwelled for 2000 ÷ 100 = 20 read periods, and a read taken one gate-width after the previous store still lands inside the longest dwell, so codes near the maximum were never the ones lost.
Result: the gate, not the scan, swallowed the short codes. With the gate brought down to the group rate, storage can no longer block any read the scan makes.
Decision: keep the group Direct and set Min Time Between Samples equal to the group rate, and every code that dwells longer than one scan is guaranteed a row. A code that clears inside one scan is unreachable by any polling historian — for those, drop the group rate below the dwell or latch the code in the PLC until the SCADA system acknowledges it.
What to commission, in order #
- Measure the shortest code dwell on the PLC side while forcing a controlled fault.
- Set the historical tag group to Direct at a fixed rate below the shortest dwell — half of it leaves margin for execution jitter — and confirm the applied mode and rate.
- On every affected tag, set Sample Mode to Tag Group against that group and verify each tag.
- Set Min Time Between Samples to the group rate on each of those tags.
- Re-run the fault and confirm the raw stored rows contain the nonzero code and its return to 0000.
With those set, the reported bench behaviour met the goal: each fault code reached history almost as soon as the PLC wrote it, giving a usable fault-trace timeline. If step 1 measures a dwell under one scan, stop and move the capture into the controller — no polling historian setting will recover it.
Questions asked
Does the deadband cause missed alarm codes?
Rarely. The deadband suppresses changes smaller than its value, and neighbouring integer fault codes differ by at least one code step, so any deadband set below that step leaves every transition intact. The gate that hides codes is Min Time Between Samples, which blocks storage for its whole interval even when a change exceeds the deadband. Keep the deadband small enough to separate real codes and fix the interval instead.
What if a code dwells for less than one scan?
No historian setting recovers a code that clears inside one scan, because no read lands while it is nonzero. Lower the historical group's rate below the dwell, or move the capture into the PLC: latch the fault code in a register that holds until the SCADA system acknowledges it, or queue the event in the controller's alarm system with its own timestamp. A latched register turns an event too short to sample into a level you can poll.
Should Max Time Between Samples be changed to catch codes?
No. Max Time Between Samples writes a periodic record even while the value is unchanged, which is useful for proving the tag was alive across a fault and for telling a flat trend apart from a data gap. The documentation notes it bypasses the deadband but not the sample rate, so it cannot store a value the reads never brought in. It records the silence around the fault, not the transient itself.
Does this apply to other PLC drivers or only this one?
The sampling rule is universal: any polled register, over Modbus or a native driver, reports only its state at the read instant, so the dwell-versus-scan arithmetic is identical elsewhere. The setting names are Ignition's and live in the tag group properties and each tag's history configuration in the Gateway. Other historians expose the same three ideas — execution cadence, store trigger, minimum store spacing — under different names.
The group rate was already set low, so why did history still miss?
A rate number only spaces executions; it does not make reads land or stores keep up. The tag's own history settings and the store gate sit between the read and the database, and a wide gate discards transitions the live tag clearly showed. Set execution mode, per-tag Sample Mode and Min Time Between Samples together, then prove the result with a controlled fault rather than trusting one number.


