Hello,
I am working with the table component of Perspective.
The data displayed in the table comes from a binding with a script reading OPC Tags.
The solution may be very simple but I can’t figure it out : my issue is that after the data being imported in the table when starting the sesssion, the value of the tags won’t be updated unless the binding is refreshed.
Is there a way to dynamically show the tag value in the table components, using multiple OPC tags ?
Should I have a timer to refresh the binding periodically ?
Reading tags in a script does not make a subscription. You must read repeatedly to keep the data fresh. Consider using custom properties with tag bindings to monitor the live tag values. Pass those properties to a script to assemble the dataset in the displayable form you like.
My issue is that I want to only refresh the value of the tags, but I have other data in my dataset that I want to keep.
I figured a way to refresh only the values but this makes a “glitch” on the screen when updating, it lay be a timer issue.
for exemple : I edit column_4 to be True, and after the update of the column_2 (which is every 5 seconds with my timer script), it comes back to False
I have an event on the table “onEditCellComit” to keep the edited value, and it works without the timer activated.
Here is my timer script in a “onStartUp” event on the table :
Is there a solution to prevent the other columns from reseting ?
Don’t use an infinite loop in any event! (Nor sleeping of any kind, though Perspective is more tolerant than Vision.)
Bind the now(5000) expression to a custom property to get a value that updates automatically every five seconds. Attach an onChange event to that property to run your tag update script.