I'm currently working on a way to read multiple PLC Addresses in a single call as opposed to individually stating each Address (because I have a lot of addresses to read). The code I have so far looks like this: Inside a ButtonClick trigger I have the driver read the addresses and create the array
For x As Integer = 1 To 120
EthernetIPforMicro800Com1.BeginRead("DAQThermocouple[" & x.ToString & "].in1", 120)
EthernetIPforMicro800Com1.BeginRead("DAQThermocouple[" & x.ToString & "].in2", 120)
EthernetIPforMicro800Com1.BeginRead("DAQThermocouple[" & x.ToString & "].in3", 120)
EthernetIPforMicro800Com1.BeginRead("DAQThermocouple[" & x.ToString & "].out1", 120)
EthernetIPforMicro800Com1.BeginRead("DAQThermocouple[" & x.ToString & "].out2", 120)
EthernetIPforMicro800Com1.BeginRead("DAQThermocouple[" & x.ToString & "].out3", 120)
Next
Then when data is received I use this piece of code
Private Sub EthernetIPforMicro800Com1_DataReceived(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles EthernetIPforMicro800Com1.DataReceived
For x As Integer = 1 To 120
If e.PlcAddress = "DAQThermocouple[" & x.ToString & "].in1 " Then
For index As Integer = 0 To 119
CalDataToLog(index) = e.Values(index)
Next
End If
If e.PlcAddress = "DAQThermocouple[" & x.ToString & "].in2" Then
For index As Integer = 131 To 250
CalDataToLog(index) = e.Values(index)
Next
End If
If e.PlcAddress = "DAQThermocouple[" & x.ToString & "].in3" Then
For index As Integer = 262 To 381
CalDataToLog(index) = e.Values(index)
Next
End If
If e.PlcAddress = "DAQThermocouple[" & x.ToString & "].out1" Then
For index As Integer = 393 To 512
CalDataToLog(index) = e.Values(index)
Next
End If
If e.PlcAddress = "DAQThermocouple[" & x.ToString & "].out2" Then
For index As Integer = 524 To 643
CalDataToLog(index) = e.Values(index)
Next
End If
If e.PlcAddress = "DAQThermocouple[" & x.ToString & "].out3" Then
For index As Integer = 655 To 774
CalDataToLog(index) = e.Values(index)
Next
End If
Next
End Sub
None of this actually catches the data though. I think it may be a problem with reading the PLC Addresses initially but I'm not sure.
Thanks in advance for any advice or help