Documentation for Axxon PSIM 1.0.0-1.0.1.

Previous page The GetObject methods  The GetObjectParam method Next page


The GetObjectName method returns the name of the object that it was given during registration in the program.

Syntax for method invocation:

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

Method arguments:

  1. objtype is a required argument. It specifies the system type of the object which name 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. On alarm in any sensor, open the information window with the following text: "Alarm in the <alarmed sensor name>. Sensor connected to the Server <name of the section to which the sensor is connected>”.

Note

You must create the information dialog window beforehand using the Arpedit.exe utility and save it in the test.dlg file in the <Axxon PSIM installation directory>\Program folder.

if (Event.SourceType == "GRAY" && Event.Action == "ALARM")
{
 var grayid = Event.SourceId;
 var grayname = GetObjectName("GRAY", grayid);
 var compname = GetObjectParentId("GRAY", grayid, "COMPUTER");
 DoReactStr("DIALOG", "test", "CLOSE_ALL","");
 DoReactStr("DIALOG", "test", "RUN","Alarm in the '" + grayname + "' sensor connected to the '" + compname + "' server."); 
}