Versions Compared

Key

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

...

The GRAY object sends events presented in the table.   Procedure is started when the corresponding event appears.

Format of events procedure for the sensor:

Code Block
OnEvent("GRAY","_id_","_event_")

 

occurs.

...

Event

Event description

ALARM

Event

Description

"ALARM"

Alarm. This event is received

while opening or closing

when the sensor is opened or closed (it depends on object settings) if sensor is armed. If sensor is disarmed, then Sensor opened and Sensor closed events are received

correspondingly.

respectively

"

ARM

"

Sensor is armed

.

"

CONFIRM

"

Alarm received

.

"

DISARM

"

Sensor is disarmed

.

"

NOT_VALID_STATE

"

Zone is not ready

.

"

OFF

"

Sensor is opened. This event is received

while

when the sensor

opening

is opened if the sensor is disarmed

.

"

ON

"

Sensor is closed. This event is received

while sensor closing if

when the sensor is closed if the sensor is disarmed

.

"

SIGNAL_LOST

"

Connection with the sensor is lost

Operator format to describe actions with the sensor is:

...

List of commands and parameters for the the GRAY object is presented in the following table:

Commandcommand description

Parameters

Description

"ARM"

arm the sensor

.

-

-

"DISARM"

disarm the sensor

.

-

-

“CONFIRM”

confirm an alarm

.

-

-

“SETUP”

settings for the sensor

.

chan<>

Output number (

0 – 15

0–15)

.

flags<>

Flags

.

name<>

Object name

.

type<>

Type of sensor object (0

on closing, 1

on opening)

.

Properties of the GRAY object are shown in the table.

Properties of the GRAY object

Description of properties

ID<>

Object ID

.

PARENT_ID<>

Parent object ID

.

REGION_ID<>

Region ID

.

Check function of the GRAY object state:

 

Code Block
CheckState ("GRAY","number","state")

 

The GRAY object The GRAY object can be in the following states:

State of the GRAY object

State description

"ARMED"

Sensor is armed

.

"DISARME"”

Sensor is disarmed

.

"ALARMED"

Alarm

.

"CONFIRMED"

Alarm confirmed

.

"DISARMED_ALARM"

Not ready

.

"DETACHED_ARMED"

Connection lost

.

when the sensor was armed

"DETACHED_DISARM"

Connection lost

.

when the sensor was disarmed

“OFF”

Normal

.

 Examples of using events and reactions of the Sensor object:

  1. It is required to switch over the second sensor to the second input if connection with the first sensor is lost.

    Code Block
    OnEvent("GRAY","1"," SIGNAL_LOST") //connection with first sensor is losst
    {
     DoReact("GRAY","2","SETUP","chan<2>"); //sensor is on the second input
    }
  2. Open the second sensor and enable the rollback record of the first video camera in case of the first sensor is closed.

    Code Block
    OnEvent("GRAY","1"," ON") //first sensor is closed
    {
     DoReact("GRAY","2","SETUP","type<1>"); //open the second sensor
     DoReact("CAM","1","REC","rollback<1>");//perform rollback record from the first video camera
    }

...