User-defined script

The function "user-defined script" makes it possible to insert code written by the user into the code which is generated by the ScriptWizard. This makes it possible to realize functionality that cannot be realized with the ScriptWizard alone.

Figure 1. Overview - User-defined script

Structure

The following paragraphs list all fields and options of the function "user-defined script" and explain how to use them.

Name/Description

The name / short description makes it easier to find the user-defined code in the script easier. The name / short description is also used in the list of functionality of the ScriptWizard generated function.

Codesection

The code section covers a large part of area in this panel.You can manually type your own script into the code section' text field. As the script is a CTRL script, you need to follow the CTRL script syntax. You can use the CTRL functions in the code.

Only the syntax of the user-defined script wis checked. Any error of the program's logic are neither found nor corrected. It is the users’ responsibility to ensure that the script works correctly.

Add logical expression

Click on the push button "add expression" and you can create logical expressions in the create expression dialog. For more information please refer to logical expressions.

Help

For more information about the function "user-defined script" please refer to the WinCC OA 3.11 online help by clicking on the push button "Help".

Apply

Click on the push button "Apply" and the user-defined script is completed and accepted. The script is then applied to the current function.

Cancel

Click on the push button "Cancel" and the user-defined script is rejected. A new function can be then selected.

Figure 2. A user-defined codesection added successfully