Documentation for Axxon PSIM 1.0.0-1.0.1.

Previous page Next page


You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Current »

The GetObjectName method returns the name of the object that it was given upon creation.

Method call syntax

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

Method arguments:

  1. objtype – Required argument. The type of the object whose name is to be returned. It takes the following values:  Type – String, range – existing object types.
  2. id – Required argument. Identification number of the object of the type set in the objtype parameter. It takes the following values: Type – String, range – existing object identification numbers of the specified type.

Usage examples

Problem. In case of alarm in any sensor, open the information window with the following text: "Alarm in the <alarmed sensor name> sensor connected to the <server name which the sensor is connected to> server”.

Note

Create the information dialog window beforehand using the Arpedit.exe utility and save it as test.dlg in the <Axxon PSIM>\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."); 
}
  • No labels