LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I get my panel to appear faster?

Hi all,

 

I have a GUI that displays a panel when the user clicks a button on another panel.  The new panel displays very slowly and almost in parts.  It contains three sub-panels that are tabbed and I wonder if that is causing it to load so sluggishly.  I have put ProcessDrawEvent commands all over the place to try to get it to draw faster but with no real luck.  Any suggestions would be appreciated.

 

Judy

0 Kudos
Message 1 of 9
(4,011 Views)

If possible, I would suggest loading the panel before hand and doing any setting up of the panel (control values, attributes, etc.) at that time, and then when the user clicks the button, that's when you call DisplayPanel() to show it to the user.  In that case, it should show pretty quickly.  Also, if the user can close the panel, you can call HidePanel() to hide the panel instead of discarding the panel.  That way the panel is kept in memory, and you can use DisplayPanel to show it again when needed without reloading the panel first.

 

 

0 Kudos
Message 2 of 9
(4,001 Views)

I do not know what is causing your panel to show slowly. You should perhaps add some line of code (or pseudo-code) to show us what you are doing to load and display the panel. I suppose you are doing several customization if you have the time to add ProcessDrawEvents "all over the place"

The fact that it shows slowly can derive from multiple reasons, one of them being that the program is doing some other resource-consuming activity in the meanwhile. What does it mean "three sub-panels tabbed"? And which version of CVI are you using? You posted questions in the past related both to 7.1 and 2010, so...?



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 3 of 9
(3,998 Views)

Hi ,

 

Another thing you can do that can help you understnd the origen of the problem , is to watch the Task Manger > CPU preformence before and while you'r uploading your panels.

 

It may help in some cases but wrong code writing dosent reflects always as High % of CPU process....

 

As Roberto said if you'll upload your code it will be easier to help.

-----------------------------------------
Kobi Kalif
Software Engineer

0 Kudos
Message 4 of 9
(3,978 Views)

Hi guys,

 

I'm using CVI 2010.  When I say tabbed sub-panels, I mean that the parent panel has three child panels that each use tabs to select different things.  I'm attaching a screen shot to show what I mean.  There are many settings to load to and read from the panel.  I load all panels in the main function and display/hide them when I need to, so that's not an issue.  I also read these settings from a device, set the controls in the panel appropriately, then call DisplayPanel.  However, the panel displays in blocks and it takes a second or two for it to complete displaying.  Very noticeable to the end user.  I would think that setting all the controls prior to calling DisplayPanel would allow the panel to appear quickly.  I also call the ProcessDrawEvents both before and after the call to DisplayPanel.

 

Thanks,

 

Judy

0 Kudos
Message 5 of 9
(3,955 Views)

PS - Make that FOUR tabbed sub-panels.  I forgot about one until I saw the screen again.

 

Judy

0 Kudos
Message 6 of 9
(3,953 Views)

Looks like a pretty involved application.  Something else you can try is playing around with SetSleepPolicy ();.  I've found that sometimes this needs to be changed from "Sleep More" (generally the default) to either "Sleep Some" or "Do Not Sleep", especially if you have multiple threads going at the same time.  Note that this will increase the CPU usage of your application, even when it is idling.

0 Kudos
Message 7 of 9
(3,947 Views)

Hi Judy,

 

I also have a panel where, in the course of the project, several tab panels have been added. I did not realize any delay caused by added tab panels.

 

Actually it's not clear to me why you need to call ProcessDrawEvent if all you do is calling LoadPanel and DisplayPanel?

 

The situation would be different if you programmatically build your panel. In this case, you should call DisplayPanel only after all controls and menues are done.

 

Hth,

Wolfgang 

0 Kudos
Message 8 of 9
(3,938 Views)

I am a little puzzled by what you say about "child panels that use tabs": you mean that e.g. that "Limits" area is not simply a tab control but rather is a child panel that only has the tab control on it? Is there a reasonable motivation for such a complicated structure? Wouldn't it be simpler if the tab control is placed directly on the panel and shown / hidden / disabled itself? I'm pretty sure you know that you can also show / hide / disable individual tabs.

 

In any case, in all situations in which I observed a panel shown in steps it depended on the application having in the meanwhile other threads / timers to communicate with external devices: the amount of time taken to serve these additional tasks were limiting GUI responsiveness.

So I'm asking again: is the application executing some separate task(s) while you are displaying the panel? How much time these tasks take to execute? Could you suspend them for a while during DisplayPanel?



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 9 of 9
(3,901 Views)