3. Select the "Delete" command from the context menu.
4. To delete a procedure: Open the relevant module and delete the corresponding code in
the editing window.
See also
Actions (Page 21)
Modules and Procedures (Page 18)
Global Script Editor (Page 30)
1.9 Creating and Editing Procedures
1.9.1 Creating and Editing Procedures
Introduction
Projects and standard procedures can be programmed in WinCC using VBS:
● Project procedures can only be retrieved in the current project. Since procedures are stored
in the project directory, they are automatically copied when a project is copied.
● Standard procedures can be called in by all computers linked to a project. When a project
is copied onto another computer, the standard procedures must be copied into the
corresponding directory on the target computer manually.
The copied procedures are directly available for use in Runtime. The become visible in the
editor when the view is updated.
Apart from the procedures programmed by yourself, general VBS functions can also be used
(e.g. Abs, Array,... Year). These general VBS functions can be invoked in the code using the
"Function List" command from the context menu.
In addition, WinCC provides the most popular instructions as code templates (e.g. If...Then,
When...While). The code templates can be moved from the navigation window's Code
Templates tab control directly into your code via drag&drop.
If you insert a code template into your code, it is important to note that, for example, conditions
in the templates are identified by "_XYZ_". You must replace these placeholders with the
appropriate information.
Using Procedures
Procedures are used for the central creation and maintenance of codes which are to be
implemented
at several point in the configuration. Codes are written and saved in a procedure
and the procedure is called in with the current parameters in actions or other procedures
instead of repeatedly entering the same code.
Procedures are created for repeated functionalities, e.g.
VBS for Creating Procedures and Actions
1.9 Creating and Editing Procedures
MDM - WinCC: Scripting (VBS, ANSI-C, VBA)
System Manual, 11/2008,
39