System.tag.readBlocking method only read the current tag value?

Hi everyone!
I am trying to bind a tag using Python script instead of binding through UI. I have used system.tag.readBlocking method to read the tag’s value then passing it to a label. I noticed that the label only showed the first value of the tag. The label did not update the changed values.
I also tried system.opc.readValue(‘Ignition OPC UA Server’,’[default]Ramp/Ramp0’) for example, but it showed the log:

null, Bad("Bad_NodeIdUnknown: The node id refers to a node that does not exist in the server address space."

How can I do to read and update the tag value continuously via Python script?

Thank you for your time!

Try something like."[default]Ramp/Ramp0").value

Also I don’t believe that will work either. That code would be more to display the value. Not sure it will work as a UIbinding. Because it has to be triggered.

Can you give me details about what you are trying to do?

1 Like

Let's step back a bit:

Actually, I’m trying to make UI dynamic on the same page via Flex Repeater.
On my page, I have a dropdown with two options: siteA and siteB. SiteA has one component and siteB has two components. Each component has some fields reading some tag values. My idea is to bind the instances property of Flex repeater with a script. In that script, I will return an array of instance of tag values based on the site user choose on the dropdown.
I want the values of each UI component will update when the tag value changes. But system.tag.readBlocking and system.opc.readValue did not work in my case.

Don’t try to pass dynamic values. Instead, pass a tagpath into the component(s). Use an indirect tag binding to construct a ‘real’ binding based on a dynamic path.

Scripting is the wrong hammer for this nail.


Yeah, I see the problem here. Could you describe it in more detail?

My second question is how we can read and update changes of a tag value using Python script?

Thank you very much.

You just read and write using system.tag functions. There's no such thing as a 'dynamic' reference to a tag's value - only "atomic" read and write operations.

Thanks your support.
That means we cannot make a binding in Python script. Because it just returns a primitive python object if I do not misunderstand.
It would be great if we could implement tag binding via script. Because we want to implement some logic codes that we cannot do through UI in some cases.
Does the current Perspective version has some functions like a timer that can refresh the script after amount of time?