04-08-2014 04:08 AM
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
04-08-2014 04:23 AM
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/
04-08-2014 04:41 AM
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.
04-08-2014 06:52 AM
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.