ModifyAttributes Method (PIAlias object)

             

 

The ModifyAttributes method changes the values of the passed attributes in the corresponding object on the Server.  The method provides a more efficient method to make multiple modifications then setting the attributes individually. Desired modifications are specified in the passed NamedValues collection where the each name is a property name and the value contains the new property value.

 

Syntax

object.ModifyAttributes nvsAttributes, hnvsErrors

  

The ModifyAttributes method syntax has these parts:

Part

Description

object

An object expression that evaluates to a PIAlias.

nvsAttributes

NamedValues collection of attribute names and new values used to modify the object.

hnvsErrors

NamedValues collection of errors returned if there are problems.

 

Trappable Errors

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

Error

Description

pseMODIFYATTRIBUTES

There was an error with ModifyAttributes. Check the errors (hnvsErrors) collection

 

Errors Collection Errors

Here are some of the errors that can be returned in the errors collection (hnvsErrors). The name of the NamedValue in the collection is the attribute name passed. The value is the error code:

Error

Description

pseATTRIBUTENOTVALID

The attribute name passed wasn't valid.

pseINVALIDNAME

Name of the object is invalid.

   

Example

There is a complete example of how to use ModifyAttributes for a PIModule in the PI-SDK area of the OSIsoft tech support web site. This example also shows how to add PIAlias's.

 

 

Enabling Operational Intelligence