First Off, Amazing software. I'm newISH to vb.net so forgive my ignorance.
What I've done is modified a DataSubscriber to function as an alarming tool. It performs certain actions (email, SMS, log alarms to text file, record camera etc) on change of various bit values. What I am having trouble with is being able to send a description of the bit that has alarmed without hard coding a description for each address.
So far I have added a plcAddressDesc property to the PLCaddressValueItems collection in the "AlarmSubscriber" Component I've created
I'm using some code you posted:
Private Sub AlarmSubscriber1_DataChanged_1(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles Me.DataChanged
'* Make sure Data came back
If e.Values IsNot Nothing AndAlso e.Values.Count > 0 Then
'* Did it come back as True or 1?
If String.Compare(e.Values(0), "TRUE", True) = 0 Or e.Values(0) = "1" Then
MsgBox(e.PlcAddress)
End If
End If
End Sub
What I was hoping to do was be able to use "e.PlcAddressDesc" to get the alarm description. Maybe this is the wrong way of going about it? To do this I think I need to add it to PlcComEventArgs. I don't see the ability to edit this.Maybe there is another way like matching the PlcAddress? Even If I could get the item (memeber) number from the collection to the get the Description property.
I've played around with a few different things.... e.values.item.... etc. Can't seem to find an identifier.
Any help would be greatly appreciated.
Thanks
Update:
I should also note, I am going to store additional info in the item properties, to control which notifications/alarms to trigger. So having access to these properties would be important.