Author Topic: IP traffic with multiple windows forms  (Read 845 times)

GraemeTownsend

  • Newbie
  • *
  • Posts: 29
    • View Profile
IP traffic with multiple windows forms
« on: March 28, 2017, 01:05:37 AM »
Hi,

I'm looking at a project with potentially a lot of I/O. I am building the HMI to have several Windows forms that I Show/Hide to manage the layout.

Question:
- Will the Basic Labels and Indicators continue to poll the PLC(s) even when not visible?

Cheers,
Graeme.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5260
    • View Profile
    • AdvancedHMI
Re: IP traffic with multiple windows forms
« Reply #1 on: March 28, 2017, 05:46:53 AM »
It depends. If you copy the following code snippet to each form, they wil not:
Code: [Select]
    '*******************************************************************************
    '* 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 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
    End Sub

GraemeTownsend

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: IP traffic with multiple windows forms
« Reply #2 on: March 28, 2017, 06:52:34 PM »
Thanks Archie.