LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to acquire data for different time lengths

Solved!
Go to solution

Hi,

 

I'm relatively new to Labview and trying to build a vi for acquiring data from 3 transducers for a lab application. I am using a NI-DAQ- USB 6212 BNC for acquistion. After a lot of trial and errors and reading up different examples from the forums. I successfully managed to acquire data using 'for loop structure' for approx 10 seconds. However, I would like to have an option of acquiring data for 3 minutes as well (switch between both modes). I looked into creating case structures, but would like to avoid having 2 separate waveform graphs. Any advice and help would be appreciated.

 

Thanks

 

P.S. below are the images of my vi.

0 Kudos
Message 1 of 9
(256 Views)

Hi ndaphtary,

 


@ndaphtary wrote:

I successfully managed to acquire data using 'for loop structure' for approx 10 seconds. However, I would like to have an option of acquiring data for 3 minutes as well (switch between both modes). I looked into creating case structures, but would like to avoid having 2 separate waveform graphs. Any advice and help would be appreciated.

P.S. below are the images of my vi.


What is the problem with your existing VI?

Are there any errors?

Why can't you read data for 3mins? (Simple math: it would take about 920 iterations to read 46080 samples at 256S/s and 50 samples per read.)

 

On your images:

You will get the advice to attach VIs instead of images of VIs: we cannot debug images with LabVIEW!

When you still want to upload just images: inline them in the message instead of attaching them…

Best regards,
GerdW
CLAD expired, using LV2011SP1 + LV2017 (+LV2019 sometimes) on Win7+cRIO
Kudos are welcome Smiley Wink

0 Kudos
Message 2 of 9
(235 Views)

Hi GerdW,

 

The problem is not the length of acquisition. Rather what can i do to have an option to switch between collecting data for 10 seconds or 3 min and store it all in the same .tdms file. I have tried to implement case structures but I can't seem to do it all on the same waveform display. Please find the vi attached. Again thanks for your help.

 

0 Kudos
Message 3 of 9
(223 Views)

Apart from Gerds comment that you only need to calculate the amount of loops of the For loop i'd like to add that it's recommended to set the Buffer size of the Continous acquisition to 2x one capture size, so simply add a 2x Sample size as the buffer size.

/Y

G# - Award winning reference based OOP for LV, for free! ADDQ VIPM Now on GitHub
"Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
Certified-LabVIEW-Developer
0 Kudos
Message 4 of 9
(216 Views)

Hi,

 

unless there are very important reasons you don't need to set the buffer size (for "continuous samples" mode) at all! (Read the LabVIEW help for DAQmxTiming…)

Best regards,
GerdW
CLAD expired, using LV2011SP1 + LV2017 (+LV2019 sometimes) on Win7+cRIO
Kudos are welcome Smiley Wink

0 Kudos
Message 5 of 9
(213 Views)
Solution
Accepted by ndaphtary

Hi ndaphtary,

 


@ndaphtary wrote:

Rather what can i do to have an option to switch between collecting data for 10 seconds or 3 min and store it all in the same .tdms file. I have tried to implement case structures but I can't seem to do it all on the same waveform display


All you need is to select between two different constants for the loop iteration count: you need a button and a Select function! No need to put 2 FOR loops with 2 charts into cases of a case structure…

(Thanks for attaching the VI, but I'm stuck at LV2017 right now.)

Best regards,
GerdW
CLAD expired, using LV2011SP1 + LV2017 (+LV2019 sometimes) on Win7+cRIO
Kudos are welcome Smiley Wink

Message 6 of 9
(209 Views)
Highlighted

@Yamaeda wrote:

Apart from Gerds comment that you only need to calculate the amount of loops of the For loop i'd like to add that it's recommended to set the Buffer size of the Continous acquisition to 2x one capture size, so simply add a 2x Sample size as the buffer size.

/Y


Generally, just leave it unwired when in Continuous Mode: How Is Buffer Size Determined?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
Message 7 of 9
(189 Views)

Thanks again GerdW,

That's what I needed. Put in a selector switch and everything works like a charm. Really appreciate all your help!

Regards,

ndaphtary

0 Kudos
Message 8 of 9
(151 Views)

@crossrulz wrote:

Generally, just leave it unwired when in Continuous Mode: How Is Buffer Size Determined?

Nice to see that they've updated that help page to cover both nits I used to pick!  (It didn't used to let you know it would honor a request for a larger buffer than the automatic size, and it used to list 100 S/sec and 10000 S/sec as both the end of one range and the beginning of the next, making the behavior for those specific values ambiguous.)

 

 

-Kevin P

 

Message 9 of 9
(138 Views)