I made an attemt to add the function in a ugly work-around way...
In Datasubscriber2:
'* We must pass the address as a property name so the subscriptionHandler doesn't confuse the next address as a change for the same property
If m_PLCAddressValueItems(index).NumberOfElements <= 1 Then
SubScriptions.SubscribeTo(m_PLCAddressValueItems(index).PLCAddress, AddressOf PolledDataReturned, m_PLCAddressValueItems(index).PLCAddress)
Else
For element = 1 To m_PLCAddressValueItems(index).NumberOfElements
SubScriptions.SubscribeTo(m_PLCAddressValueItems(index).PLCAddress & "[" & element & "]", AddressOf PolledDataReturned, m_PLCAddressValueItems(index).PLCAddress & "[" & element & "]")
Next
End If
But it doesn't work.
However, if I manually add all elements of the variable (Alarm.Temperr[1], Alarm.TempErr[2], etc] in the datasubscriber, I can use this in the datachanged event:
Select Case e.PlcAddress.Split("[")(0)
Case "ALARM.TEMPERR"
AlarmNum = e.PlcAddress.Split("[")(1).Trim(New Char() {"[", "]"}) - 1)
State = e.Values(0)
...
End Select
Would have been nice if the NumberOfElements were implemented....
Do you have suggestions of better ways to imlement this outside the closed dll? in subscription handler?
The subscription handler looked too advanced for me, that's why i tried to put it in DataSubscriber2