Documentation for Axxon PSIM 1.0.0-1.0.1.

Previous page Syntax analyser  Description of syntax Next page


On the page:

  1. Set a general task.
  2. Outline the task into subtasks.
  3. Write subtasks and debug them.
  4. Find and fix bugs.

Setting a general task

You must have a clear vision of what must happen in the system when certain event occur. Specify the ID of devices that participate in generating events and actions.

Outlining the task into subtasks

If several events must be processed in one task, then it must be clear what to do with each event. If possible, exclude the possibility of loop script execution, it means, exclude any recursive actions if they are not related to task execution.

Writing subtasks and debugging them

The most difficult part of writing scripts is creating the list of actions with possible use of logic and cycle operations. Debugging of this part of programming takes much time. Events generation that needs processing is not usually easy-to-use, especially on a real objectfor example fire sensor triggering or motion by camera that is far programming place (from the server with the system core). In this case, it is recommended to generate an event manually at the stage of debugging, the best way is to run an empty macro. After the body of the script is debugged, there is a real event instead of running the empty macro. Moreover, you can make sure whether the event is written correctly events without starting the action list by running an empty macro and watching its performance in the Debug window.

Finding and fixing bugs

At program startup, embedded syntax analyzer checks if names of functions are spelled correctly, but does not check the program syntax (position of key characters: commas, semicolons and nested parentheses). In order to track the bugs in the program, if any, you must activate the Debug 4 debug mode (see Enabling and configuring the debug mode of Axxon PSIM). In there are syntax errors, the Critical errors window will be displayed at the stage of the program body execution. This window lists the names of functions with incorrect syntax and other debugging information.

Note

If the syntax is correct, but the program still doesn't work or works with errors, we recommend rewriting the program as a script in JScript (see The Script object. Programming using the JScript language).

  • No labels