Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

6008 analog inputs and hardware timing

I have a USB-6008 to which I have hooked an angular rate sensor.  Within a WHILE loop I grab one sample, point-by-point integrate, chart the resulting angle, wait until next 10 ms multiple, then repeat the loop.  This gives me 100 Hz sampling rate however this is software timed since the DAQ VI is set for one sample on-demand.  Any error in this timing will accumulate in the integrator.  The DAQ VI gives an error if I set it for one sample, 100Hz hardware timed.  Does the the 6008 use a harwdare timer for sampling?  Maybe it just can't do it for one sample?
 
If I set it for 100 Hz rate and 10 sample buffer, I can read the buffer and pull out a 10 sample array every 100 ms.  Can I assume when I call the DAQ VI again I will read out the next 10 samples; does it have a FIFO and if so how big?
 
I need at leat a 10 Hz real time rate to update the chart.  I would prefer 100 Hz sampling rate to minimize aliasing.  However I can't miss any samples and they have to be timed accuratly or else my error will compound.
 
Thanks
 
 
0 Kudos
Message 1 of 4
(3,736 Views)
Hey Madengr,

Thanks for contacting National Instruments Support.  According to the USB-6008/6009 specifcations, which are in the user manual, you can see on page 19 that there is a max 10kS/s timing engine for the 6008 with an onboard FIFO of 512Bytes.  If you acquire with a specified timing rate and get a few samples from the buffer you will not lose any samples.  However, you must be sure to get enough samples from the buffer to avoid a buffer overflow.  A good rule of thumb is 1/10th.  So if my sampling rate is 100Hz, then getting 10 samples should be sufficient.  This is what you suggested, so you should be fine. 

So in answer to your question.  Yes, there is a FIFO, Yes it will get the next 10 samples, and No, you will not miss any samples.

Let me know if you have any questions, or if I can be of more help.

Regards,
Kenn North
Principal Product Manager - Search, Digital Analytics
http://ni.com/search
Message 2 of 4
(3,713 Views)

Thanks for the info.  I guess I should read the manual more in-depth.  I was able to get the sampling working the way I wanted too.  If I set up the channel with the following config I can then, after starting the task, read 1 sample for each iteration of a WHILE loop and it is harwdare timed.

On another note, can I set up digital I/O on the same task that I use for the analog channels?  I tried it but I get errors so I think not.  I suppose I will have a separate task for analog input, digital input, and digital output.  Each task is setup in it's own VI, similar to what you get when you generate code from the Express VI.

 

 

0 Kudos
Message 3 of 4
(3,701 Views)
Hey madengr,

Tasks are type specific.  So an with an analog in task you can reads, and with an analog out task you can writes.  Digital is a bit different as you can do a write then a read of the same channel under certain circumstances.  Be sure to take a look at the examples in the example finder for DAQmx.  You can look in Hardware Input and Output >> DAQmx. 

Let me know if you have further questions.

Regards,
Kenn North
Principal Product Manager - Search, Digital Analytics
http://ni.com/search
Message 4 of 4
(3,691 Views)