LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

optimum number of samples per iteration

I am running PXI-6251 at 500KS/s, 5000 smaples per iterations. I want to understand why do I get the following message if I run slower or acquire fewer samples per iteration? I would have thought the latter would have required less buffer size- a simpler thing to handle!?

 

Possible reason(s):

Attempted to read samples that are no longer available. The requested sample was previously available, but has since been overwritten.

Increasing the buffer size, reading the data more frequently, or specifying a fixed number of samples to read instead of reading all available samples might correct the problem.

Property: RelativeTo
Corresponding Value: Current Read Position
Property: Offset
Corresponding Value: 0

Task Name: _unnamedTask<1>

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

You are not reading fast enough.  The DAQ card only has so much memory on it.  When it reaches the end of the memory, it overwrites what was there previously.  If you didn't get the data before it was overwritten, you get this error.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 5
(3,075 Views)

Great! Could you refer me  to some white papers in this regard, please?

0 Kudos
Message 3 of 5
(3,064 Views)

The kb paper is based on the old Traditional DAQ, but the concepts are the same.

http://digital.ni.com/public.nsf/allkb/CEC4263BC5D02DA88625737D006FE5EE

 

EDIT:  I should have checked the links on the bottom before posting.  There's one on the DAQmx API

http://digital.ni.com/public.nsf/allkb/A224DA0551EEA073862574F60060AB6F?OpenDocument


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 5
(3,060 Views)

If you are using LabVIEW 2012 then it comes with a really nice template for DAQmx continuous acquasition that I recommend learning about and using.

 

In general, these are good practices to follow:

 

* Let the DAQmx Read operation control the execution speed of a "DAQ loop".  Set these appropriatly.  I like my DAQ loops running every 100ms, so I setup my continuous DAQ's sample frequency is number of samples so that this loops runs at that speed.  For example sample frequency = 1000Hz, number of samples= 100 will make my DAQ loop operate at about 100ms per itteration.  Do not place "Wait (ms)" VIs in the DAQ loop.

* Dedicate a loop (or thread) to DAQ and perform processing in another "consumer" level loop.  Transfer data with queues or notifiers.  This is all in the template I reference above.

0 Kudos
Message 5 of 5
(3,052 Views)