How To Use Scripts?
How To Use Scripts?
1. Applied Logic Development
Users can create a program through scripts. It is used to manage histories or make schedules by putting computed data into a virtual point.
Write in the 'Data Explorer > Calculation Formula' tab.
1.1. Examples
1) Compute the real data and put it into a virtual point
2) Send a command regularly such as 'Control the device at every 6 pm'
3) An automatic action with User-entered values
2. Interface Development
Users can develop a complex interface with interface development scripts.
It is used to set a default value of widgets or objects located within a canvas or to control devices by clicking objects.
Write in the 'Graphic Objects > Data Link', 'Canvas > Canvas Settings', 'Projects > Project Settings' script tab.
2.1. Canvas Script
Canvas Script is a script that is used to set a default value of widgets or objects located within a canvas when loading the canvas, or executing a loop within the canvas.
The script set at 'Canvas loading', 'Canvas terminating' and 'Canvas activating' then it is executed when those events occurred.
Write in the 'Canvas Settings > Script' tab.
2.1.1. Canvas Script Examples
1) Run a loop task within a canvas such as time displaying
2) Remove all graphic objects when loading a canvas
① When loading a canvas, read charging and discharging schedule information and display the information on a table
② When loading a canvas, give an animation effect to graphic objects
③ When loading a canvas, display default values on graphic objects
3) When loading a canvas, define frequently used functions, call the function on 'Graphic Object Script'
2.2. Graphic Object Script
Graphic Object Script is a script that executes when the mouse effects ('Mouse pressed' 'Mouse released') are sent to graphical objects.
When the effect occurs on objects, the user can process particular actions through the script.
Write in the 'Data Link > Script' tab.
2.1. Object Script Examples
1) Screen moving when the button pressed
2) Device controlling when the button pressed
3) Displaying the data of User-selected date on a graph when the button pressed
4) Printing User-entered value on a device when the button pressed
2.3. Project Script
Project Script is a HMI global script. It used when shared objects or variables exist within a project.
Write in the 'Project Settings > Script' tab.