● Whether the procedure names are unique in Global Script
● Whether an action module in Global Script contains only one procedure
● Whether the action part in Graphics Designer contains only one procedure
As a result of the syntax check in WinCC, the script is parsed without being executed. The
script
is parsed again directly before executing in Runtime. All the script parts are parsed, even
those which are executed after a certain action has been executed at a later time.
If the script contains syntax errors, the script is not executed in Runtime.
Runtime error
A Runtime error occurs when an attempt is made to execute an invalid/erroneous action, e.g.
because a tag has not been defined. In order to intercept Runtime errors, use the "On Error
Resume Next" command in the VBScript. The command causes the subsequent command to
be executed following a Runtime error. The error code can subsequently be checked using
the Err object. In order to deactivate the processing of Runtime errors in the script, use the
"On Error Goto 0" command.
Logical errors
The debugger is particularly helpful in clearing up logical errors. A logical error occurs when
an unexpected result is received because, for example, a condition was incorrectly checked.
To clear logical errors, go through the scripts step-by-step in order to detect the part which
does not function properly.
Basic Procedure
When an error has occurred and the debugger is open, the script appears in a window, write-
protected. It is possible to navigate through the script document, set breakpoints, execute the
script again in Runtime and to process the script step-by-step.
The most important steps for successful debugging of the scripts are described under
"Processing Scripts Step-by-Step".
The source codes of the scripts cannot be edited directly in the scripts. When an error has
been detected, the error can be corrected in the original script in WinCC, e.g. load the picture
again and update it in the debugger.
Note
Tips and tricks for debugging, frequently occurring error codes and other information is
available in the Microsoft Script Debugger online help.
Change Picture During Debug
If a picture change is executed during debugging, the script document of the "old" picture
remains open but is no longer valid. If necessary, invalid errors are displayed because the
objects called following the picture change are no longer available.
VBS for Creating Procedures and Actions
1.12 Diagnostics
MDM - WinCC: Scripting (VBS, ANSI-C, VBA)
94
System Manual, 11/2008,