Add Method (StateSets collection)

               

 

Creates a StateSet collection and attaches it to the current StateSets collection. Returns a reference to the created StateSet object. The new StateSet is created on the Server as well as added to the memory representation of the collection.

 

Syntax

object.Add SetName, saStates

The Add method syntax has these parts:

Part

Description

object

An object expression that evaluates to a StateSets collection.

SetName

A string containing the new StateSet name. Must be unique to the server.

saStates

An array of strings which represent the digital states which comprise the new StateSet. The array should be dimensioned from 0 to one less than the number of elements passed. (for example dim saStates (0 to 7) would contain 8 strings. The array elements should be in the order desired. Codes will be assigned to the states in the order passed.

 

Remarks

Adding StateSet collections is typically done when configuring a new interface that needs to send a unique set of digital states to PIPoints.

 

Trappable Errors

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

Error

Description

pseLOADSTATESETS

Unable to load the existing collection of StateSets from the server.

pseDUPSTATESET

The named StateSet already exists on the server.

pseNOGENSERVER

The underlying server abstraction layer could not be accessed.

pseADDSTATESET

Unable to add the StateSet to the server. The error description typically contains more information.

Enabling Operational Intelligence