Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - t.pal

Pages: [1]
1
Support Questions / Re: AlarmSubscriber, getting info from Item Collection
« on: February 06, 2016, 08:17:10 PM »
Right, thanks!

2
Support Questions / Re: AlarmSubscriber, getting info from Item Collection
« on: February 06, 2016, 06:36:44 PM »
Got it. Thanks!

Code: [Select]
For i = 0 To Me.PLCAddressValueItems.Count
                    If Me.PLCAddressValueItems.Item(i).PLCAddress = e.PlcAddress Then
                        MsgBox(Me.PLCAddressValueItems.Item(i).PLCAddressDesc)
                        Exit For
                    End If
                Next i

3
Support Questions / Re: AlarmSubscriber, getting info from Item Collection
« on: February 06, 2016, 06:33:41 PM »
Thanks for the Super Quick reply. I have the property added, just working on matching to PlcAddress. Halfway there.

4
Support Questions / AlarmSubscriber, getting info from Item Collection
« on: February 06, 2016, 05:24:03 PM »
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:
Code: [Select]
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.

Pages: [1]