Documentation for Axxon PSIM 1.0.0-1.0.1.

Previous page The GetObjectParentId method  The GetObjectParentType method Next page


The GetObjectState method returns the state of the object at the moment of method invocation.

Syntax for method invocation:

function GetObjectState(objtype : String, id : String) : String

Method arguments:

  1. objtype is a required argument. It specifies the type of the system object which state you want to get. Possible values: String type, range is limited by object types registered in the system.
  2. id is a required argument. It corresponds to the identification (registration) number of the object specified by the objtype argument. Possible values: String type, the range is limited by the identification numbers of objects of the specified type registered in the system.

Example. When relay 1 is enabled (for example, on pressing the button connected to the relay 1), arm sensor 1. The next time the relay 1 is enabled, disarm sensor 1.

 if (Event.SourceType == "GRELE" && Event.SourceId == "1" && Event.Action == "ON")
{
 if(GetObjectState("GRAY", "1")=="DISARM")
 {
 SetObjectState("GRAY", "1", "ARM");
 }
 else
 {
 SetObjectState("GRAY", "1", "DISARM");
 }
}

Note

Some object types can have several states at the same time. For example: ATTACHED|DISARMED or ATTACHED|DISARMED|RECORDER_ON|RECORDING.