Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To create and run scripts in the JScript language, you must create the Script object system object. Then, in the the Editor-Debugger utility, enter the script, check it, and debug it.

You can create JScript scripts in Axxon PSIM using the built-in embedded Editor-Debugger utility.

To start the Editor-Debugger utility, click the Editor-Debugger button that is located on the settings panel of the Script object.

...

To create the Script object in Axxon PSIM, do the following:

    In the
  1. Create the Script object (2) on the Programming tab (1) of the System settings
  2.  window, create the Script object (2)
  3. window.
  4. Enter Set the identification number and the name for the Script object (3).
  5. Click the Apply button (4).

    The As a result, the settings panel of the Script object will openopens.

To configure the Script object, set the values of the following parameters:

  1. In the Time schedule field (1), specify the time schedule of the script execution: Always, Never,or one of the schedules created earlier (1, see Creating and configuring time schedules). The default value is Never.

  2. In the Computers field On the Execute on the specified computers panel (2), select specify the computers (kernels)  on on which you want the created script must to run.

    Info
    titleNote

    By default, the script will run execution is disabled on all computers (kernels). The computer list displays only the computers registered in the on the Hardware tab of the System settings window. You can group check Right-click to set or clear all checkboxes by right-clickingcheckboxes in the group.

  3. Click the Apply button.

Creating and editing a script

To create a script in the JScript language in Axxon PSIM, do the following:

  1. Click Use the Editor-Debugger button (3) that is located at the bottom of the Script system object panel to open the Editor-Debuggerutility.

    Info
    titleNote

    Use the We recommend using the Editor-Debugger utility to create, edit, and save scripts in the JScript language. The settings panel of the the Script object displays the text of the saved script that can also be editedis also available for editing

  2. In the Editor-Debugger utility window, open expand the Debug-edit script list and select the Script object that you want to edit (for example, the Script 1 object, as in the figure below).
  3. In the Script field, enter the text of the script in the JScript programming language (see Examples of scripts in the JScript language).

  4. Run the script using a the test event. To create a the test event, select use the Debug and edit → Edit test event command.
    The As a result, the Test message window opens containing the fields for setting the event parameters is displayed.

To run the script using with the test event, select use the Debug and Edit → Test run command.

Info
titleNote

You can also run the script using with the test event using the the Ctrl+T key combination.

Features when working with a script

When working you work with a the script in the the Editor-Debugger utility, you can undo cancel the last action or return the last action. To undo cancel the last action, press the Ctrl+Z key combination. To return the last action, press the Ctrl+Y key combination.

Info
titleNote

For your convenience, when you edit the scriptthe convenience of script editing, the cursor position is saved when you save the script or when you switch between the scripts in the the Editor-Debugger utility window during a one session, which means that is, until you restart Axxon PSIM.

When you go to the Script messages list when you edit while editing a script , and then go back to the corresponding script in the Debug-edit script list, you cannot undo cancel or return the last action.

Debugging Debug a script

You can check if the script syntax is correct using the interpreter, which is built in to To check the syntax correction of the script, use the embedded interpreter in the Editor-Debugger utility. The checkup result of the check with the information about the content and location of the error is displayed in the Debugger Debug window corresponding to the script in the Script messages list. If there are errors, you need to must edit the script syntax and check it again.

Info
titleNote

 See the  For detailed information about using test events for script debugging in , see Script debugging.

After debugging you debug the script using the the Editor-Debugger utility, run it with a real system event. Check the result of the script execution. If the result is incorrect, make the necessary changes and run the script again.

Script creation The process of creating the script is considered complete if it runs correctly.