Item Property (PIAliasList2 object)



The Item property retrieves a PIAlias from the collection by name or by position in the collection. The property is Read-Only.




The Item property syntax has these parts:




An object expression that evaluates to a PIAliasList2 object.


An expression that specifies a member of the collection, as described in Settings.



The settings for index are:


Description (collections implementing setting)

position number

Specifies the position number of a member of the collection. Must range from 1 to the value of the collection's Count property. (See Remarks for specifics.).


Specifies a collection member by name. Must be equal to the Name property of a member of the collection. (See Remarks for specifics.).



The Item property is the default property of the collection, so these expressions have the same meaning:



The position number of a collection member may change as new members are added.


PIAliasList2 collections allow PIAlias's with the same name to be inserted. Even PIAlias's with the same name from different values of the same PIModule are allowed. The items are sorted by the following string (only used internally):




    PIAliasName – The Name property of the PIAlias object.

    ParentModuleUniqueID – The UniqueID of the parent PIModule expressed as a string

    ParentModuleEffectiveDateUTCSeconds – The EffectiveDate of the parent PIModule expressed as a string of the UTCSeconds of that PITime


This means that PIAlias's in the list are in name order regardless of which PIModule they are associated with. For PIAlias's of different values of a PIModule (same UniqueID), the are stored in the order of the EffecitveDate (low to high UTC seconds) of their parent PIModule's value.


If you use the GetItemWithAlias method of PIAliasList2, you can get the index number of an item retrieved by name. You can then increment that index to find other items with the same PIAlias.Name.



Enabling Operational Intelligence