Go to documentation repository
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:
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."); }