- In Solution Explorer, Right Click The AdvancedHMI project and select Add->Form (Windows Form)
- Name the form to something like Popup, then click Add
- Right click the form and slect View Code
- Copy this code:
'*******************************************************************************
'* Stop polling when the form is not visible in order to reduce communications
'* Copy this section of code to every new form created
'*******************************************************************************
Private NotFirstShow As Boolean
Private Sub Form_VisibleChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.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
End Sub
- On the MainForm, add a DataSubscriber
- Set PLCAddressValue to the bit that will trigger the popup
- Double click the DataSubscriber
- Enter this code:
If String.CompareOrdinal(e.Values(0), "True", True) = 0 Then
Popup.Show()
Else
Popup.Hide()
End If