LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

stop button is not active

Solved!
Go to solution

Hi,
when i run my program a can press stop button , but after choosing N1 in menu button is not active. How to do it active?
Thank you

0 Kudos
Message 1 of 3
(2,620 Views)
Solution
Accepted by topic author mbsto

This is one of the reasons you do not put "long" tasks inside of an event case.  What you really need is a State Machine.

 

But what is happening is your event case is set to "Lock Panel Until Event Case Completes".  This means any button presses are disabled until that event case is complete.  It is not complete until that loop completes, which will never happen since it is based on a button that has been locked.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 3
(2,613 Views)

You don't have any stop button. Your question therefore doesn't make any sense.

 

Looking at the VI, you really have to learn the LV fundamentials. Please follow the link in the LV forum (Looking for help getting started with LabVIEW?).

 

Just a few comments:

1. You have an unstoppable VI (disregarding Abort Execution, a icon bar item which should be removed for good!). This is bad.

2. You have an unstoppable loop in an event case. This is very bad. Having a loop in an event case by itself can be considered to be bad.

3. You block your UI thread with the unstoppable event case. The behavior is therefore expected.

 

Norbert

 

EDIT: Sorry, took a wrong look on the inner loop. It does stop after 500 iterations. You should use a for loop in this case.... However, your structure stacking obfuscates important items and makes the code way more complex than it should/could be....

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