Add Method (PIPoints collection)

                 

 

The Add method creates a new PIPoint object and adds it to the collection. The method also creates a corresponding PI point on the collection’s parent Server.  It returns a reference to the newly created PIPoint object.

 

Syntax

object.Add Tagname, PointClass, PointType, [nvAttrs]

The Add method syntax has these parts:

Part

Description

object

An object expression that evaluates to a PIPoints object.

Tagname

A string expression which will become the name of the newly added PIPoint.

PointClass

A string expression which will become the point class of the newly added PIPoint.

PointType

A value from the PointTypeConstants enumeration, which will become the point type of the newly added PI point.

nvAttrs

A NamedValues collection containing NamedValue objects whose name property represents an attribute and whose value property is a variant representing the desired value for the attribute. [Optional]

 

Remarks

The tagname must be distinct from the name of any point already existing on the server, and must follow the naming rules that apply to the particular server.  Not all point types are supported on all servers. To find out what types of points may be created on your server, see your server documentation. This method is not supported on all servers.

 

To add multiple tags at once, use the IPIPoints2.AddTags method.

 

Trappable Errors

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

Error

Description

pseNOEMPTYSTRINGS

An empty string or only blanks was passed for a required argument.

pseINVALIDCLASSNAME

The point class name passed does not represent a point class on the server.

pseACCESSDENIED

Insufficient privileges to create an attribute set.

pseATTRSETRETRIEVE

Unable to retrieve existing attribute sets from server.

pseNOSERVERSUPPORT

Server does not support the operation

pseINVALIDPOINTTYPE

The passed point type is not recognized as valid on this server.

psePOINTCREATE

Failed to create the point on the server.  See the error description string for more information.

pseINVALIDTAGNAME

The passed tag name was found invalid for this server.

Enabling Operational Intelligence