A Tag Reference is reference to a Database Tag.
You can use a Tag Reference to read from, or write to, a tag in the Fernhill SCADA Server.
A Tag Reference starts with the percent (%) character immediately followed by a double quote character ("). A second double quote character (") marks the end of the tag reference.
%"Tag Reference"
In the Tag Reference part, the full stop (.) character marks the boundary between:
A Tag Reference that starts with a full stop (.) character is a relative tag reference. The actual tag reference is worked out relative to the tag that contains the tag reference.
A Tag Reference starting with multiple full stop (.) characters is a backward reference. Each additional full stop moves one place up the folder tree in the tag database.
%"Pump Control.Pump1"
%"Pump Control.Pump1.Quality"
%".Pump1.Quality"If this reference was made from a tag called Pump Control.Graphic, the actual reference would be Pump Control.Pump1.Quality.
%"..Overview"If this reference was made from a tag called Pump Control.Pump1.Graphic, the actual reference would be Pump Control.Overview.
An indirect tag reference uses the value of one tag to define the target of the tag reference.
To create an indirect tag reference enclose a tag reference inside less than (<) and greater than (>) characters. For example:
%"<Display Phase>.Value"
The actual tag reference is the value of the Display Phase appended with the text string .Value. If the value of Display Phase is "Phase 1", the resulting tag reference is Phase 1.Value.
The tag reference enclosed inside the less than (<) and greater than (>) characters must be an absolute tag reference.
The data type associated with an indirect tag reference is always STRING. Use a Type Cast to convert the indirect tag reference to the type you require. For example:
TO_REAL( %"<Display Phase>.Value" )
An indirect tag reference returns an empty string if there are any errors. For example:
Using indirect tag references may result in slower performance compared to using direct tag references.
The target of a direct tag reference is located when the direct tag reference is created. This results in efficient operation because the value can be retrieved by a simple lookup operation.
The target of an indirect tag reference cannot be worked out in advance. The following steps are required to read a indirect tag reference:
Tag References are an extension to the IEC 61131-3 standard.
To learn about other IEC 61131-3 Common Elements.
For the meaning of terms used in Fernhill SCADA.