Go to documentation repository
Page History
...
OnInit()—used for initialization of variables (setting initial values) that will be used in scripts. It is executed before starting all modules of the system. We recommend calling the procedure once for all scripts.
Example of use:Code Block OnInit(){ flag=1; num=8; //variables will be initialized at startup }
OnTime(DOW (1-7), day-month-year, hours, minutes, seconds)—running at specific time.
Code Block OnTime(W,D,X,Y,H,C,S) { //W - DOW (0 - Monday, 6 - Sunday); //D - date in the day-month-year format, 16 August 2001 is "16-08-01" //X,Y - reserved //H - hour //C - minutes //S - seconds // COMPARING WITH PARAMETERS, THE ACTION IS SPECIFIED FURTHER }
Examples of use:Code Block OnTime(W,"16-08-01",X,Y,"11","11","30") { //the code will be executed on 16 August, 2001 at 11:11:30 }
Code Block OnTime(W,D,X,Y,"11","11","30") { //the code will be executed every day at 11:11:30 }
Code Block OnTime(W,"16-08-01",X,Y,H,C,S) { //the code will be executed on 16 August, 2001 //every second }
Code Block OnTime(W,"16-08-01",X,Y,"11","11",S) { //the code will be executed on 16 August, 2001 //every second from 11:11 to 11:12 }
Code Block OnTime("0",D,X,Y,"21","0","0") { //the code will be executed every Monday // at 21:00:00 }
OnEvent(source type, number,event)—running if there is a specific event from the system object. This is the main procedure when writing scripts.
Examples of use:Code Block OnEvent("GRAY","1","ON") { //will be executed when closing sensor 1 }
Code Block OnEvent("CAM","12","MD_START") { //will be executed when motion detection tool of camera 12 triggers }
...
Overview
Content Tools