Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

ni 9205 + DAQmx examples

Hi.

I'm new in using NI devices in my C projects..

I'm running standart NI DAQmx examples for voltage measuring, but after DAQmxReadAnalogF64 or at every iteration of EveryNCallback the buffer contains only about a 1/3 of elements filled with real input data, and the others are filled with some random values, usually about 2e+308.

Also, voltage generation with 9263 works fine (they both are connected to the PC with one cDAQ-9172).

In LabVIEW both devices work well, as they are supposed to..

What can the possible reason of this?

0 Kudos
Message 1 of 4
(3,568 Views)

ieroglyph,

 

Thank you for using the forums.  I have been I able to do a few tests and I believe I know the reason why you are getting that bad data.  I think it has to do with you samples to read.  If your samples to read is less than your buffer than you will get good data for your samples to read and your buffer will then be filled with bad data.  I ran the example first with 1000 as my data and as my samples to read and I received good data, but when I changed my samples to read to 500 then the first 500 samples and the next 500 were -9 e 61 which seems to be on the same plane that you are on.

 

I hope that helps.

 

Brian P.

Applications Engineer
National Instruments
0 Kudos
Message 2 of 4
(3,553 Views)

Thanks for your answer.

I tried your solution, I used number of samples and buffer size both fo equal size,  but bad data is still here, and it is not as you described, good data is destributed by small portions of different size over whole buffer.

0 Kudos
Message 3 of 4
(3,541 Views)

ieroglyph,

 

I went ahead and tried to replicate your system.  I used Cont Acq Int Clk in Visual Studio with the 9205 in slot 1 of the 9172 and I received all good data for ai0.  Is this the same setup that you are using?

 

I think it would be helpful if you could post the code that you are using with where you have all of your breakpoints so I can see the data that you are seeing?  Also when you are looking at the buffer I assume that you are looking at the data local variable, is this correct?

 

Regards,

 

Brian P.

Applications Engineer
National Instruments
0 Kudos
Message 4 of 4
(3,521 Views)