Go to documentation repository
Page History
The GetObjectState method returns the state of the object at the moment of method callinvocation.Method call syntax
Syntax for method invocation:
Code Block | ||
---|---|---|
| ||
function GetObjectState(objtype : String, id : String) : String |
Method arguments:
- objtype - Required is a required argument. The It specifies the type of the system object whose which state is you want to be returned. It takes the following get. Possible values: Type – String type, range – existing is limited by object types registered in the system.
- id - Required is a required argument. Identification It corresponds to the identification (registration) 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 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.
Usage examples
ProblemExample. When Relay relay 1 activates is enabled (for example, on pressing the button connected to Relay the relay 1), arm Sensor sensor 1. The next time Relay the relay 1 activatesis enabled, disarm Sensor 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 object types can have several states at the same time. For example: ATTACHED|DISSOLVED DISARMED or ADDEDATTACHED|OFFDISARMED|RECORDER_ON|RECORDRECORDING. |
Overview
Content Tools