LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

stop programmatically voltage acquisition (DAQmx) and plot signal

Dear all,

 

I use Labview 2011 and a NI acquisition board.

I want to acquire a voltage during 5 secondes (sampling=1khz, sample=5000) but I want to be able to stop the acquisition programmatically (stop button for example) before the end of the acquisition. In the case the acquisition has been stopped, I want to plot the voltage data acquired until the stop action. I don’t know if the STOP task is the right function and how to use it. Any suggestions?

 

Regards,

 

Cedric

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

Hi Cedric,

 

acquire your samples in a loop: run the loop 10 times and ask for 500 samples each loop. So you will get up to 5s of data, but you're able to stop each 500ms!

 

Do you get the point? 😉

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(2,685 Views)

In addition to what Gerd said, just to make sure it's clear: the STOP task (if you're talking about the big [off-white, ugly] octagonal stop sign) is NOT the correct function. Use a conditional FOR loop and wire your stop button to the regular conditional stop.

 

Cameron

 

To err is human, but to really foul it up requires a computer.
The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
Profanity is the one language all programmers know best.
An expert is someone who has made all the possible mistakes.

To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):

LabVIEW Unit 1 - Getting Started</ a>
Learn to Use LabVIEW with MyDAQ</ a>
0 Kudos
Message 3 of 6
(2,677 Views)

hi GeredW,

 

The problem with this strategy is that between each pack of samples, there are samples missing because of the loop structure (to go to the next iteration). 

 

Cedric

 

0 Kudos
Message 4 of 6
(2,675 Views)

Hi Cedric,

 

when you use "continuous sampling" you will not miss any samples.

 

See the DAQmx examples coming with LabVIEW!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 6
(2,672 Views)

Yes you can use continous samplying or else use ur graph inside the loop and try it once

Boldness has genius, power and magic in it!'
0 Kudos
Message 6 of 6
(2,655 Views)