Tag synchronisation

Hi everybody!

Let’s say I have three tags in an AB PLC (newData, FirstData, SecondData). Thoses tags are read by Ignition using the same provider and the same scan class. When a test is finished, the PLC put the results in FirstData and SecondData and then set the tag newData to 1 to indicate new data is avaible.

In Ignition there is a value Change script on newData. This scrip take the value of the others tags to build a JASON string and send all the data to another system using a webservice (http.post).

The question is about data sync. In Ignition, how to be sure the JSON string will contain updated value of FirstData and SecondData?

Thanks.

Don’t use tags, except for the trigger. Use system.opc.read\*() in your tag change event script to get the actual data. That is the only way to be sure that the data reads actually occur after the trigger changed.
This is exactly how the OPC Read mode works in transaction groups. Only the trigger is subscribed – the rest of the transaction group is explicitly read after the trigger is evaluated.

4 Likes