LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how can i run case structure programitically

hi,

i am working on a vi , which has stages from 0...5. i am trying run the program, so that it executes case 0...5 one after other. and if i want to stop the program in the middle of the process, how i can connect the "stop" button to all cases, so that they all stops at the same time.

Could you pls help me ..

0 Kudos
Message 1 of 9
(3,885 Views)
use a state machine there are tons of examples on this forum.
Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
Message 2 of 9
(3,882 Views)
here is an example:
Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
Message 3 of 9
(3,878 Views)
make sure you put a delay in the while loop:)
Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
Message 4 of 9
(3,876 Views)

Hi Sandy,

 

Use a boolean shift register in which the stop button state can be updated and the same can be used as the case selector to select whether to run or not to run the forthcoming cases. So that the program will come out of the cases immediately without any delay and stop thence.

 

MRK (CLAD)

Message 5 of 9
(3,871 Views)

If all five states always execute in sequence, you could also do something similar to the following. (assuming you have a newer LV version that alllows for the conditional terminal in FOR loops)

 

Use shift registers to hand data from one state to the next if needed.

 

 

Message Edited by altenbach on 05-31-2009 09:59 PM
Message 6 of 9
(3,867 Views)

HI  ,

Thank you so much for the solution.

As i am new to labview, i am trying to log all outputs of my vi.

that is , i want to display the outputs of each case structure as it executes.

Could you pls help me to do this.

 

Thank you.

0 Kudos
Message 7 of 9
(3,799 Views)

Try something as follows:

 

 

0 Kudos
Message 8 of 9
(3,788 Views)

Is this ok?

 

MRK (CLAD)

0 Kudos
Message 9 of 9
(3,786 Views)