10-21-2019 09:17 AM - edited 10-21-2019 09:19 AM
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.
Solved! Go to Solution.
10-21-2019 09:29 AM - edited 10-21-2019 09:32 AM
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…
10-21-2019 09:42 AM
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.
10-21-2019 09:47 AM
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
10-21-2019 09:51 AM
10-21-2019 09:55 AM - edited 10-21-2019 09:56 AM
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.)
10-21-2019 10:23 AM
@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?
10-21-2019 12:58 PM
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
10-21-2019 01:42 PM
@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