Go to documentation repository
Previous page Next page
To create and run scripts in the JScript language, you must 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 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:
To configure the Script object, set the values of the following parameters:
In the Time schedule field, 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.
On the Execute on the specified computers panel (2), specify the computers (kernels) on which you want the created script to run.
Note
By default, the script execution is disabled on all computers (kernels). The computer list displays only the computers registered on the Hardware tab of the System settings window. Right-click to set or clear checkboxes in the group.
To create a script in the JScript language in Axxon PSIM, do the following:
Use the Editor-Debugger button (3) that is located at the bottom of the Script system object panel to open the Editor-Debugger utility.
Note
We recommend using the Editor-Debugger utility to create, edit, and save scripts in the JScript language. The settings panel of the Script object displays the text of the saved script that is also available for editing.
In the Script field, enter the text of the script in the JScript programming language (see Examples of scripts in the JScript language).
To run the script with the test event, use the Debug and Edit → Test run command.
Note
You can also run the script with the test event using the Ctrl+T key combination.
When you work with the script in the Editor-Debugger utility, you can cancel the last action or return the last action. To cancel the last action, press the Ctrl+Z key combination. To return the last action, press the Ctrl+Y key combination.
Note
For the convenience of script editing, the cursor position is saved when you save the script or when you switch between the scripts in the Editor-Debugger utility window during one session, that is, until you restart Axxon PSIM.
When you go to the Script messages list while editing a script and then go back to the corresponding script in the Debug-edit script list, you cannot cancel or return the last action.
Debug a script
To check the syntax correction of the script, use the embedded interpreter in the Editor-Debugger utility. The checkup result with the information about the content and location of the error is displayed in the Debug window corresponding to the script in the Script messages list. If there are errors, you must edit the script syntax and check it again.
Note
For detailed information about using test events for script debugging, see Script debugging.
After you debug 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.
The process of creating the script is considered complete if it runs correctly.