Versions Compared

Key

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

If you want to attach a JPEG frame or video fragment to the alarm message that is sent when a sensor is activated (Sensor object), remember that attachment is made only after the current archive file is written to disk. To reduce the waiting time (the Post-alarm time (sec)value, see Setting up sensors) and to guarantee that camera footage will be recorded, you can create the following a Program object in Intellect, on the Programming tab of Intellect software package.

This script is written These programs are written for a camera with an ID number of 1 and for a Sensor object whose ID number is also equal to 1 as well.  With this script, we can set the Post-alarm time value to 7 seconds.. Thanks to these programs, the value of the Delay parameter can be set equal to 7 seconds.

Note
titleAttention!

To get several video fragments, you can specify several repeated commands "REC" and "REC_STOP" in the script. If "rollback" is used, and the prerecording time in the settings of the Camera object is greater than or equal to the time between subsequent "REC_STOP" and "REC" commands, then this video fragment will be combined with the next video fragment.

Option 1. The camera is disarmed:

Code Block
OnEvent("GRAY","1","ALARM")
{
[
    if( !CheckState("CAM","1","DETACHED") )
    {
        DoReact("CAM","1","REC_ROLLBACK","rollback<1>");
        Wait(5);
        DoReact("CAM","1","REC_STOP","priority<2>");
    }
]
}
 
OnEvent("GRAY","1","ALARM")
{
[
    Wait(2);
    DoReact("GRAY","1","CONFIRM");
    Wait(2);
    DoReact("GRAY","1","ARM");
]
}

...

Option 2. Camera is armed:

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

...


    if( !CheckState("CAM","1","DETACHED") )
    {
        DoReact("CAM","1","DISARM");
        Sleep(50);
        DoReact("CAM","1","REC","rollback<1>");
        Wait(5);
        DoReact("CAM","1","REC_STOP","priority<2>");

...

        Sleep(2050); // 

...

Prerecording time in the 

...

Camera settings = 2 sec.

...

        DoReact("CAM","1","

...

ARM");
  

...

 

...

 }
]
}
 
OnEvent("GRAY","1","ALARM")
{
[
    Wait(2);
    DoReact("GRAY","1","CONFIRM");
    Wait(2);
    DoReact("GRAY","1","ARM");
]
}

Option 3. Continuous recording:

Code Block
OnEvent("GRAY","1","ALARM")
{
[
   
    if( !CheckState("CAM","1","DETACHED") )
    {
        Wait(75); // Specifies Thisthe time equalsafter which the recording should be stopped in order to get captionsthe displayingrequired timevideo +fragment 2or secondsnumber of pre-alarm recording
    frames
        DoReact("CAM","1","REC_ROLLBACK"STOP","priority<2>");
        Sleep(2050); // StartPrerecording time recordingin withthe pre-alarmCamera recordingsettings of= 2 secondssec. This allows us not to lose
        DoReact("CAM","1","REC","rollback<1>"); // Start recording with 2 sec rollback (during prerecording). Thus, data in the archive is not lost.
    }
]
}
 
OnEvent("GRAY","1","ALARM")
{
[
    Wait(2);
    DoReact("GRAY","1","CONFIRM");
    Wait(2);
    DoReact("GRAY","1","ARM");
]
}