Promotic

Pm - method of the PmgObject object

Description:
The method returns the Pma object located in the Pma objects tree.
This method is obsolete (but functional) and it is better to replace it by calling panel method (pMe.PmPanel.Methods).
Syntax:
Object Pm(String sPath, [Long nAttr])
Parameters:
sPath(String) Relative or absolute path to the Pma object in the Pma objects tree or to its subobject (case sensitive text).
The path describes the location of the object in the Pma objects tree. 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) It 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:
If the path (the sPath parameter) doesn't begin with a slash (/), then it represents the relative path. In this case the reference is got relative to the PmaPanel object where the Pmg object (where the script is called) is placed.
If the path begins with a slash, then it represents the absolute path. Then the reference is got by addressing relative to the root object in the Pma objects tree - i.e. relative to the PmaRoot object.
For more detailed explanation of the absolute and relative path see the PmaObject.Pm method.

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. in the Pm method, or in the "PP - Data binding to 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 objects tree or its implementation subobject. See also: #pragma variable x = PmaObjectRef("path").

This method is not functional in Web panels.
This method is no longer functional if the "Level of integration of the panel viewer and the local application" configurator is set to client - LIMITED access from scripts to the PmaPanel object and Pm object.
Example:
Returns reference by the absolute path:
VBScriptSelect and copy to clipboard

Dim oTemp
Set oTemp = pMe.Pm("/Boiler1/Temperature")
Returns reference by the relative path.
The object will be searched on the same level in the objects tree as the PmaPanel object where the Pmg object, over which the method is called, is placed:
VBScriptSelect and copy to clipboard

Dim oTemp
Set oTemp = pMe.Pm("../Temperature")
Returns reference to the PmVar subobject in the PmaData object:
VBScriptSelect and copy to clipboard

Dim oVar
Set oVar = pMe.Pm("/Boiler1/Data/#vars/Temperature")
PROMOTIC 9.0.27 SCADA system documentation MICROSYS, spol. s r.o.

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