Documentation for Axxon PSIM 1.0.0-1.0.1.

Previous page The SetObjectParam method  The DebugLogString method Next page


The SetObjectState method changes the state of objects.

Syntax for method invocation:

function SetObjectState(objtype : String, id : String, state : String)

Method arguments:

  1. objtype is a required argument. It corresponds to the type of system object, the state of which you want to change. 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.
  3. state is a required argument. It corresponds to the state to which you want to switch the object. Possible values: String type, range is limited by the states available for this object.

Example. Check if camera 1 is armed every hour. If camera 1 is disarmed, arm it.

Note

You must create the Timer object with identification number 1 beforehand. Set the Minutes parameter of the Timer object to 30. The timer will go off every hour, for example, 09:30, 10:30, 11:30, and so on.

if (Event.SourceType == "TIMER" && Event.SourceId == "1" && Event.Action == "TRIGGER")
{
 if (GetObjectState("CAM", "1") == "DISARMED")
 {
 SetObjectState("CAM", "1", "ARMED");
 }
}