LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

switching case loop

Solved!
Go to solution

Hi,

 

I'm trying to make a vi that either increases or decreases the  output voltage from my DAQPad-6259. Right now, the vi that I made requires the user to manuall switch between the increasing or decreasing cases.

 

I'm wondering how I can make this thing run autonomously until I make the program stop. This is definitely a very newbie question but I can't seem to figure an efficient way of handling this problem.

 

I'd appreciate any help that you guys can give.

 

Cheers.

Desperate person

0 Kudos
Message 1 of 6
(2,797 Views)

I'm not entirely sure what it is that you are trying to do but if you want to get the program to run continuously (Without needing the run continuously button) then simply put a while loop around all of the program so far and fit it with a stop button. That should mean that until you press the stop button the program will either run so that the voltage changes in the up or down direction. 

 

Although on that note I might reccommend using a single DAQ function placed outside of the case structure, this will resolve or prevent a number of issues if you simply pass the results from the increasing or decreasing out of the case structure to the single DAQ.

Message 2 of 6
(2,790 Views)
Solution
Accepted by topic author rakue

To make Your application run continously and shift between the 2 cases, You'll need to add a While loop, and a shift register.

The value of the boolean in Your shift register is then inverted for every iteration of the loop. Like so:

 

 

BD.png

 

/B

Don't forget to rate a good Answer....
---------------------------------------------------------
Here should be some cool signature

But there's NOT

LabVIEW 2012-2017
---------------------------------------------------------
Message 3 of 6
(2,778 Views)

You might want to have a good read about how State Machines work.


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
Message 4 of 6
(2,741 Views)

Smiley Surprised

0 Kudos
Message 5 of 6
(2,735 Views)

Thank you for your response.This is exactly what I was looking for. Thank you for your help. I guess what was lacking was the shift register. Thanks again for your help 😄


BCL@Servodan wrote:

To make Your application run continously and shift between the 2 cases, You'll need to add a While loop, and a shift register.

The value of the boolean in Your shift register is then inverted for every iteration of the loop. Like so:

 

 

BD.png

 

/B


 

0 Kudos
Message 6 of 6
(2,677 Views)