LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to run a loop automatically without necessarily pressing the the run button in the menu bar of the vi

Hello,

i have two while loops in the same Vi. The first while loop is for the stepper motor and the second loop is for the ADC with which i use the DAQ assistant to acquire analog signals (voltage)

I have put a case structure in the second loop which stops the motor if the condition is met. the problem am facing is that every time a condition is met, the loop in which i a cquire voltage signal stops so that i have to run the vi again in case i change the input voltage. could there be away of how this loop could remain runing or just pressing a run button so that the motor runs automatically when i change the voltage without necessarily having to stop the vi and run it again?

Am attaching the vi for help

Alex

0 Kudos
Message 1 of 4
(2,057 Views)

That sounds like a job for a state machine of some variety in your parallel loop.

 

Have a read through of the following as a starting point w.r.t. state machines:

 

http://www.ni.com/white-paper/7532/en/

---
CLA
0 Kudos
Message 2 of 4
(2,045 Views)

Hi, the code works, its only that condition of continous running of the second while loop. i feel it doesnt make sense to place a astop and run button again whenever the voltage changes.

0 Kudos
Message 3 of 4
(2,034 Views)

Why make it stop when the voltage changes?  Either add another stop button or use a local variable on your current stop button to stop both loops.


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
0 Kudos
Message 4 of 4
(2,010 Views)