Insert Method (PIValues collection)

         

 

Insert the passed PIValue object into the collection.

 

Syntax

object.Insert newValue

The Insert method syntax has these parts:

Part

Description

object

An object expression that evaluates to a PIValues collection.

newValue

A PIValue object to be inserted into the collection.

 

Remarks

The new PIValue object is inserted into the collection based on its timestamp so the resulting PIValues collection remains ordered by time.  Unlike the Add method which takes the components of a PIValue as arguments (Time, Value, ValueAttributes), creates a PIValue and adds it to the collection, this method takes a PIValue directly.

 

Trappable Errors

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

Error

Description

psePIVALUESREADONLY The collection is set to Read-Only.
pseBADVARIANTCOPY Unable to copy the Value from the passed PIValue object

Enabling Operational Intelligence