1
Open Discussion / VB.NET DataReceived Not Working CLX Driver
« on: March 21, 2018, 10:43:04 AM »
I need to pull the data from the BeginReadMultiple values but cannot. Bellow is the code, what am doing wrong? Or is there another way to do this?
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Dim MyStr As String
Dim PLC1Read(10) As String
Dim PLC1 As New EthernetIPforCLXCom
PLC1.IPAddress = "192.168.1.8"
PLC1Read(0) = ("Cell1.PerfTrackReport.PLC1SinceLastResetHours")
PLC1Read(1) = ("Cell1.PerfTrackReport.PLC1SinceLastResetMinutes")
PLC1Read(2) = ("Cell1.PerfTrackReport.PLC1SinceLastResetSeconds")
PLC1Read(3) = ("AndOnBoard_DINT[1]") ' Idle Time Seconds
PLC1Read(4) = ("AndOnBoard_DINT[2]") ' Idle Time Minutes
PLC1Read(5) = ("AndOnBoard_DINT[3]") ' Idle Time Hours
PLC1Read(6) = ("AndOnBoard_Excel_DINT[6]") ' Hourly Count
PLC1Read(7) = ("AndOnBoard_Excel_DINT[7]") ' Shift Count
PLC1Read( = ("AndOnBoard_Excel_DINT[4]") ' Good Parts Count
PLC1Read(9) = ("AndOnBoard_Excel_DINT[5]") ' Bad Parts Count
PLC1Read(10) = ("AndOnBoard_Excel_REAL[1]") ' Average Cycle Time
PLC1Read(10) = ("AndOnBoard_Excel_REAL[2]") ' Last Cycle Time
PLC1.BeginReadMultiple(PLC1Read)
End Sub
Private Sub PLC1_DataReceived(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles EthernetIPforCLXCom1.DataReceived
MsgBox(e.PlcAddress & "=" & e.Values(0))
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Dim MyStr As String
Dim PLC1Read(10) As String
Dim PLC1 As New EthernetIPforCLXCom
PLC1.IPAddress = "192.168.1.8"
PLC1Read(0) = ("Cell1.PerfTrackReport.PLC1SinceLastResetHours")
PLC1Read(1) = ("Cell1.PerfTrackReport.PLC1SinceLastResetMinutes")
PLC1Read(2) = ("Cell1.PerfTrackReport.PLC1SinceLastResetSeconds")
PLC1Read(3) = ("AndOnBoard_DINT[1]") ' Idle Time Seconds
PLC1Read(4) = ("AndOnBoard_DINT[2]") ' Idle Time Minutes
PLC1Read(5) = ("AndOnBoard_DINT[3]") ' Idle Time Hours
PLC1Read(6) = ("AndOnBoard_Excel_DINT[6]") ' Hourly Count
PLC1Read(7) = ("AndOnBoard_Excel_DINT[7]") ' Shift Count
PLC1Read( = ("AndOnBoard_Excel_DINT[4]") ' Good Parts Count
PLC1Read(9) = ("AndOnBoard_Excel_DINT[5]") ' Bad Parts Count
PLC1Read(10) = ("AndOnBoard_Excel_REAL[1]") ' Average Cycle Time
PLC1Read(10) = ("AndOnBoard_Excel_REAL[2]") ' Last Cycle Time
PLC1.BeginReadMultiple(PLC1Read)
End Sub
Private Sub PLC1_DataReceived(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles EthernetIPforCLXCom1.DataReceived
MsgBox(e.PlcAddress & "=" & e.Values(0))
End Sub