LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can not stop one case?

Hi, I am trying to make a simple task, but failed. In the task, I have three states:
1. get a single point
2. get multi points (set to 10)
3. Continuous acquisition
 
I made one slider for the three cases, then use a case structure; use a GO button and an Event Structure to drive the acquisition. The first two cases are working well; but once the slider points the third case (continuous acq) and I click GO, the STOP button loses response and the program never stops until I click "Abort Execution" button.
 
Attached is my code. I am a newbie in Labview and have not got myself familiar with any complicated structures. Could anybody help to check my code? Will a minor change  solve my problem? or whole logic is wrong here?
 
Any help will be appreciated.
 
sipher

Message Edited by SiPHER on 12-08-2006 01:13 AM

0 Kudos
Message 1 of 4
(3,301 Views)
That's because you started a while loop inside an event case and program control is transferred to that loop
 
Now, no event will be registered until this while loop stops.
And so, pressing the stop button will not be registered
 
Here is one of the ways to get about it
Make your continuous a sub VI and have a stop for it, inside that sub vi itself. However, your chart on the main vi can be updated using a reference
control.vi ( main)
continuous.vi ( sub vi)
Download All
0 Kudos
Message 2 of 4
(3,291 Views)

Yes, you are doing this way too complicated. There is no need to use inner loops and local variables. Think about it, the only difference between the three modes is the number of acquisitions, everything else is the same and can share the same code.  First of all, you should use the outer loop and timeout case to run the data generation and you won't get stuck inside inner loops. The event structure is always ready to execute!

Attached is a simple code skeleton. See if it all makes sense to you.

Other issues:

Remember, you can use text labels for slides. There is no need to use free text for that. If you have an event structure, you don't need any other wait statements in the outer loop.

Message 3 of 4
(3,282 Views)
thanks a lot for help. A lot of things need to learn Smiley Tongue
 
sipher
0 Kudos
Message 4 of 4
(3,255 Views)