Documentation for Axxon PSIM 1.0.0-1.0.1.

Previous page Programming in JScript  The Editor-Debugger utility Next page


The Script system object is used to initialize a script developed in the JScript language in Axxon PSIM and to set the parameters for its execution..

The settings panel of the Script system object is shown in the figure below:

Attention!

Creating of large number of the Script objects (more than 100) can cause system instability.

The settings panel of the Script system object allows choosing the time schedules and the computers (kernels) for executing the script.

Note

To set all checkboxes next to all computers, select a cell in the column with checkboxes and press Ctrl+A. To clear all checkboxes, select a cell and press Shift+A.

The settings panel of the Script system object has the button for starting the Editor-Debugger utility and the text window for viewing the script text created using this utility. You can edit the script in the Editor-Debugger utility or directly on the settings panel for the Script object.

Moreover, you can configure the events filterthe list of events that the Script system object will process. Including the event to the filter equals to the if operator in the text of script, it means, when the event is in the table, the operator can be omitted.

Attention!

You must configure the events filter when you create a script in large distributed configurations. Otherwise, the module will process all incoming events and it will lead to module malfunctioning.

Example.

If the Object’s type column has the Macro value, the Identifier column has the 1 value and the Event column has the Executed value, then instead of the script below

if (Event.SourceType == "MACRO" && Event.SourceId==1 && Event.Action == "RUN")
{
 DoReactStr("CAM", "2", "REC", "");
}

you can use the following script:

DoReactStr("CAM", "2", "REC", "");

The detailed information on the elements of the settings panel for the Script object is given in Administrator's guide.

Example.

Recording on Camera 1 must be started when controlling the PTZ camera in the Video surveillance monitor.

For this, configure the Script object as follows:

  1. Select the required time schedule when the script must be executed.
  2. Enter the script text:
    if (Event.GetParam("source_type") == "TELEMETRY") {
      DoReactStr ("CAM","1","REC","");
    }
  3. Configure the filter as follows:
    1. From the Object’s type drop-down list, select CORE.
    2. In the Event field, enter DO_REACT.

The filter can be set by the UPDATE_OBJECT event of the CORE object. Example of the command to add the Camera object with identifier 1 to the filter of the Script object with identifier 2:

NotifyEventStr("CORE","","UPDATE_OBJECT","objtype<SCRIPT>,objid<2>,EVENT.objid.0<1>,EVENT.objid.1<10>,EVENT.action.count<2>,flags<>,EVENT.action.0<>,EVENT.action.1<>,EVENT.objtype.0<CAM>,EVENT.objtype.count<2>,EVENT.objtype.1<CAM>,EVENT.objid.count<2>");