Author Topic: More graphics on a page the slower the feedback  (Read 683 times)

kyone

  • Newbie
  • *
  • Posts: 2
    • View Profile
More graphics on a page the slower the feedback
« on: April 24, 2021, 09:36:20 PM »
I have read a few other discussions but not sure if they relate to my issue.

I have two pages (Visual studio 2019 talking Modbus/TCP to a Productivity 1000 PLC) one page (Page 1) has one button (Light 1 ON/OFF) and the second page (Page 2) has 20 buttons, the first button being the same as the button on page one (Light 1 ON/OFF).  Both pages the button responds as expected to the PLC the difference being that on Page 1 the button ON/OFF feedback (Green luminated light) is instant while on Page 2 it can take a few seconds.

I edited Page 2 by simply drawing one big black box over all of the graphics except the first button and found that it responds as quick as page one.  So that rules out anything to do with the PLC.

Connected via Ethernet or Wifi doesn't make a difference.  I have run the application on both slow and fast computers and it does not seem to make any difference.

Is there anything I can do to try and speed up the button ON/OFF feedback when there are lots of buttons on a page ?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5269
    • View Profile
    • AdvancedHMI
Re: More graphics on a page the slower the feedback
« Reply #1 on: April 24, 2021, 09:52:40 PM »
Have you copied the code from the MainForm onto page 2?
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 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

kyone

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: More graphics on a page the slower the feedback
« Reply #2 on: April 25, 2021, 01:17:51 AM »
Have you copied the code from the MainForm onto page 2?

I had not done that.. I have never looked at the vb code I only use AdvancedHMI graphically.  It seems obvious now. 

This change has appeared to have sped things up, thanks.

Should I also copy over the ".NET does not close..." code from the MainForm to the other forms ?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5269
    • View Profile
    • AdvancedHMI
Re: More graphics on a page the slower the feedback
« Reply #3 on: April 25, 2021, 08:43:01 AM »
Should I also copy over the ".NET does not close..." code from the MainForm to the other forms ?
This code should only exist on the main form or the last form to close when exiting an application. As a rule, I make sure secondary forms cannot be closed (only navigated away from) which requires going back to the main form to exit the application.