05-24-2016 10:03 AM
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
Solved! Go to Solution.
05-24-2016 10:09 AM
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.
05-24-2016 10:11 AM - edited 05-24-2016 10:17 AM
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....