07 Global Script en
07 Global Script en
07 Global Script en
Actions are scripts that run in the background and that are independent of the
currently selected picture. With actions, a trigger therefore needs to be defined.
Many functions are made available as soon as WinCC is installed. With the
Global Script editors, however, you can write your own functions. Functions
contain tasks that are repeated, for example calculating a mean value. These
functions are then called in other scripts. For this reason, no trigger can be defined
here.
In the figure above, you can see two simple functions for the addition of 2 values.
Actions For the actions, there are two subfolders in the figure above. One folder with the
computer name of the single-user station and "Global actions". With WinCC
server-client configurations, there is one folder per computer. This means it is
possible to specify for an action that it should, for example, only run on a specific
computer.
Since the trigger is fixed at one second, this action is started every second. In this
case this is wanted and a tag trigger cannot be used here.
Computer properties
When global actions need to be started, the component "Global Script Runtime"
must be activated in the computer properties.
Example of a function The function above calculates the sum of the transferred parameters.
With the line "MyAddFunction = value1 + value2 the sum is returned to the calling
location.
Computer properties
When global actions need to be started, the component "Global Script Runtime"
must be activated in the computer properties.