Ignition Exchange: Playback functionality

In our project (made in Perspective) we want to establish a playback function using the 'Perspective Historical Playback' control I found on the Ignition Exchange platform. This control is made by Kevin McClusky.

It works fine for read-only tags, but I wonder how you can do the same playback functionality for read/write tags (for instance a parameter setting 'max pressure'). When the control is in real-time mode, you still want to be able to change the actual tag. When the control is in historical mode, you want to see the value of the parameter at a certain date/time. So you can make the binding dynamic with an expression binding, but expression bindings cannot be made bi-directional, so writing to a tag (when in realtime mode) does not work. I also tried scripting but then it was getting really complex and was not able to find a workable method.

I believe I'm not the only one who wants to establish a Playback function for both readable and writable tags, so are there any solutions for this? Maybe Kevin has a workaround that we aren't aware of.

Any advices?

Thanks

As built, this resource exposes a value for each specified tag. In historical mode, this is using Tag History and in Realtime mode it is reading the current tag value. However, as you've noted, there is no provision to write data back to the tag when bound to this value.

Assuming you are binding to an input component like a Numeric Entry Field, you could configure an event on the component to write an entered value to the proper tag. For the Numeric Entry Field component, right click on the component and selected "Configure Events..." then choose onActionPerformed and add a new Script action. The script could be as simple as
system.tag.writeBlocking("[Provider]My/Tag/Path", self.props.value).

Note that you'll most likely want to prevent this from firing when the playback controller is in historical mode. You could bind the Numeric Entry Field's enabled property to the historicalMode prop and add a transform to invert it so that when historicalMode = True, the entry box is disabled (but still displays historical values during playback).

3 Likes