Force tag processing as if changed

We have bumped into the fact that some Ignition subsystems that operate on tags only do their thing when they think the tag has changed. Specifically we’ve had issues with alarms and history.

When you first enable history for a tag, if the quality and value never change, no entry is ever made in the tag history database. We had been expecting that the tagpath would be setup immediately and the value at the time the history was enabled would be recorded.

Similarly, alarm configs may do the same thing when enabled. In my experiments it varies based on the tag datatype, with integral tags (bools, integers) triggering the initial alarm event immediately while float or double types wait until the next value change.

In both cases, our scripts know when they first enable history or alarms, and could take some action to force an initial value/quality change. If these were memory tags, we could just write a new value. Unfortunately, most of our tags are under MQTT Engine and we can’t. The only way we can force a change is by sending a Node Control/Next Server Sparkplug command to our nodes and make the quality of all tags under the whole node bounce.

Is there any practicality in the idea of having a script command like system.tag.forceChange which would trigger all on-change handlers related to a tag? I would need this to force the alarm and history initial events, but I could (plausibly) see it being useful for re-evaluating any bindings or reference tags or causing tag change scripts to go off as well.

1 Like