LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I pause while loops (which is using DAQmx read write) and then read some data from DAQmx and transfer to the pausing stage in same VI

Hi all,

 

I am working on color detection project. I am Using Two analog output and one digital for three LEDs and one analog input for pindiode. (LabVIEW 8 and DaqPad 6016).

 

In inner while loop, I used all analog out puts and input to turn on leds and read the sensitivity of pin diode. All the measurements of Pindiode are stored first in queue and then out side of this while loop I released this queue and I count maximum values among that values and then process that values with my algorithm and detecting the color. It all in one outer while loop so I can detect the color when the VI is running.

 

Now I have to implement one more function in it, When the user want it can pause the execution of the VI and and then using same analog inputs, output VI has to take measurement of another color (It doesn’t required continuously i mean in while loop) and then give all these measurements to the pausing stage of the VI and calculate some mathematic functions and give the result.

 

I have tried to put some one more outer loop but the problem was the execution of that two inner while loop was not pause.

 

I am also attaching my main VI it has some subVIs but it is just for color detection algorithm so I am not attaching that VIs.

 

And one more VI and it is the idea of what I have to Implement.

 

Thank you for your time

 

Download All
0 Kudos
Message 1 of 3
(2,671 Views)
Hi, N.K.

Though there is no built-in pause functionality for a while loop, there are several different ways to implement that behavior on your own. The simplest method involves using a case structure in your while loop, and the screenshot below demonstrates that:




If you want the pause behavior to occur throughout several iterations of the while loop, you could specify a switching mechnical action on the pause button (instead of a latching action). You could also use a shift register to carry the value of the pause button between while loops.
Let me know if you have any more questions! Have a nice afternoon.

Message Edited by sarahk on 05-08-2006 01:00 PM

Message Edited by sarahk on 05-08-2006 01:04 PM

Sarah K.
Search PME
National Instruments
0 Kudos
Message 2 of 3
(2,658 Views)

Hello,

Sorry for saying late thank you but I found solution so I havent checkd your reply. Any way if I have any more questions regarding this I will ask.

Thank you for your time

 

0 Kudos
Message 3 of 3
(2,642 Views)