Tag History Duplicate Entry Issue
Problem Description
The system experiences duplicate entries in tag history during gateway restarts, creating data integrity issues in historical context.
Current Behavior
Normal Operation
- Calculation Result Storage: Engine computes values (e.g., E_CO2 = 10.5)
- Tag Value Write: Result is written to Ignition tag using
tagRepository.writeTagValueOrCreate()
(internal method, calls provider) - Historian Trigger: Ignition historian automatically captures the tag value change to history database
- Requirement: System must capture ALL writes to history, including identical values (e.g., E_CO2 = 10.5 followed by E_CO2 = 10.5)
Problem During Gateway Restart
- Pre-Restart State: Tag has value E_CO2 = 10.5 (already stored in history at timestamp T1)
- Gateway Restart: Ignition gateway restarts for maintenance/updates
- Value Persistence: Gateway configuration
setPersistValues(true)
restores tag value E_CO2 = 10.5 - Historian Re-trigger: Historian treats the restored value as a "new" change
- Duplicate Entry: Same value E_CO2 = 10.5 gets written to history again with timestamp T2 (restart time)
Current Configuration
// Current settings attempt to balance requirements
TAG_HISTORY_TIME_DEADBAND = 0;
TAG_HISTORY_DEADBAND = 0.0;
HistoricalDeadbandMode = Off;
Has anyone run into this scenario, am I missing something with tag configuration or even system configuration that would solve the problem?