Debug a Script
You can use the ClearSCADA Debug feature to check for errors in your scripts. The feature is also useful when trying to establish why a script is producing unexpected results, even though it has the correct syntax. The way in which you need to use the Debug feature varies slightly according to whether your script contains a coding error.
If you run your script and it contains errors:
- When the script runs, a diagnostic message is displayed. It informs you that a script error has occurred and prompts you to run the script in Debug mode.
- Select the Yes button to run the script in Debug mode.
The script runs in Debug mode and breaks on the line that contains the first error. An error dialog box informs you which line contains the error. - Remove the error by changing the code appropriately. When your script contains no errors, it will run successfully and you will no longer be prompted to run the script in Debug mode.
If you run your script and it runs successfully but produces unexpected results:
- Display the Script in Debug Mode.
- Use the Insert/Remove command on the Script tab to insert breakpoints where you suspect there may be problems in the script.
The debugger will break at the breakpoints in turn.
- Trigger the script to run.
- For Mimics, the script will either run when you first display the Mimic or will run when you select an appropriate Mimic script pick action.
- For the Alarm Banner, the script will run when you right-click in the Alarm Banner (if a breakpoint is inserted on the line containing BuildAlarmMenu) or when you select one of the menu options added to the Alarm Banner’s context sensitive menu by the script.
- Use the Step Over/Step Into/Run To Cursor commands to insert breakpoints to step through the code. By setting ClearSCADA to run segments of the code and then breaking, you may be able to determine where the unexpected results are occurring and then you can make appropriate adjustments.
For more information on the commands included on the Script tab of the ViewX ribbon, see Debug Mode.
If you experience continued problems with your script and you have checked it and debugged it thoroughly, you can report the problem to Schneider Electric (see Report a Script Failure - Disable CompressWebRequests).
The Debug feature is only available after you have installed the Microsoft Windows scd 10en.exe feature which is provided as a third-party application on your ClearSCADA CD/DVD.
Further Information