From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to start data acquisition when a condition becomes true

For my VI, I am measuring a voltage output from a laser. The laser range is +/- 5V and has a 12V output when the target is out of the laser's range.

I would like to start the data acquition when the voltage from the laser hits a voltage above 5V. The reason I want it set up this way is because I am using the laser's out of range voltage (which is triggered by a small pin that is very close to the laser) as a trigger for data acquisition. Basically, I want the program to monitor the voltage and the first time the voltage gets above 5, I want the next stage to start, which is the data acquision.

The problem is that I want the data acquisition to stop when the voltage gets above 5V. I am using t
he same principle/mechanism to stop the program as I did to start it. The attached VI is the data acquisition stage. I don't see how to include the start condition in the current loop system, but I have no clue how to implement it. I am also using LV 4.0, which might limit me 😞

Any ideas?

Clint
0 Kudos
Message 1 of 4
(2,462 Views)
You might wanna use the sequence structure. The first sequence will include a while loop which has a condition that quits it once the voltage is above 5v (comapre the voltage in the while loop with value equvalent to 5V) and do the data acquisition in the same while loop. In the next sequence do the next task that you wanna perform.

Hope this helps.
Attatch the VI in the binary format so that I can view it. I was not able to open it in labview as it is attatched as a plain text.

Good Luck.

Pari.
0 Kudos
Message 2 of 4
(2,462 Views)
Here is Clint's VI. I just changed the file extension to ".vi". Hope this helps. /Mikael
0 Kudos
Message 4 of 4
(2,462 Views)
You should be able to do this with two while loops. Put some sort of data dependency (Like an error cluster)between the first and second loops so that the second starts after first is done. The first one should run until the voltage gets above 5V then stop. The second one should be like the one in your example, it aquires data until the voltage goes back above 5V.

Good luck

Brian
0 Kudos
Message 3 of 4
(2,462 Views)