LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

wait in while loop test - VI analyzer

Solved!
Go to solution

Hello all,

 

I ran VI Analyzer on a VI.  I failed the high rank "Wait in the while loop" test which I didn't quite understand.  Please take a look at the description below

 

-----

This While Loop containing a front panel control terminal appears to have no way to regulate its speed.  If this is a subVI, consider moving the control terminal outside the loop.  If this is a user interface VI, consider using an Event Structure to monitor front panel activity.

----

 

I have a state machine architecture which consisted of a while loop and a case structure.  My <Shutdown> case has a True constant which is wired to the stop condition terminal.  The rest of the cases have the False constants.  The stop button on the front panel doesn't connect directly to the stop condition terminal.  It activates the <Shutdown Case>.

 

How do I improve my code to pass this test?  Thank YOU

0 Kudos
Message 1 of 2
(2,659 Views)
Solution
Accepted by topic author sangbui_palpro

You have missed to include a wait function in your loop. By doing so, your VI hogs the CPU in an unnecessary way (since obviously you wait for user interaction).

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 2 of 2
(2,655 Views)