Go to documentation repository
Page History
GetObjectIds method is responsible for receiving identifiers from all the objects of a specified type.
Method call syntaxSyntax for method invocation:
| Code Block | ||
|---|---|---|
| ||
function GetObjectIds(objectType : String) |
Method arguments:
- objectType is a required argument. It specifies the type of the system object for which you want to return the value of the specified parameter (CAM, GRAY, GRABBER, and so on). Possible values: String type, range is limited by object types registered in the system.
A line string is replied returned:
CAM||COUNT|id.3<5>,id.count<4>,id.0<2>,id.1<3>,id.2<4>
where id
- id.count<>
...
- is a number of
...
- objects IDs,
...
- id.[
...
- number]<> is an object ID.
Example. On Macro 1, all cameras must be armed
...
Method’s arguments:
objectType –required argument. Set the type of the system object, for which the value of the given parameter should be given back ("CAM","GRAY","GRABBER" e.t.c.).Accepted values: type String, range is restricted by object types registered in the system.
Example. All the cameras should be armed upon the start of Macros№1.
| Code Block | ||
|---|---|---|
| ||
if (Event.SourceType == "MACRO" && Event.SourceId && Event.Action == "RUN")
{
var msg = CreateMsg();
msg.StringToMsg(GetObjectIds("CAM"));
var objCount = msg.GetParam("id.count");
var i;
for(i = 0; i < objCount; i++)
{
DoReactStr("CAM", msg.GetParam("id." + i), "ARM", "");
}
} |
Overview
Content Tools