Control scripts

Control scripts are programs written in the internal "Control" language, which is closely related to ANSI C. They are interpreted by the system and thus do not need compiling. These scripts can be used to link changes in process statuses with defined responses, for instance a change in device settings or changes in the visualization display.

For tasks of the first type, i.e. lengthy Control programs, scripts can be written in any text editor. The Control Manager in WinCC OA serves as a tool that not only checks the correct syntax of such Control scripts but also acts as interpreter. To link changes in process variables to changes in the properties of graphics elements during visualization, a specific Script Editor can be opened from several dialog boxes in the graphics editor. This also checks the correct syntax of the programs written in it, and provides support for correct addressing of colors, fill patterns, line styles and fonts, as well as addressing data points.

Debug-Option: -dbg CTRL_PERF

The Debug option -dbg CTRL_PERF is available for Control scripts for performance analysis. The option -dbg CTRL_PERF shows the time a function takes to execute, the time a function waits etc. (see also the config entry [general] ctrlMaxWeight).

As of version 3.7, the "-report CTRL_PERF" also shows the time, the functions have waited for events. This means that the following information is output:

  • blocked time per call

  • blocked time dep. per call

Calculation of blocked time: this is the time, the thread waits for an event. Since a thread only detects this when executing, the blocked time also depends on how much time the previous threads needed. If, for example, another thread requires 20 seconds for a dynUnique function, these 20 seconds are counted among the blocked times of the subsequent threads. A statement that would have a delay(1), would in this case output a blocked time of 20 seconds.

If a script cannot be executed a corresponding error message is displayed inside of the LogViewer for each script that fails to run.