Documentation for Axxon PSIM 1.0.0-1.0.1.

Previous page The AddIni method  The KillTimer method Next page


The SetTimer method is used to start the timer.

Syntax for method invocation:

function SetTimer (id : int, milliseconds : int)

Method arguments:

  1. id is a required argument. It specifies the timer ID. Possible values are int or string type.
  2. milliseconds is a required argument. It specifies the period with which the timer will trigger if it is not stopped by the KillTimer method. It is specified in milliseconds. Possible values: int type.

Example. Two seconds after the macro 1 is executed, start recording on camera 1.

if(Event.SourceType=="LOCAL_TIMER" && Event.Action=="TRIGGERED" && Event.SourceId==333) //you can specify Event.SourceId == "333", that is use the string identifier type
{
 var actuallyKilled = KillTimer(333); 
 if(actuallyKilled == 1)
 {
  DoReactStr("CAM","1","REC",""); 
 }
}
 
if(Event.SourceType=="MACRO"&& Event.SourceId == "1" && Event.Action == "RUN")
{
 SetTimer(333,2000); //333 - id, 2000 msec = 2 sec - period
}
  • No labels