Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The program is written for a camera with an ID of 1 and for a Sensor object whose ID is also equal to 1. Thanks to this program, the value of the Delay parameter can be set equal to 7 seconds.

Code Block
OnEvent("GRAY","1","ALARM")

...


{

...


[
	if( !CheckState("CAM","1","DETACHED") )
	{
		DoReact("CAM","1","REC_ROLLBACK");

...


		Wait(5);

...


		DoReact("CAM","1","REC_STOP");

...


	}
]
}

OnEvent("GRAY","1","ALARM")

...


{

...


[

...


	Wait(2);

...


	DoReact("GRAY","1","CONFIRM");

...


	Wait(2);

...


	DoReact("GRAY","1","ARM");

...


]

...


}



When continuous recording is in use, the following program should be used:

Code Block
OnEvent("GRAY","1","ALARM")

...


{

...


[

...


Wait(5); // Specifies the time after which the recording should be stopped in order to get the required clip length or number of frames

...


DoReact("CAM","1","REC_STOP");

...


Wait(2); // Pre-alarm record time in the camera settings = 2 sec.

...


DoReact("CAM","1","REC_ROLLBACK"); // Start recording with pre-alarm recording of 2 seconds. This allows us not to lose data in the archive

...


]

...


}