Debug a Script

You can use the Geo SCADA Expert 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:

  1. 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.
  2. 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.
  3. 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:

  1. Display the Script in Debug Mode.
  2. 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.

  3. 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.
  4. Use the Step Over/Step Into/Run To Cursor commands to insert breakpoints to step through the code. By setting Geo SCADA Expert 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 Geo SCADA Expert CD/DVD.

 

Further Information

Display the Current Script Execution Path

View and Edit Variables while Debugging


Disclaimer

Geo SCADA Expert 2020