system.tag.readAsync tag update slow

When using, “system.tag.readAsync(paths, checkValues)”, it is not getting the current value on the device.

When using, “system.tag.writeAsync(paths, myValues)”, the device and the tag browser are immediately updated.

How do I force a tag to read a new value.

If I write a value of one tag, another tag changes. The device represents this immediately.

How can I script to update tag-b (immediately) if the value of tag-a a changes?

My wording may be off, please feel free to correct me.

You cannot. Left alone (no writes), an OPC tag only gets its data from its OPC subscription. With the timing specified in its tag group. Anything else violates the OPC specification for subscriptions.

It sounds like you really want to use system.opc.read*(), which bypasses subscriptions to get the latest information from the OPC server. But beware, this does not update any tags subscribed to that same OPC item.

2 Likes

My scanner class is using direct polling, with no subscriptions. The device is an OPCUA nano profile server. The value returned from the system.tag.read*() is still an old value. It take about 15-30 seconds to get a new value.(note: my scan is set for 5000ms) Yet the system.tag.write*() happens in milliseconds. The new values show on the device in milliseconds as well.

:open_mouth::astonished::sweat_smile: I just got it. I just noticed your bold system.opc.read*()…

Thank you sir. I will try this.

Thank you

qValue = system.opc.readValue(“MyServer_008”, “ns=4;i=11”)

#first index of string array.
system.gui.messageBox(str(qValue.value[0]))