Troubleshooting
Ignition history binding shows zeros while SQL Server has values
Short answer
Zeros in a datatable or time series with nonzero rows in SQL Server mean the historian write path is fine and the read path is wrong or unverified. Anchor the test on one nonzero stored sample with a known timestamp, reselect the tag path against the Tag Browser copy-path output, then check aggregation, query range and transforms before trusting a reopened project.
On this page
Zeros in a datatable or a time series while SQL Server holds nonzero rows are a read-path fault, not a historian fault: the records exist, so history storage, the database connection and the write path all work. Anchor the test on one nonzero stored sample with a known timestamp, verify the binding's tag path against the Tag Browser, then check aggregation, query range and transforms in that order.
Compare three observations before changing anything #
A live value, a stored sample and an aggregated historical result are three different things. Compare them only with matching timestamps:
- Current value and quality from the Tag Browser: proves the acquisition path.
- Stored value and timestamp read read-only from SQL Server: proves a record exists and gives you the test anchor.
- Binding preview output in the Designer: proves the historian query returns the right rows.
- Rendered value in the table or chart: proves the component consumes the binding result.
Start with one tag. Pick a sample you can identify exactly, for example a stored value of 437.6 kW at 09:32:15, and use a fixed query range that contains it.
Match the binding tag path to the Tag Browser #
A tag provider identifies the namespace a tag lives in; a database connection identifies where history is stored. Similar names do not make them interchangeable, and the Tag History binding needs a tag path, not a connection name. Select the tag again through the binding's tag browser, then compare it with the copy-path output of the same tag in the Tag Browser: the provider in brackets, the folder hierarchy and the tag name must all match.
A path that looks unusually long can still be correct. An autogenerated tag created from a PLC import carries the provider name plus every folder level, so length alone is not a fault indicator. What matters is identity: provider, folders and name matching the intended live tag.
While commissioning, use a direct tag selection rather than an indirect or expression-built one. A direct path removes runtime path construction from the test. If the binding is indirect, resolve it and confirm what it substitutes at runtime before trusting the result. If you need to replace the binding later while keeping its processing chain, the steps in Replacing Perspective Tag Bindings While Preserving Transforms preserve the transforms you have already built.
Check the query settings that shape the returned values #
A Tag History binding does not display raw database rows. It queries samples over a range and reduces them with an aggregation mode over an interval, so the settings decide what reaches the component:
- Start and end time: the known nonzero sample must fall inside the requested range, and the range must account for the time zone presentation the database tool uses versus what the binding displays.
- Aggregation mode and interval: with a periodic query mode, an interval of 30 seconds over a 10 minute range returns aggregated values every 30 seconds, not the stored samples themselves. Verify the selected aggregation suits the signal; an average over a mostly-idle interval can legitimately return a value near zero.
- Result format: confirms the structure the component receives, timestamps and field names included.
Inspect the binding output before any transform. If the raw result already contains zeros, the fault is upstream of the component and you should not keep debugging formatting. If it contains the expected nonzero value at the expected timestamp, move downstream.
When the result is empty or errors, check Gateway diagnostics for the historian and the database connection before touching the component; the connection-level faults that follow an upgrade are covered in the article on Ignition SQL Server connection errors after an upgrade.
Trace the result into the component #
Once the binding preview is correct, a valid result can still render as zeros when the component references the wrong field:
- In the datatable, confirm the visible column binds to the returned value field, and that numeric formatting does not round a small nonzero value to display zero.
- In the time series plot, confirm each series references the intended returned dataset and its value field.
- Inspect transforms and expressions that substitute a default for missing or null fields; a null replaced with 0 looks identical to a measured zero.
Compare one timestamp: the binding preview value, the table row and the plotted point must agree. Use the table first; per-row timestamps and values are easier to compare than a plot.
Test the project reopen, do not assume it fixed anything #
Closing and reopening the project and finding the displays working is a real observation, but it changes two things at once: the runtime view is recreated, and time has moved, so the query window now covers different samples. To find out what actually happened:
- Capture the failing state first: query range, selected tag path, binding preview and component output.
- Reopen the project and rerun the same fixed query range that showed zeros.
- If the result differs, compare the reopened binding configuration and runtime selections against your captured state.
- Repeat the test in the Perspective runtime, not only in the Designer.
- Restore the operational time range and test both historical and newly collected data.
If the same fixed range now returns the known nonzero sample, the query path itself changed between attempts. If it still returns zeros while the preview is correct, the fault is in the component.
The decision #
Work the chain in one direction, once, and stop where it breaks:
- Stored sample missing or timestamp mismatched: fix the anchor first; without it every later check is meaningless.
- Binding path differs from the Tag Browser copy-path output: reselect the tag directly and retest.
- Binding preview returns zeros: the query is at fault; check range, aggregation mode and Gateway historian diagnostics.
- Preview correct but the component shows zeros: fix the field mapping, the numeric formatting or the zero-substituting transform.
- Fixed range passes after a reopen: treat it as a passing test of the query path, and retest in runtime before closing the ticket.
Keep database access read-only while isolating this. The historian owns its schema; do not alter table structures to resolve a display symptom.
Questions asked
Can a tag path that looks too long still be correct?
Yes. A provider name plus the full folder hierarchy of an autogenerated PLC tag produces a long path by design. Path length is not a fault indicator; the test is whether the binding path matches the Tag Browser copy-path output for the same tag, character for character, including the provider in brackets.
Where does the Tag Browser copy-path output come from?
Right-click the tag in the Tag Browser and use the copy path action. Paste the result next to the tag path configured in the Tag History binding. Provider name, folder levels and tag name must all match; a mismatch at any level makes the query target a tag with no history.
Does a zero in the display always mean the query failed?
No. A returned zero can be a real aggregated value, or a null that a transform or an expression replaced with zero. Inspect the binding output before any transform; if the raw result holds a nonzero value at the expected timestamp, the fault is downstream in the transform or the component field mapping.
Should I query the SQL Server tables directly to troubleshoot this?
Read-only inspection is useful to confirm a stored nonzero sample and its timestamp, which becomes the test anchor. Do not modify historian table structures to fix a display symptom. The historian owns schema, storage and retention; bypassing its interfaces risks corrupting history blocks.
Why did my chart work after closing and reopening the project?
Reopening recreated the view, but it also happened hours later, so the query window then contained different samples. Treat the recovery as a reproduction boundary, not a fix. Repeat the test with the same fixed time range that contained the failing result before accepting it as resolved.