Author Topic: Form load on startup  (Read 3726 times)

BLFTech

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
    • BLF-Tech LLC Website
Form load on startup
« on: February 26, 2014, 09:14:01 PM »
When I start the project is there a good way to preload all my forms in the background? This would be helpful because the first time I load other forms in my project, with several AdvancedHMI controls on the forms, it may take several seconds to load.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Form load on startup
« Reply #1 on: February 26, 2014, 09:35:03 PM »
I have yet to find a solution for this. Most of the communications start at a OnCreateControl event which doesn't seem to fire until the form is loaded and visible. I'm on a current project in which they requested a faster response when opening the forms for the first time, so I have been exploring different ways. If I figure it out, I will post it here.

BLFTech

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
    • BLF-Tech LLC Website
Re: Form load on startup
« Reply #2 on: April 06, 2014, 09:08:37 PM »
Archie, have you any success with the speed of loading a form for the first time?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Form load on startup
« Reply #3 on: April 07, 2014, 01:24:37 PM »
I tried a few things with background threads, but it created some problems.

Mikefly95

  • Jr. Member
  • **
  • Posts: 80
    • View Profile
Re: Form load on startup
« Reply #4 on: April 10, 2014, 01:00:37 PM »
what happens if you start your forms off with Public Sub init()call all your subs on that form and from your main form load event call a Private sub LoadForms() and then call all of your forms
Dim tForm as new TempForm
tFrom.init()
Dim aForm as new AlarmForm
aForm.init()
so on and so on

then on your button click event just use TempForm.Show AlarmForm.show etc

Mikefly95

  • Jr. Member
  • **
  • Posts: 80
    • View Profile
Re: Form load on startup
« Reply #5 on: April 13, 2014, 11:51:52 AM »
Why not use a single form with multiple panels with the visible value set to FALSE?
Then instead of loading a form set your Size and location and visible to TRUE on the panel you need?

steves0118

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Form load on startup
« Reply #6 on: June 23, 2017, 09:14:36 AM »
I know this is an old topic, but I seem to be having the same problem.  The first time I switch forms after opening the application it takes about 15 seconds to load the form.  After that it takes about 500ms.  Has anyone found a solution to this?  Is it possible to load each form when the application boots so the operator doesn't experience the delay?

Thanks,
Steve

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Form load on startup
« Reply #7 on: June 23, 2017, 09:34:06 AM »
I know this is an old topic, but I seem to be having the same problem.  The first time I switch forms after opening the application it takes about 15 seconds to load the form.  After that it takes about 500ms.  Has anyone found a solution to this?  Is it possible to load each form when the application boots so the operator doesn't experience the delay?
The reason for this is because on the first opening of the screen, the driver will read every value one at a time to get its type and validate it. After that it will optimize the reading. If you have a small number of items on a screen, the delay will be short and barely noticeable. There is no real work around. As a general rule, when I start up or reboot a screen, I select each page to get through those initial delays.

If you see 15 seconds I am guessing that either you have a lot of items on a screen, slow communications, or a slow PC. I rarely see more than 3 second delay.

steves0118

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Form load on startup
« Reply #8 on: June 23, 2017, 11:28:16 AM »
You are correct about it being a slow PC.  However, I was hoping there was a solution because it runs very fast once all of the forms have been opened.

I am trying to make a budget HMI for troubleshooting simple machines in our plant.  The 7" touchscreen prototype is functional and cost under $200 + a 3D printed bezel.  I have not installed it yet, but will create a new forum post with details once it is finished.

Here is the parts list:
$109.90 Wintel PC - www.amazon.com/gp/product/B06W2LWQKC
$69.99 7" HMDI Touchscreen - www.amazon.com/gp/product/B015E8EDYQ
$7.99 24V to 5V DC Converter - www.amazon.com/gp/product/B00BWLP88A
$5.00 Ethernet Cable
$?.?? 3D printed bezel

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Form load on startup
« Reply #9 on: June 23, 2017, 06:07:27 PM »
You are correct about it being a slow PC.  However, I was hoping there was a solution because it runs very fast once all of the forms have been opened.
How many items do you have on the screen that takes 15 seconds to open? You could try reducing the PollRateOverride property of the driver. That may help speed things up.