LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Setting a constant sampling rate

Hi, I'm kind of new to this... 

I'm trying to set my sampling rate to a constant value - say 1000 Hz (while acquiring data from 7 channels simultaneously) - 

Right now it seems like the sampling rate is not constant , each time I look at the output of 1 minute of recording - I get a different number of samples. I tried setting a delay of 1 ms inside my loop but it didn't work..

 

Thanks,

Tamar 

 

0 Kudos
Message 1 of 5
(3,545 Views)

Hi Tamar,

 

You'll want to use a DAQmx Task to implement your sampling. For your purposes, this will probably mean creating a new task, specifying a clock, starting the task, and then reading from it. There are numerous examples in the NI Example Finder that provide templates for acquisition (look for multiple channel, continuous samples). You can find it under the Help tab in LabVIEW. In addition to checking out the examples, I would recommend you take a look at the DAQmx documentation and become familiar with using its API.

 

This link may help:

Using Basic DAQmx Functions

 

Cheers,

 

Duncan W.

0 Kudos
Message 2 of 5
(3,510 Views)

To avoid (our) eyestrain, do not attach pictures of your LabVIEW Block Diagrams.  We also cannot easily "modify" a picture, nor test its code, nor see "outside the edges" or "behind Case Statements".  Attach the actual VI instead.  Thank you.

 

Bob Schor

0 Kudos
Message 3 of 5
(3,487 Views)
0 Kudos
Message 4 of 5
(3,472 Views)

hi tamartau,

 

please get rid of all the sub array, build array, transpose stuff

 

you get the same, just wiring the 1D array of your DAQ-read into the 1D-array-Input of the write-to-csv function

(to test yourself, drop the snippet onto a blockdiagram and run it)

its-the-same.png


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 5 of 5
(3,467 Views)