You can use declared view variables directly in animations and effects. To link the view variable with an animation, use the equation editor like with regular PLC tags.
Example:
1. Let’s show the value of the Value Memory Variable in a text element in your view.
2. Open the Script window.
3. In the Value Memory tab of the Variables window, create ‘InternalVariable’ with a default value of 10.0.
4. Switch back to the view you are editing.
5. Create a text element in your view, click on it, and create an animation with a memory variable by typing “=InternalVariable” or selecting memory variable with the equation editor.
Specific mySCADA functions
In the script, you can use any functions declared in JavaScript. To interfere with your graphics, you can use additional functions defined by mySCADA. A complete list of all available functions, including help, can be found in the Useful Functions List.
If you click on the category, you will see the list of all available functions:
Now select the function you are interested in, and you will see a description and help on the right side of the window.
- TIP: You can drag the selected function and drop it into your source code.
As you can see from the function list, most of the functions deal with your graphical objects. To be able to address your graphical object, you need to know its ID. Every graphical object in your view has its unique ID that can be found in properties. Click on the graphical object and then look in Properties – ID:
You can control animations of your graphic object directly in the script with specific mySCADA functions. To set the value of the element directly in the script, use the following function:
myscadaSetText(‘text0001‘,internalMemory);