LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

sampling/read rate NI-DAQmx

    I am using DAQmx 8.0 and NI-DAQPad 6015.. reading analog input voltage... I have to acquire it, display on front panel chart, and record it.
    Samplin rate needed due to signal characheteristics is 1000Hz, what do you suggest about read rate (DAQmx Read , #samples param.) and what method of recording to use LVM measurement file, or something else...


0 Kudos
Message 1 of 10
(7,432 Views)
Hi.

The number of samples that you want to read at a time depends on how often do you want to update your display in the front panel.  You say that you will be acquiring data at 1kHz.  So, for example, if you want to update your fron panel every half second, you would set the number of samples to read at a time to 500.  If you want to update only once a second, set it to 1000, and if you want to update 10 times a second, set it to 100.  I think that twice a second is fast enough for a human to be looking at, and it shouldn't cause you computer speed problems.

As for the best way to store the data, LVM or binay are good formats when you want to write data to files during acquisitions, since they take up less disk space and it is faster to write to file.  However, you will only be able to access the data from LabVIEW.

If you want to be able to access the data in another application, like Excel, Matlab or even Notepad, you need to write the data in ASCII format, which takes up a lot more disk space and is much slower.  So, you need to decide.

Hope this helps.

Alejandro
Message 2 of 10
(7,423 Views)

Just to add to Alejandro's good answer, Read rate also determines at what rate you retrieve data from the AI buffer.

For ex, if you are acquiring at 1K sampling rate and you put 500 as number of samples to read, the 'DAQmx read' does 2 irterations in a second to retrieve 1000 samples in a second.

if you enter it as 10, DAQmx read executes 10 times in a second, and so on.

So it is essential that you choose a optimal value to prevent buffer overflow.

Hope this helps

regards

Dev

 

 

 

0 Kudos
Message 3 of 10
(7,410 Views)
Greetings;
At the end of all the acquisitions, when one has collected all the data in LVM or binary format....can I then save it in ASCII format to view in Excel?
 
That is, is there a utiility or vi that converts the LVM or binary file to ASCII, so that it can be seen outside of Labview?
0 Kudos
Message 4 of 10
(7,360 Views)
Clarification:  LVM is a tab separated text file format.  As such, it is unsuitable for high-speed use or large amounts of data.  However, since it is a standard text file, it can be read unmodified by Excel and virtually anything else.  It is great for about 75% of most uses.  When you need high speed or large amounts of data, try NI-HWS or TDM binary.  Use the former if you need to interact with any of the instrument soft front panels or waveform editors, or any analysis program (e.g. Matlab, Mathematica) that supports HDF5 (the root technology of HWS).  Use TDM if you want to import to DIAdem or Excel for further analysis.  HWS does not have an Excel plug-in.  Use this plug-in to use TDM in Excel.
0 Kudos
Message 5 of 10
(7,353 Views)

A very old post, but I have a question regarding sampling rate and samples to read. Now, I have 3 analog channels reading voltages. USB 6008 has a max sampling rate of 10KS/s.

 

My acquisition vi acquires data at a particular sample rate 1.5KS/s. I read 500 samples. Now, is this read samples per second or per iteration time. My acquisition vi has a 25ms timer. My main vi that gets these values has an iteration time of 100ms. Now how does all of this affect my reading. Will there be any buffer overflow or something?

 

Let me know if I go this correct.

If sample rate is 1500Hz and I read 500 samples with iteration rate of 1s, then it would take me 3 seconds to read the entire buffer of 1500 samples until the buffer is updated. So, I am in effect reading past values that have been stored in the buffer.

 

Now, sample rate 1500Hz and I read 500 samples with iteration rate 100ms, then would I be reading values that dont exist?

 

What is the correct combination I need to use to not see errors.

 

VJ

I may not be perfect, but I'm all I got!
0 Kudos
Message 6 of 10
(6,842 Views)

Hi.

 

When you tell the VI to read 500 samples, it is per iteration.  It will not read samples that do not exist.  It will wait until there are 500 samples to read in the buffer.

 

If you do a finite acquisition of 1500 samples at 1.5kHz sampling rate, and you read 500 samples with an iteration rate of 1s, it will take 3 seconds to read your entire acquisition.

 

However, if your 1.5kHz acquisition is continuous instead of finite, your sample buffer will overflow eventually, since you are putting in 1500 samples per second, but only reading 500 each second.

 

I am not sure what the requirements of you application are, but in general, you do not need to add timers to your loops.

Since the VI that reads will wait until there are 500 samples, then if you are acquiring at 1.5kHz, the loop will automatically execute every 1/3 second.  Even if you put a 25ms delay in there, the read samples VI will wait until there are 500 samples.

 

Hope this helps.

 

AlejandroZ

0 Kudos
Message 7 of 10
(6,829 Views)

Hi,

 

Very old post, i'm sorry, but i need some more (again) clarifications !

 

Suppose my acquisition is set to 1500 samples per second , and my number of samples to read at 500. All the 1/3 second my while loop will  "read" these 500 samples and empty the buffer .

This is certainly a stupid question , but, if I wire my DAQ with a digital indicator , among these 500 samples , what the indicator will show me ? The final value ?
Or a mean ?

Because if it's the final value, what's the utility of reading 500 samples ?

 

Second question: if i have multiple daq on my while loop, i'll be lilting/slow down by the slowest acquisition card ? 

 

Third question, setting "continuous sample" is good to avoid buffer overflow or it's still possible ? (because i don't know how)

 

 

Thank you very much and sorry for the old post

 

Erwan

 

0 Kudos
Message 8 of 10
(5,362 Views)

A numeric indicator will show you the last value read because it can only store one value at a time; the use of reading more samples is for datalogging and graph purposes, for example if you are logging the data to a non-volatile storage such as a .tdms then said 500 values may contain information that has relevance to your measurements, which is why read VIs have the option to deliver data in n-dimensional array form

Message 9 of 10
(5,356 Views)

Understood ! Thank you ! 

Erwan

0 Kudos
Message 10 of 10
(5,339 Views)