Dynamically enable/disable bindings or freeze values

Hi all,

tl;dr: I want to display a popup which by default, loads tag values once when it is displayed, but on the press of a button will display those tag values in realtime. Can I do this by dynamically enabling/disabling tag bindings, or is there a better way?

Detail:

I have a machine which indexes through various “rows”. Think of a filling machine where the first row might dispense a container, the second might fill it, the third might lid it, the fourth might label it, and so on. In reality there are about 40 rows, and 10 of them perform an action.

I have set up UDT’s so the information about what has been done to a particular row is tracked all the way through the machine. I am building a popup so that a user can click on any row and see all of the information for that row, e.g. they can see that a container was dispensed, it was filled with x mL of product ABC, it had a seal applied at x degrees, and so on.

There are two scenarios in which a user might use this feature. The first is to say “hey, the film on row 25 looks a bit discoloured, was the temperature a bit higher than usual on that row?” They click on that row, and at that point, I want the data to be loaded from the row 25 tags, but I do not want it to update. That is, the machine will index a moment later, and the row the operator was looking at will now be in row 26, not 25, but they want to keep looking at 25.

The second scenario is to say “hey, now that I’ve dropped the temperature setpoint for that heater, I just want to watch the recorded temperatures index past, so that I can see it slowly drop and work out when the discolouration disappears”. In this case, they will click on a row, but they will want the data to update in real time as the machine indexes, so they can see the “live” data for that row.

My idea to achieve this is to dynamically enable and disable tag bindings, so that by default, the data is only loaded when the popup is opened, and then it does not update further. Then, if the user wishes, they can press a button to re-enable the bindings and resume realtime display.

Is this possible, or does anybody have any other, better approaches?

Thanks!

Not exactly what you're asking for, but ..
There is a resource in the Ignition Exchange that might provide some insight:
Perspective Historical Playback

Also a YouTube video with details from the creator:

1 Like

If you use my Integration Toolkit, you can use its tags() function to retrieve your tag values, and dynamically adjust its dwell time argument.

1 Like

You could brute force it:

Your row expressions bindings could be:

If (static, memory_value, actual_value) where static is a toggle button value.

On select of your row, copy one time the actual to memory values.

That’s my go-to if I can’t find a neater way without using external tools. I was hoping there might be a trick to act on the whole popup at once and prevent any tag bindings from updating, or something!

Ended up with the following solution. A little less brute force-y.

  1. All of the data from each row is in a UDT
  2. Create a custom property called dynamicData, which is bound to the row UDT, creating a dictionary of tags and their values for the dynamic rows
  3. Create another custom property called staticData
  4. Create an event script on the view that, on startup, sets the value of that custom property to the value of the row UDT using system.tag.readBlocking which creates an identical dictionary structure to the tag binding on dynamicData
  5. Create a custom property called realtime. Set up a change script on this tag to copy the data from dynamicData to staticData when changed from true to false (i.e. when realtime viewing paused)
  6. Create a custom property called rowData, which has an expression binding: if({view.custom.realtime},{view.custom.dynamicData}, {view.custom.staticData})
  7. Bind all the objects to rowData

Yet to fully test but seems to be working!