Using substitution strings or variable attributes in an animation
Substitution strings allow you use contextual information in an animation. For example, #W is substituted by the name of the containing window.
Variable attributes allow you to display complementary information about a variable at run time. For example, you could display one of a variable's text attributes that represented an equipment name.
There is some overlap between substitution strings and variable attributes in that the #An substitution string substitutes a variable's text attributes.
Using substitution strings
All substitution strings are prefixed with the # character, which informs PcVue that the following character(s) are to be interpreted as contextual information. The substitution strings, and the animations that support them, are as follows.
String | Description |
Animation Text.Label(1) - Format property - |
Animations Link.Open - Window property - |
Animation Run.Macro(3) - Line 1 to 5 property - |
Animations - Comment property(4) - |
Mimics - Display.Title property - |
Text drawing element - Text value - |
SCADA Basic instruction GETARG - Arguments 1 to 16 - |
#A1 | A variable's domain | X | X | X | X | |||
#A2 | A variable's nature | X | X | X | X | |||
#A3 to #A16 | A variable's extended text attributes 3 to 16. Attributes 1 and 2 correspond to the domain and nature. | X | X | X | X | |||
#B | Full branch of the window (all branch segments) | X | X | X | ||||
#B1 to #B12 | Branch segments 1 to 12 of the containing window | X | X | |||||
#d | A variable's domain (legacy only, new projects should use #A1) | X | ||||||
#D | The day number as two digits | X | ||||||
#I | The name of the First window from the project settings | X | ||||||
#h | The hours from the current time as two digits | X | ||||||
#m | The minutes from the current time as two digits | X | ||||||
#M | The month as two digits | X | ||||||
#M1 to #M10 | The names of menu mimics from a mimic's configuration (Links tab) | X | ||||||
#M11 to #M20 | The names of menu mimics from the current User's profile (Mimics tab) | X | ||||||
#n | A variable's nature (legacy only, new projects should use #A2) | X | ||||||
#P | The name of the previously opened window | X | ||||||
#s | The seconds from the current time as two digits | X | ||||||
#S | The full branch of the containing symbol (context branch plus local branch) | X | X | X | ||||
#SB | The full branch of the containing symbol (legacy only, new projects should use #S) | X | X | X | ||||
#S1 to #S12 |
Branch segments 1 to 12 of the containing symbol (context branch plus local branch) | X | X | X | ||||
#T | A variable's description | X | X | |||||
#U | The name of the First window from the current User's profile (Mimics tab) | X | ||||||
#V | The context variable name | X | X | X | X | |||
#W | The name of the window | X | X | X | X | |||
#WB | The full branch of the containing window (all branch segments) | X | X | X | X | |||
#WN | The name of the mimic file | X | X | X | X | |||
#WT | The title of the containing window | X | X | X | ||||
#W1 to #W12 | Branch segments 1 to 12 of the containing window | X | X | X | ||||
#Y | The year as two digits | X | ||||||
###Y | The year as four digits | X | ||||||
#1 to #12 | Branch segments 1 to 12 of a variable | X | X | X | X |
(1) For substitution strings not associated with variables, for example #W, you still have to configure the Variable property and its normal practice to use a temporary variable name like TMP%. Temporary variables only exist within the context of the mimic and have no effect on the behavior of the substitution string.
(2) Link open and Link close animation. Also supports the star character * which is interpreted as the current window or branch depending on where it is used.
(3) Macro animation scripts when used in a context mimic.
(4) Comment - When used to configure a tooltip. Refer to the topic How to add and remove an animation.
Using a variable's extended attributes in an animation
You can use a variable's extended attributes in an appropriate animation by appending the attribute's mnemonic to the variable name. By appropriate we mean an animation expecting a text value for a text attribute, or an animation expecting a bit value for a binary attribute.
- To display a text attribute append .TATTn# to the variable name where n is the number of the text attribute. Note that TATT1# and TATT2# are the variable's Domain and Nature respectively.
- To display a binary attribute append .BATTn# to the variable name where n is the position of the bit within the binary attribute. For example, EFFLUENT.TANK2.STIRMOTOR.RUNNING.BATT2# would display a 1 if the binary attribute were 00000010.
Displaying the timestamp of a variable
The timestamp of a variable is the time at which the value last changed. To display the timestamp you append .#_T to the variable name in the Display Register animation. For example, to display the timestamp for TANK1.VALVE1 you would use TANK1.VALVE1.#_T. To display the timestamp correctly you must use the Custom Display Format option and select DATE for the received unit and the appropriate format for the output unit. For example, hh:nn:ss dd/mm/yy@t Show picture
Displaying the quality of variable
The quality of a variable provides an indication of the value quality. It is mainly of use when the variable's source is an OPC server. To display quality you append .#_Q to the variable name in the Display Register animation. For example, to display the quality of TANK1.VALVE1 you would use TANK1.VALVE1.#_Q
Using the simulation properties of a variable
The properties of a variable related to simulation can be used in an animation:
-
To display the value of the Simulated property, you append .SIMU# to the variable name in any animation based on a Bit variable. The property can be used as the base for a display animation to indicate whether the variable is simulated or not (color on bit for example), and it can also be used to set/reset the variable's Simulated property using a Send bit animation.
-
To display the fallback value property, you append .SIMFALLBACK# to the variable name in an animation of the proper type (bit, register or text animation depending on the simulated variable type). The property can be used as the base for a display animation to display the fallback value, and it can also be used to set it using a Send animation.
-
To display the expiration time property, you append .SIMEXPDATE# to the variable name in a Register animation. The property can be used as the base for a display animation to display the expiration time, and it can also be used to set it using a Send Register animation.
Use a custom format to display the simulation expiration time as a date and time.