Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How to determine the internal specifications of NI usb daq 6221

I have a usb 6221 and would like to know how to determine the pre-set internal parameters such as internal clock frequency, trigger type (positive/negative edge), internal resistance, etc.
How should I program the daq assistant to obtain one sample every second, continuously for hours ? If I specify '1' as the frequency and run, it gives me an error.  What am I  missing ?

0 Kudos
Message 1 of 4
(2,583 Views)

Hi Kevind,

If you just want a simple program to acquire one sample per second, there are a couple of options.  First, you could specify in the Acquisition mode to acquire 1 Sample (On Demand) which will just acquire 1 sample every time that the DAQ Assistant runs.  Then you could put a while loop around the DAQ Assistant and add in a Wait Until Next ms Multiple function and wire a constant 1000 ms to the input.  This way, the loop will run every 1000 ms (1 s) and take a sample each time.

Another way to do this would be to use the N Samples option.  Here you will need to set up a rate (1 Hz in your case) and a number of samples that you want to acquire.  This will specify how many samples are being taken into your buffer at each run of the loop. 

Try one of these options and see if this helps.  If not, please post back and give the error code and description.  This might give more insight into what the actual error is. 

In addition, here is a link to the Getting Started with DAQmx series on the website where it explains some of these concepts. Thank you for posting!

Regards,
Vanessa L.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 4
(2,562 Views)
Thanks Vanessa. I used the file i/o to write the acquired signals onto an lvm file. However, the time-instances corresponding to the acquisition arent exactly 1 second all the time. There is around a +- 50 - 100 ms difference between successive readings. What could this be due to ?

Also, Is there a link where I can get info on the default internal settings of the daq card (usb 6221) ?


0 Kudos
Message 3 of 4
(2,553 Views)
Hi Kevind,
 
I worked on your issue a little today and I have a solution.  I have a simple program that just reads samples in a DAQ Assistant and then writes to a measurement file.  I was having the same problem you were having when using N samples in the loop.  I initially set up to read at a 1 Hz rate and then read 10 samples at a time.  The first 10 samples in the measurement file (which correspond to the first loop run), accurately acquired one per second.  However a delay was introduced in the time column when the second iteration of the loop ran.  I figured out this is because of the delay from one DAQ Assistant run to the next.  However, as shown in the attached program, I set the rate to continuous with 1 Hz and 1 sample and it correctly writes to the measurement file 1 sample per second.  Hopefully this example will guide you in the right direction with you program.  I'm not sure what version you are using, so I posted 8.5. and 8.2.  Please let me know if you need another version of the program to run it.  This link is to the 622x specifications.  Please let me know if you need anything else.
Regards,
Vanessa L.
Applications Engineer
National Instruments
Download All
0 Kudos
Message 4 of 4
(2,528 Views)