The technique I use for sending the current screen to the PLC is this:
- Each form has a Tag property. I set that property for each form to the number I want to go to the PLC
- In the code behind the MainForm is a default piece of code. Modify the code like this:
Private Sub Form_VisibleChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.VisibleChanged
'* Do not start comms on first show in case it was set to disable in design mode
If NotFirstShow Then
AdvancedHMIDrivers.Utilities.StopComsOnHidden(components, Me)
Else
NotFirstShow = True
End If
Try
If Me.Tag IsNot Nothing AndAlso Me.Tag <> "" Then
EthernetIPforCLXCom1.Write("ScreenNuberTag", Me.Tag)
End If
Catch ex As Exception
End Try
End Sub