Insert Method (PIAliasList2 object)


Inserts a PIAlias into the list.



object.Insert PIAlias

The Insert method syntax has these parts:




An object expression that evaluates to a PIAliasList2 object.


Existing PIAlias to add to the list.



This method inserts an existing PIAlias into this list. The list is a local collection and does not affect any objects on the server.


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.


A PIAliasList collection will replace an existing item if another one with the same name is inserted.


Enabling Operational Intelligence