LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why my LabVIEW application run faster when LabVIEW window is not active?

Hello,

 

although I know it is a strange question and a strange phenomenon I don't know why my application run faster if I click out of LabVIEW window and keep window out of focus. When I click LabVIEW window again and become the active window, the application starts running slower.

 

How can I solve it?

 

Can anybody help me?

 

Thanks a lot in advance.

 

Maria 


0 Kudos
Message 1 of 4
(2,280 Views)

More often that not, a lot of work is bing done to keep the UI thread busy with screen updates.

 

Look for over-lapping screen objects, or fancy graphs or graphics.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 4
(2,275 Views)

Hi, Mariah,

 

front panel controls and indicators introduce an extra overhead in your LabVIEW application. In terms of LabVIEW execution, front panel windows are handled differently based on whether they are closed or just hidden.  If a VI is running and its front panel window is closed, then it will continue to run as long as another VI still has a reference to it.  If the referencing VI stops running, then the VI with the closed front panel will be aborted.  However, with a hidden front panel window, the VI won't get aborted because it’s front panel window is technically still open, just not in view.  Although the two properties are similar, there are a few advantages of using one over the other.

 

  • Closed:When a front panel is closed, the memory that is being used by all of the front panel objects is freed up, therefore potentially improving the performance of the VI.
  • Hidden: The process of hiding a window, or un-hiding it, is potentially faster than completely unloading the panel from memory by setting it to closed.  The speed is related to the complexity of the front panel, yet could allow the VI to run smoother.  Also, it may be useful in developing an application similar to a daemon, which runs silently in the background.

Besides, here you are several knowledge bases which can help you to increase your application performance and reduce the overhead:

 

http://digital.ni.com/public.nsf/allkb/8029EE2F5BDA06A7862576230031AD7F?OpenDocument

http://digital.ni.com/public.nsf/allkb/862567530005F09C8625667B00044B35?OpenDocument

http://digital.ni.com/public.nsf/allkb/AB6084CE13C3FA87862579770004FCC0?OpenDocument

 

I hope this helps! Saludos.

 

Jesús.

 

 

 

Message 3 of 4
(2,243 Views)

Thank you Ben and Jesús for all your ideas!

 

I've checked my application to remove all those blocks which were producing to use extra memory, I've tried to disable some fields which were updating information, I've even removed graph, ... and I always experienced same behaviour, my application always run faster if I remove focus from LabVIEW application window...

 

So, I decided to use a quite shoddy solution, it is, to emulate removing focus effect by clicking out of window :-S

 

Attached you'll find the block diagram part for this solution.

 

I know it is not the best I could do, but...

 

Thanks guys for your valued help. It didn't allow me to find a solution for my problem but I improved a lot my application with your advices.

 

Regards,

 

Maria 

0 Kudos
Message 4 of 4
(2,212 Views)