GetMDBObject Method (IPISDK2 Interface)

                    

 

Returns a Module Database (PIModule, PIAlias, PIProperty) object from the passed path name, specified in full path format (for example \\MyServer\MyModule).

  

Syntax

object.GetMDBObject MDBObjectPathname, varQueryDate

The GetMDBObject method syntax has these parts:

Part

Description

object

An object expression that evaluates to a IPISDK2 object.

MDBObjectPathname

A string containing a fully qualified pathname of the format \\ServerName\ObjectPathname

varQueryDate

VARIANT representing the time. The VARIANT may be a PITime, a String, or numeric. Interpretation of strings and numerics is consistent with PITime's interpretation.

 

Trappable Errors

In addition to generic errors (such as Out of Memory), the following errors may occur:

Error

Description

pseINVALIDMDBOBJPATHNAME

Invalid pathname.

pseMDBOBJPATHNAMEEMPTY

Empty pathname.

pseINVALIDMDBOBJPATHNAME

Invalid pathname.

pseMDBOBJPATHNAMESERVERNOTFOUND

Server not found using pathname.

pseMODNOTFOUNDMDBOBJPATHNAME

PIModule not found using pathname.

pseALIASNOTFOUNDMDBOBJPATHNAME

PIAlias not found using pathname.

psePROPNOTFOUNDMDBOBJPATHNAME

PIProperty not found using pathname.

 

Remarks

Because the names of objects can change, you should use the persistence string to save an object reference if possible. The persistence string can be used to retrieve many objects even if its name or the names of other objects in the pathname have changed.

If you use the pathname, the change of any name in the path makes the object irretrievable. In the case of PIModule's, the pathname can be different at different QueryDate's. This makes the use the pathname to retrieve modules and other objects very fragile.

 

Using the pathname is slower than using the persistence string to retrieve an object. The more objects in the pathname, the slower it will be. The more objects in a collection the pathname traverses, the slower it will be.

 

ServerName

The first part of the pathname is the name of the Server. It is preceded by two backslashes (\\) and followed by one.

            \\ServerName\

The rest of the pathname follows the trailing backslash.

 

PIModule

PIModule’s are in a hierarchy so the pathname for a PIModule includes all of the names of its parents:

\\ServerName\modulename\modulename\...\modulename

NOTE: A PIModule can have more than one parent and thus more than one pathname. No pathname is preferred by the database over any other one.

IMPORTANT: The pathname of a PIModule can be different at different times in history. This is one of the key features of the PI Module Database. The varQueryDate argument is used to retrieve the proper value of each module in the path.

 

PIModule UniqueID

PIModule’s may also be retrieved by specifying the server and the UniqueID of the module:

\\ServerName\{5c64c379-c182-4f35-8d30-78d8c2f84501}

where:
    5c64c379-c182-4f35-8d30-78d8c2f84501
is an example of a module UniqueID.
 

NOTE: The module's UniqueID must be contained with curly brackets:  {}.

 

IMPORTANT: Modules can have different values at different times in history. This is one of the key features of the PI Module Database. The varQueryDate argument is used to retrieve the proper value of the specified PIModule.
 

PIAlias

PIAlias’s are in a PIModule’s PIAliases collection. Their pathname starts out with the pathname of the parent PIModule followed by a single pipe character (|) and then the alias name:

\\ServerName\modulename\modulename\...\modulename|aliasname
 

PIProperty

PIProperty’s are in a PIModule’s PIPIProperty hierarchy. Their pathname starts out with the pathname of the parent PIModule followed by a double pipe character (||) and then the first property name. If the property is farther down the property hierarchy, single pipe characters (|) are used as delimiters:

\\ServerName\modulename\...\modulename||propertyname
\\ServerName\modulename\...\modulename||propertyname|...|propertyname

 

 

Enabling Operational Intelligence