Ignition version: 8.1.43
Database: PostgreSQL
Module: Tag Historian (standard SQL historian)Issue:
I am storing time-series data into Ignition's tag historian using
system.tag.storeTagHistory()from a Gateway Timer Script. The values and timestamps originate from an external ERP/API source (not live tag scan-class updates) — the script fetches data on a schedule, processes it, and writes it into two memory tags usingstoreTagHistory.Recently I noticed that
sqlth_tecontains two separate entries for the exact same tag path, with differentidvalues — one retired, one active:id:23 | RETIRED at <timestamp> | path:production/igu/igu 1/sealant_consumptions/filtered_sealant_consumption id:21 | ACTIVE | path:production/igu/igu 1/sealant_consumptions/filtered_sealant_consumptionThe tag path is identical, and I have not:
- Changed the tag's data type
- Deleted and recreated the tag
- Edited the tag's History configuration (Provider, Sample Mode, etc.)
- Restarted the Gateway during a config change
- Moved the tag to a different folder
The only operation happening repeatedly is
system.tag.storeTagHistory()being called from a scheduled Gateway script, roughly every hour, writing batches of historical rows with explicit timestamps (not "now").Questions:
- What internal conditions cause Ignition to retire an existing
sqlth_terow and create a new one for the same tag path, beyond the documented triggers (datatype change, tag recreation, history config edit)?- Can repeated calls to
system.tag.storeTagHistory()with externally-sourced timestamps (not real-timesystem.date.now()) ever cause Ignition to treat the tag as "new" internally — for example if there's a long gap between calls, or if the Gateway restarts between calls?- Is there a way to force
storeTagHistoryto resolve to a specifictagidrather than relying on path-based lookup againstsqlth_te, to avoid this ambiguity?- Are there known issues with
storeTagHistoryand memory tags specifically (vs. OPC tags) that could explain this re-registration behavior?What I've tried:
- Retiring the duplicate
sqlth_terow manually via SQL and continuing to use the same tag path — this resolves the immediate issue but I'd like to understand the root cause to prevent recurrence.- Checked Gateway logs around the retirement timestamp — (no observations)
Any guidance on the internal logic Ignition uses to decide when a tag path "ages out" of its current
sqlth_teentry would be greatly appreciated, since this is causing chart binding issues and requires manual cleanup each time it happens.