I am using VS 2015 community edition, Advanced HMI 3.99d, Windows 10 Pro. I am trying to subscribe two different tags to one AB MicroLogix controller and two different tags to one AB Compact logix controller. The problem is that the Event Handlers are not being triggered, when the data is changed. attached is my code. Any suggestions? Do any of you see something wrong with my code?
Private Sub MainForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim MicroComm As New EthernetIPforSLCMicroCom()
Dim CLXComm As New EthernetIPforCLXCom()
Try
'MicroLogix
MicroComm.IPAddress = "10.103.12.23"
MicroComm.PollRateOverride = 500
MicroComm.Subscribe("ST41:0", 1, 500, AddressOf MicroDataReturned)
MicroComm.Subscribe("F8:1", 1, 500, AddressOf MicroDataReturned)
'CompactLogix
CLXComm.IPAddress = "10.103.12.14" 'saves IP address into driver
CLXComm.PollRateOverride = 500 'everytime the driver gets data from PLC
CLXComm.Subscribe("CYCLE_COUNTER.CYCLE1", 1, 500, AddressOf CLXDataReturned)
CLXComm.Subscribe("Current_Recipe", 1, 500, AddressOf CLXDataReturned)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
Private Sub MicroDataReturned(ByVal sender As Object, ByVal e As Drivers.Common.PlcComEventArgs)
Try
If e.PlcAddress = "ST41:0" Then
Label2.Text = e.Values(0).ToString()
End If
If e.PlcAddress = "F8:1" Then
Label3.Text = e.Values(0).ToString()
End If
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
Private Sub CLXDataReturned(ByVal sender As Object, ByVal e As Drivers.Common.PlcComEventArgs)
Try
If e.PlcAddress = "CYCLE_COUNT.CYCLE1" Then
Label4.Text = e.Values(0).ToString()
End If
If e.PlcAddress = "Current_Recipe" Then
Label5.Text = e.Values(0).ToString()
End If
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub