YetAnotherForum
Welcome Guest Search | Active Topics | Log In | Register

Managing PI Alarms through PI SDK Options · View
ashyu
#1 Posted : Wednesday, November 10, 2010 1:48:12 PM
Rank: Newbie
Groups: Member

Joined: 11/10/2010
Posts: 2
I'm trying to write a user interface to manage some PI Alarms through PI SDK in VBA.

I've hit a bit of a roadblock when it comes to trying to modify the alarm test and action attributes. PI Alarms uses attributes in the point, Test1, Test2, Test3, and Test4 to store the condition tests for the alarm. I've gotten so far as to read the values of these attributes in my application, but PI SDK reports that these attributes are read-only, and therefore the SDK fails when it tries to modify the attributes, like this:

Code:

Dim nvs As NamedValues
Dim nvs2 As NamedValues
Dim tag As String
Set nvs = New NamedValues
Set nvs2 = New NamedValues
tag = TextBox1.Text
nvs.Add TextBox2.Text, TextBox3.Text

s.PIPoints(tag).PointAttributes.ModifyAttributes nvs, nvs2


This is just from a test form that I rigged up, where TextBox2 contains the name of the attribute (e.g. "test1") and TextBox3 contains the value to write (e.g. "LT(40)").

In this code, the ModifyAttributes call fails reporting that the attributes are read-only. If I get the Readonly property for PointAttributes, it reports that this point attribute set is indeed read-only.

Surely there should be some way to modify the test conditions for a PI Alarm point? I thought about using a reference point and hardcode the conditions, but this is not nearly as flexible as being able to work with the four individual alarm limits themselves.
Sponsor  
 

OSIsoft vCampus is a subscription-based, online offering that consists of providing everything people need to develop applications on the PI System.
We invite you to take a "tour" of the OSIsoft Virtual Campus - also feel free to consult the FAQ  or contact OSIsoft vCampus for more details.
ashyu
#2 Posted : Wednesday, November 10, 2010 3:44:57 PM
Rank: Newbie
Groups: Member

Joined: 11/10/2010
Posts: 2
Ah, I think I've figured it out. It turns out that the ReadOnly property is not read-only itself. Setting it to False allows me to write the attributes.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.