AdvancedHMI Software
General Category => Support Questions => Topic started by: Joe Matkowski on October 20, 2015, 04:06:15 PM
-
I am using clx driver with ver3.99a and trying to read a real array[10] with datasubscriber2 but cannot seem to get the code correct to read anything past element
Private Sub DataSubscriber21_DataChanged(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles DataSubscriber21.DataChanged
blSilo1.Value = e.Values(0)
BarLevel1.Value = e.Values(0, 1)
End Sub
-
Private Sub DataSubscriber21_DataChanged(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles DataSubscriber21.DataChanged
blSilo1.Value = e.Values(0)
BarLevel1.Value = e.Values(1)
End Sub
-
So I should just add each element of the array as a member in the collection?
I assigned member 0 "myarray" 10 elements. So I was expecting to be able to pull the entire array something like member 0 element 1,2,3
Thanks for your help
Jody
-
If you add the starting element and the number of elements, then the DataReturned event will fire and return an array of e.values.
If you use the DataChanged event handler, it may only fire if the first element changes value.
So let's say you subscribe to MyArray[0] with 10 elements. The DataReturned event will fire at the PollRateOverride interval and return 10 values, e.values(0) through e.values(9)
-
Got it thanks Archie. Thats what I was looking for.