Go to documentation repository
Page History
The GetObjectState method returns the state of the object at the moment of method call.
Method call syntax
Code Block | ||
---|---|---|
| ||
function GetObjectState(objtype : String, id : String) : String |
Method arguments:
- objtype - Required argument. The type of the object whose state is to be returned. It takes the following values: Type – String, range – existing object types.
- id - Required argument. Identification number of the object of the type set in the objtype argument. It takes the following values: Type – String, range – existing identification numbers of the objects of the specified type.
Usage examples
Problem. When Relay 1 activates (for example, on pressing the button connected to Relay 1), arm Sensor 1. The next time Relay 1 activates, disarm Sensor 1.
Code Block | ||
---|---|---|
| ||
if (Event.SourceType == "GRELE" && Event.SourceId == "1" && Event.Action == "ON") { if(GetObjectState("GRAY", "1")=="DISARM") { SetObjectState("GRAY", "1", "ARM"); } else { SetObjectState("GRAY", "1", "DISARM"); } } |
Info | ||
---|---|---|
| ||
Some objects have several states at the same time. For example: ATTACHED|DISSOLVED or ADDED|OFF|RECORDER_ON|RECORD |
Overview
Content Tools