From 12:00 AM CDT Sunday, October 17 - 11:30 AM CDT Sunday, October 17, will be undergoing system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.


Showing results for 
Search instead for 
Did you mean: 

USB 6251 2- channel simultaneous sampling

I am using USB -6251 card for acquiring data from two channels. And then I do substract both of them and make differential measurement. However, I got two channel data out of phase. Even I split same signal to two channels and substraction is not zero.  I used AI0 and AI7 and use APFI0 as external trigger.

I am wondering if the two channel sample data at the same time or there is time difference in sampling between two channels. Is that the proper way to do differental measurement by substracting data from two channels.



0 Kudos
Message 1 of 20

In addtion, when I send a sine wave into two channels, the phase shift increases with frequency. AT 1 kHz, it looks OK, but at 100kHz, the substraction is far from zero (can be 6 v with input 10 v magnitude). I am wondering  it is sampling rate issue (500kS/second each channle) or it is sampling isuue from different channel. Please help

0 Kudos
Message 2 of 20

The 6251 is not a simultaneous sampling board and you are not at all correct in your method of a differential measurement. Since there is a single convert clock and all inputs are multiplexed, there is a finite delay between the samples. In the DAQ Assistant (which I assume you are using), simply select Differential as the terminal configuration. This will automatically pair the input channels. For example, ai0 is paired with ai8. You only select ai0 though. Wire per the instructions in your manual.

0 Kudos
Message 3 of 20

interesting comment. I found that ai8 does not exist on USB-6251. 

0 Kudos
Message 4 of 20

Hi arienai,


according to the manual there exists an AI8 pin in each version of the 6251 DAQ card.

Please read again!

Best regards,

using LV2020 on Win8.1+cRIO
0 Kudos
Message 5 of 20

Thank you GerdW, yes, in the documentation Ai8 exists. Now, what I want to say (and maybe it is the same concern as for the person who started this topic) is that Ai8 is not physically existing as a BNC connector on the DAQ 6251, as you can see on the same documentation, and as I can see on my DAQ here. Therefore, it is a little bit difficult to understand why there is Ai8 since there is no physical connectors (BNC or else). Anyway. I want to thank you very much for your support and always interesting comments, it is very useful, always. 

0 Kudos
Message 6 of 20

Look at this link


AI <0..7>


Analog Input Channels—For differential measurements, the BNC pin and shield are the positive and negative inputs of the differential analog input channel. Refer to the M Series User Manual for information about the FS/GS switch selection and single-ended measurement options.




ps out of curiosity if you use the property nodes in DAQmx to list all of the physical channels, does it list one greater than ai7.

0 Kudos
Message 7 of 20

Just made a virtual USB-6251. When I query the physical channels I get all 16 of them, even though there are only 8 BNC inputs on the USB-6251.


Even though the ai8 channel is not on the BNC device, you can still get information from it. See this post. So if you set up your channels correctly, it shouldn't matter.


I agree that it is confusing to list 16 channels when a device only has 8 BNC inputs on it, with no additional screw terminals that give access to the other channels. Maybe there is a way to query this programmatically?


Below is a picture for those who are unfamiliar with the device.






0 Kudos
Message 8 of 20

Following this topic, and linked with "trigger detection - DAQ Assistant - NI USB 6259" on the forum, I would like to combine those topics and describe what I would like to do, to get some advices. 

 I wrote a .doc document with the aim of my application. I am using only 1 NI USB 6251. So I am not asking anyone to make this vi for me. I am just asking about the strategy to achieve it. I hope in a next post, I could be able to show you an example resulting of your advices. This is a way for me to learn how to use a DAQ because it is the first time, even I am using tabview for 10 years. 


Main : I would like to output a signal on Ao0, read the output signal together with 2 inputs Ai0 and Ai1, with finite number of samples, but in a synchronized way, and with a sampling rate that is faster than the generated Ao0 signal. 


The output signal Ao0 is typically a triangle signal, and the typical period is 100sec. Amplitude is 1V/-1V on 1 period. There are about 1000 samples #s on 1 period.

This can be generated easily using  the from "trigger detection - DAQ Assistant - NI USB 6259". But in reality my function is more complex than a triangle and in the example "", it is generated with the assistant signal generation block, that I cannot use here. Instead, I am using

The input signals Ai0 and Ai1 are 2 voltages (but not a differential measurement). 


Because I want to make statistics for each value of the output signal, I need to have a faster sampling rate for reading. This is one option. Another option is to generate the function with including the steps (repeated values in between 2 amplitudes) rather than only point-per-point. In that use, I could read each point of the function without redefining a sampling rate. I am not sure it is a good option. 


Question 1: the output signal Ao0 is generated by the DAQ itself. Do I need to physically connect this output to an input in order to READ this value ? I think yes. This is because I am not sure that the DAQ will output exactly the amplitude I want, there are error bars somewhere and this is what I want for all signals I am measuring. 


Question 2 : I want to read Ao0, Ai0, Ai1 on 1 period only in a synchronized way. This is finite sample measurement case. I want to start this reading with a button "start" and end reading automatically when the period is completed. I have problem to define the clock and trigger to synchronize those reading. Is there any example of finite sample readings ? Most of examples are based on continuous signals. But here, I need to start/stop reading when I want. I mean 1 period must be finished before starting another one. Also my function is not periodic 2*pi.F but it is an arbitrary function starting at t0 and ending at t0+1*period. 


Question 3: To go further, I will add a for loop in order to repeat the output signal and append all measurement N times all on the same graphs (Ao0, Ai0, Ai1). Should I make this for loop to repeat measurements, or should I create the output signal already with the N repeated periods ? I believe the problem could be the resolution limit on each channel due to the number of data in the buffer of the DAQ ?

So I feel that including a for loop might be enough good to retrieve the data in the buffer for 1 period only, then clear the buffer, then read again ... N times.  


I am using a producer-consumer architecture to make this application, and I don't like so much to add a for loop, but I think that with a kind of counter (1 to N), it should be fine. 

0 Kudos
Message 9 of 20

Search the forums for posts by @Kevin_Price. He is a DAQmx savant, and has written many post about synchronizing inputs and outputs. He has also posted quite a few examples.



0 Kudos
Message 10 of 20