Field variables
To reference field variables (controller tags or variables of an OPC UA server), use special project variables (tags) that report the value of the field variables.
Read/write field variables in FactoryTalk Optix Studio and in C#
-
Reading/writing tag variables synchronized with corresponding controller tags.
-
Reading/writing important variables with an OPC UA Client object from an OPC UA server to synchronize them with the OPC UA server corresponding variables.
-
Reading/writing a variable directly or indirectly connected (using dynamic links or converters) to a variable described in previous cases.
Get
method, FactoryTalk Optix Studio does not read the value on the field and can return a value that has not been updated.Value change events
-
To subscribe methods to the change value event of the field variables, use a
RemoteVariableSynchronizer
object. TheRemoteVariableSynchronizer
object updates the project variables referring to the field, without repeating readings through simple API reading. -
The
RemoteVariableSynchronizer
object is not required if a link to a tag variable from a graphical object, data logger object, alarm or recipe schema object exists in FactoryTalk Optix Studio. In a NetLogic, you can subscribe the change value method directly to the linked tag variable. -
Management of communication delays with the field. If a field variable is read/written in NetLogic, execute the instructions, and verify that the current value is read or written. The APIs for reading/writing field variables are synchronous. Their execution must end before the next instruction can be ran.