Promotic
WikipediaLinkedInYoutubeTwitterFacebook

Pm - method of object PmaObject

Description:
Returns reference to the Pma object or to its implementation subobject.
Syntax:
Object Pm(String sPath, [Long nAttr])
Calling:
obj = oObject.Pm(sPath)
Parameters:
sPath(String) Relative or absolute path to the Pma object in the tree of Pma objects (case sensitive text).

The path describes the location of the object in the tree of Pma objects. Each tree level adress is separated by the / character. The immersed Pma object is referrenced by its name. The superior Pma object is referrenced by .. characters. The immersed implementation subobject (other than PmaObject type) is referrenced by # character, followed by the implementation subobject type definition (e.g. #vars). It means that the # addressing leaves the Pma objects tree (created by user) and starts to address the implementation subobjects of the Pma object. For example "/appdata/data/#vars/Temperature".

nAttr[optional] (Long) enables to change the behavior of the function.
0 (default) - default behavior.
1 - when referencing the non-existent object the global error in the INFO system won't be generated.
Note:

By this method it is possible to get the reference to the defined object relative to the object over which the method is called. The full path (the absolute path) needn't be entered in the sPath parameter but the relative path can be entered. The relative path is entered without the initial slash (/). If it is required to refer to the parent object, then two points can be entered (as it is customary for example by entering the relative path to files in the OS Windows).

If the path defined by the sPath parameter begins with the slash (/), then the path is regarded as the absolute path, i.e. the path is defined relative to the root object of the application - relative to the PmaRoot object.

 
Identifier #vars: The reference to PmVar object can also be done directly by extending the path of the Pm method by means of the #vars identifier. This identifier can be used e.g. for the Pm method, or for the PP data binding in the application and in panels. For example the method Pm("/data/#vars/Temperature) returns the "Temperature" variable (PmVar) in the "data" object(PmaData).
 
Identifier #ext: References to Data extensions objects in the PmVar variable can also be done directly by extending the path of the Pm method using the #ext identifier. This can be used in the Pm method or in PP binding in the application and in panels. For example the method pMe.Pm("/data/#vars/Temperature/#ext/al") returns the data extension with al identifier (ExtAlarmAnalog) in the "Temperature" variable (PmVar) in the "data" object (PmaData).
 
In order to create the variable of the Object type containing reference to Pma object in the tree of Pma objects or its implementation subobject. See also: #pragma variable x = PmaObjectRef("path").
Example:
JavaScriptVBScriptSelect and copy to clipboard

//Obtains the reference to the Pma object by the absolute path:
o = oObject.Pm("/Boiler1/Temperature");

//Obtains the reference by the relative path. The object will be searched on the same level of the objects tree as the object over which the method is called:
o = oObject.Pm("../Temperature");

//Obtains the reference by the relative path. The object will be searched among subobjects of the object over which the method is called:
o = oObject.Pm("Temperature");

//Obtains the reference to the PmVar subobject of the PmaData object:
oVar = pMe.Pm("/Boiler1/Data/#vars/Temperature");

//Detects the existence of the object (possible error won't be generated in the INFO system):
o = oObject.Pm("/Boiler1/Temperature", 1);
if (o)
//...
PROMOTIC 9.0.6 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice