Creating a Relative Referencing Symbol
The following example describes the creation of a Symbol using relative variable referencing.
Example
The Symbol is to represent a motor attached to a paddle stirrer. The symbol is to display the motor status and speed. A control zone will allow a user to start and stop the motor. The completed Symbol might look something like this.
- Create or open a window to use as a work area in which the symbol will be created. The window must be opened with a valid Branch, for example Process.Engine1.Compressor1, as the HMI checks the existence of a variable when using it in an animation.
- In Design mode, draw the static shape.
- Apply the animations. When entering the variables only enter the relative part of the name. The variable browser will do this automatically for you or can enter the name manually.
- Select all the drawing elements and use the Group command to create a drawing group. The drawing elements will be surrounded by 8 large black squares when they have been grouped.
- Select the Edit.Create Symbol command. A dialog will be displayed prompting for the symbol name. If you have multiple Libraries then a list of the available Libraries is also displayed.
- Choose the library, enter the s Symbol name and select OK.
More about relative referencing
In the example, only the last part or the leaves of the variable names were used in the symbol. However, there is no restriction to how much or how little of a variable name you use as long as when the variable reference is concatenated with the branch it produces a valid variable name. For example, in the above symbol, we could have used Compressor1.B1, Compressor1.M1 etc. and when the symbol was pasted into a window, we could have used the branch Process.Engine1.
In some cases, a symbol might appear in a window that has been opened with a branch. In this case, the window branch, symbol branch and variable reference in the animation are all concatenated to provide the final variable name.
You can also use the ?.VarName syntax in symbols. See the topic Using Variables in an Animation for further information.