Load Method (PIValues collection)

               

 

Load a PIValues collection with passed arrays of values, times and ValueAttributes

 

Syntax

object.Load count, Values, Times, valAttribs

The Load method syntax has these parts:

Part

Description

object

An object expression that evaluates to a PIValues collection.

count

The number of values in the passed arrays.

Values

A SAFEARRAY of variants containing the values to be loaded. See settings below.

Times

A SAFEARRAY of variants containing the times to be loaded.  See settings below.

valAttribs

A SAFEARRAY of NamedValues collections containing the ValueAttributes to be loaded.   See settings below.

 

Settings

The possible values in the variants for Values are:

Setting

Description

VT_R4,VT_R8,VT_I2, VT_I4

A Variant containing a numeric value.

VT_BSTR

A Variant containing a string.

VT_DISPATCH, VT_UNKNOWN

A Variant containing a reference to a DigitalState object.

 

The possible values in the variants for Times are:

Setting

Description

VT_BSTR

A Variant containing a time/date string (currently in Microsoft formats)

VT_DATE

A Variant containing a DATE representing a local date on the current system

VT_R4,VT_R8,VT_I2, VT_I4

A Variant containing a number representing seconds since 1970 UTC.

VT_DISPATCH, VT_UNKNOWN

A Variant containing a reference to a PITime object

 

The possible NamedValue objects in the ValueAttributes NamedValues collection in each array member of the valAttribs argument are currently booleans.  The presence of the Name indicates the boolean is set. The value is ignored.  The recognized names are:

Setting

Description

Annotated

The value has been annotated.

Questionable

There is some question as to the validity of the value.

Substituted

The original value has been replaced.

 

Remarks

Members of the three arrays members must be ordered in parallel so that the nth element of the arrays correspond with each other.

 

Trappable Errors

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

Error

Description

psePIVALUESREADONLY

The PIValues collection is set to ReadOnly.

pseBADARRAYDIM

One or more of the passed arrays dimensions do not match the passed count.

psePIVALLOAD

Failed to load the passed data.  See the error object description field for more information.

Enabling Operational Intelligence