LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Modal operation ?

I have a vi that has three graphs on the screen.  It is runing on a 533mhz processor and CPU usage bounces between 50 and 100%.  I noticed when i spawn a modal dialog that the CPU usage dramatically decreases but the graphs are still updating.  Does the modal dialog suppress events from the graph ? if so how do I optimize my graphs?


- James

Using LV 2012 on Windows 7 64 bit
0 Kudos
Message 1 of 8
(3,921 Views)
Really high CPU usage usually means you have a loop that's running as fast as the processor will allow it.  Try putting a Wait (ms) function in all your loops, because having them wait even 10ms between iterations can drastically reduce labview's footprint.  Also, if you're doing a lot of data processing that can't wait 10 ms, you could delay panel updates until every tenth or hundredth iteration of the loop.
0 Kudos
Message 2 of 8
(3,918 Views)
I know all about putting delays in loops but that is not my problem.  my question is when a modal window is running which is spawned by this vi i can still see the graphs updating behind the modal window but the cpu drops to 45% instead of bouncing from 50 to 100.


plus these loops are updating only once a second


Message Edited by James R on 04-07-2008 01:19 PM
- James

Using LV 2012 on Windows 7 64 bit
0 Kudos
Message 3 of 8
(3,912 Views)
Oh, sorry.  The first thing I would check is if anything's downstream of the modal VI.  Other than that, I don't think a modal window automatically defers panel updates or takes thread priority.
 
edit - once a second and you're using 100% cpu?


Message Edited by JeffOverton on 04-07-2008 02:24 PM
0 Kudos
Message 4 of 8
(3,909 Views)
When you say you "spawn a modal dialog box" exactly what do you mean? How exactly are you calling the VI that is serving as your dialog box? What is the structure of the dialog box VI itself?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 5 of 8
(3,880 Views)
I think i can explain my problem better now.
 
 
I have two loops
  • loop one handles a set of gauges and digital displays and hidden controls to allow the user to set up max and min ranges for the gauges via touchpanel.  These hidden controls call a number pad vi which is set as a modal window in the vi properties.
  • loop two handles three graph indicators

when i monitor cpu usage at idle on my development machine it is 25 - 30%  (dual core 2.7GHz 3GB RAM)   

when i monitor cpu usage on target machine (via 1GHz 1GB RAM)  it bounces between 50 and 100%

On the target machine when i activate the numberpad via clicking on a hidden control  the cpu usage is between 40 and 45 %.   I believe the reduction in cpu usage is because none of the gauges in the loop that called the numberpad.vi are updating

 

I read some other threads today concerning UI performance when using overlapping controls.  I am using many overlapping controls

I have started experimenting with Xcontrols and am wondering if this may be a solution to the performance hit that I get when overlapping controls

 





Message Edited by James R on 04-07-2008 10:29 PM
- James

Using LV 2012 on Windows 7 64 bit
0 Kudos
Message 6 of 8
(3,877 Views)
So to put things another way, your CPU usage goes down significantly while your loop 1 is stopped waiting for the dialog box to close... That sounds like a clue...

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 7 of 8
(3,870 Views)

yes i believe the performance problem is due to the overlapping controls

 

do Xcontrols handle this better?

- James

Using LV 2012 on Windows 7 64 bit
0 Kudos
Message 8 of 8
(3,868 Views)