Documentation for Monitoring PSIM 1.0 (english)

Previous page Sample script for setting custom filter in the Log panel  Sample scripts for processing alarm confirmations Next page

If you want for a JPEG still frame to be attached to an alarm message or video fragment when a sensor is activated (Sensor object), remember that this is possible only after the current archive file has been written to disk. To reduce the waiting time (the Delay (sec.) parameter, see the section Configuring sensors) and be assured of camera recording, you can create a Program object on the Programming tab of Axxon PSIM software package.

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

Attention!

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:

OnEvent("GRAY","1","ALARM")
{
[
    if( !CheckState("CAM","1","DETACHED") )
    {
        DoReact("CAM","1","REC","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:

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:

OnEvent("GRAY","1","ALARM")
{
[
    if( !CheckState("CAM","1","DETACHED") )
    {
        Wait(5); // Specifies the time after which the recording should be stopped in order to get the required video fragment or number of frames
        DoReact("CAM","1","REC_STOP","priority<2>");
        Sleep(2050); // Prerecording time in the Camera settings = 2 sec.
        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");
]
}