Promotic
WikipediaLinkedInYoutubeTwitterFacebook

Pm - method of object PmiItem

Description:
The method returns a reference (value of data type Object) to the Promotic object located in the application tree.

This method is obsolete (but functional) and it is better to replace it by calling panel method (pMe.PmPanel.Methods).

Syntax:
Pm(sPath As String, [nAttr As Long]) As Object
Calling:
Set o = oItem.Pm(sPath)
Parameters:
sPath(String) Relative or absolute path to the Promotic object in the application tree or to its subobject (case sensitive text).

The path describes the location of the object in the tree structure. Each tree level adress is separated by the / character. The immersed Promotic object is referrenced by its name. The superior Promotic object is referrenced by .. characters. The immersed implementation subobject (other than PmObject type) is referrenced by # character, followed by the implementation subobject type definition (e.g. #vars). It means that, the # addressing leaves the Promotic application object tree (created by user) and starts to address the implementation subobjects of the PROMOTIC 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-existing object, the global error won't be generated in the INFO system.
Note:

When the path (sPath parameter) doesn't begin with a slash, then it represents the relative path. Then the reference is got relative to the PmPanel object where the graphic item (where the script is called) is placed.

When the path begins with a slash, then it represents the absolute path. Then the reference is got by absolute addressing relative to the root object of the application tree - which means relative to the PmRoot object.

For more detailed explanation of the absolute and relative path see the PmObject.Pm method.

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

This method is not functional for Web Panels.

This method is no longer functional if the Level of integration of panel viewer and the local application configurator is set to value client - LIMITED access from scripts to the PmPanel object and Pm object.

Example:
Returns a reference by the absolute path:
Set oTemp = oItem.Pm("/Boiler1/Temperature")
Returns a reference by the relative path. The object will be searched on the same level in the objects tree as the PmPanel object where the graphic item, over which the method is called, is placed:
Set oTemp = oItem.Pm("../Temperature")
Getting the reference to the Var subobject of the PmData object:
Set oVar = pMe.Pm("/Boiler1/Data/#vars/Temperature")
Getting the existence of the particular object (possible error won't be generated in the INFO system):
If Not oItem.Pm("/Boiler1/Temperature", 1) Is Nothing Then
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice