This would be hard to accomplish with just the single tag and a power chart. The reason being, the power chart relies heavily on Ignition’s history tables and a string tag would not trend in this way based on just tag history. I see two options to achieve functionality like this.
One is to use the timeseries or XY chart and have the string tag store history. Then one could use a script transform on the dataset returned from a tag history binding - to replace the strings. Then it could potentially be plotted as you desire.
The other option is to enlist the help of another tag and some tag change logic. This is how I foresee this working on a power chart. We can setup a few tag change scripts to turn a memory boolean tag on and off as you described. The scripting for this would be more complex than the next option.
The two scripts would need logic similar to this:
- When the string tag changes, set the boolean memory tag to 1.
- When the boolean tag changes, and its new value is 1, wait X amount of time and set the boolean back to 0.
This logic will toggle the boolean on when the string changes, which triggers the boolean script to set itself back to 0. As long as the boolean is storing history on change we now have a tag that can be used as a pen on the Power chart, that goes to 1 at the time the string is written to. The scripting itself wouldn’t require much more than system.tag.writeBlocking() and a way to delay for a few seconds.