System.tag.writeBlocking will halt script execution until the write to the tag is complete is their a similar function for writing to the property of an object?
Why do you think there would be any delay in writing to a property? That's all done in the gateway, unlike system.tag.writeXxxxx()
functions which may have to communicate with external devices.
No, property writing passes through a queue that is intended to ensure in-order writing, but has the side effect that reading back the same property after assignment usually won't give you the "new" value.
Use a local variable for anything that you need to re-use in your script. Treat property writes as "fire-and-forget".
I'll explain my issue more, I have an object with a parameter, inside the object I have a script writing to that parameter. when i use the object I bind a tag to that parameter, I want the object to write to the parameter which in turn will write to the tag, what I want is a way to wait until the parameter has updated its binded tag value. Does that make sense ?
I believe what I am experiencing is the parameter value is changing too fast and the tag binded to it is still busy writing the last value because I get a message about the tag being "Bad_Unsupported"
I presume by "object" you mean an embedded view? And the parameter is defined to be InOut, not just input?
Tag writes from bindings are asynchronous, so no, there's no way to wait on the write completing.
Instead of bidirectionally binding a tag to an InOut parameter of the embedded view, you should pass the tagpath to a string input parameter of the embedded view. Then the embedded view can use system.tag.writeBlocking()
in its script to write to the tag and wait for it to complete (or fail--examine the return value).
Yes I know that you can do that, it is just not as convenient.