LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I Just Can't Stop!

My vi has a stop button on the front panel but only the "abort
execution"button
stops the vi completely.This vi writes/reads through the parallel port to a
LTC1298 A/D chip.I use Labview 6i on Windows 98se.
The vi diagram consists of a 2 frame sequence structure inside of a While
loop.Inside frame 0 there is a For loop which contains an Outport sub vi.
the For loop iterates 12 times to initialize the chip.
In frame 1 there is another For loop which has an Outport and an Inport
sub vi.This For loop iterates 24 times to read 12 bits from the A/D
chip.Also
inside frame 1 and beside the For loop are various functions for displaying
the
12 bits,their numerical value,high/low limit alarm,and a Wait timer.A wire
from
this area connects to a Waveform Chart
terminal located just outside the
While loop.Hitting the Stop button on the front panel stops the Waveform
Chart but
the reading and the writing continues.
I've tried different mechanical settings for the Stop button,default T/F,
and T/F for the Conditional terminal in the While loop. The Stop terminal is
currently
inside Frame 1,but has been almost everywhere else.How to stop?
0 Kudos
Message 1 of 3
(2,245 Views)
Ron,

You might have to creat a bunch of local variables for the stop button and then it will set it to false everywhere once it is set by you on the front panel. Make sure you read the local variable in all the loops and ask the loop to run only when the condition of the stop button is off.

This might be done using a while loop aroung the for loops you already have.

I hope this helps.

Good Luck.

-Pari.
0 Kudos
Message 2 of 3
(2,245 Views)
Nothing is going to terminate a for loop (except the "Abort") until all of it's iterations complete. You've got two of them inside of a sequence which also will not terminate until it's completed. At the very least, you'll need to replace the for loops with while loops that can terminate early. You should also put the stop terminal outside of the sequence structure. In fact, I'm one of those persons that say a sequence structure should never be used. The LabVIEW state machine will give you more flexibility. There's plenty of examples to be found - even one that ships with LabVIEW.
Message 3 of 3
(2,245 Views)