Go to documentation repository
To create and run scripts in JScript, create the Script system object. Then, in the Editor-Debugger utility, enter the script, check it and debug it.
You can create JScript scripts in Axxon PSIM using the built-in Editor-Debugger utility.
To start the Editor-Debugger utility, click the Editor-Debugger button on the settings panel of the Script system object.
To create the Script object in Axxon PSIM, do the following:
The settings panel of the Script object will open.
To configure the Script object, set the values of the following parameters:
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.
In the Computers field (2), select the computers (kernels) on which the script must run.
Note
By default, the script will run on all computers (kernels). The list displays only the computers registered in the Hardware tab of the System settings dialog window.
To create a script in JScript in Axxon PSIM, do the following:
Click the Editor-Debugger button (3) at the bottom of the Script system object panel to open the Editor-Debugger utility.
Note
Use the Editor-Debugger utility to create, edit and save scripts in JScript. The settings panel of the Script system object displays the text of the saved script that can also be edited.
In the Script field, enter the text of the script in JScript programming language (see Examples of scripts in the JScript language).
To run the script using the test event, select Debug and Edit → Test run.
Note
You can also run the script using the test event using the Ctrl+T key combination.
When working with a script in the Editor-Debugger utility, you can undo the last action or return the last action. To undo the last action, press the Ctrl+Z key combination. To return the last action, press the Ctrl+Y key combination.
Note
For your convenience, when editing the script, the cursor position is saved when saving the script or when switching between the scripts in the Editor-Debugger utility window during a session, it means, until Axxon PSIM is restarted.
Note
When you go to the Script messages list when editing a script, and then go back to the corresponding script in the Debug-edit script list, you cannot undo or return the last action.
You can check if the script syntax is correct using the interpreter which is built-in into the Editor-Debugger utility. The result of the check with the information about the content and location of the error is displayed in the Debugger window corresponding to the script in the Script messages list. If there are errors, you need to edit the script syntax and check it again.
Note
See the detailed information about using test events for script debugging in Script debugging.
After debugging the script using 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 is considered complete if it runs correctly.