Update cookies preferences
Promotic

Pm - method of the PmaObject object

Description:
Returns reference to the Pma object or to its implementation subobject.
Syntax:
Object Pm(String sPath, [Long nAttr])
Parameters:
sPath(String) Relative or absolute path to the Pma object in the Pma object tree (case sensitive text).
The path describes the location of the object in the Pma object tree. Each tree level adress is separated by the / character.
- The immersed Pma object is referenced by its name.
- The superior Pma object is referenced by .. characters.
- The immersed implementation subobject (other than PmaObject type) is referenced 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) allows to change the behavior of the function.
0 (default) - Default behavior.
1 - When referencing the non-existing object, the global error of the INFO system will not be generated.
Note:
By this method it can be obtained the reference to the defined object relative to the object over which this method is called. The full path (the absolute path) doesn't need to 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 Windows OS).
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 PmaData - Deatiled object description identifier. This identifier can be used e.g. in the Pm method, or in the "PP - Pma object property" data binding.
For example the method Pm("/data/#vars/Temperature) returns the "Temperature" variable (PmVar object) in the data object (PmaData object).
 
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 object).

In order to create the variable of the Object type containing reference to Pma object in the Pma object tree or its implementation subobject. See also: #pragma variable x = PmaObjectRef("path").
Example:
JavaScriptVBScriptSelect and copy to clipboard

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

// Returns 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");

// Returns 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");

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

// Detects the existence of the object (possible error will not be generated in the INFO system):
o = oObject.Pm("/Boiler1/Temperature", 1);
if (o)
{
// ...
}
PROMOTIC 9.0.31 SCADA system documentation MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r.o.