Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Important problem

Sir  i m getting analog data from the daq 6025E The analog input is taken  from scu.I have started my application which starts continous scanning in the double bugffer at the rate specified in the code attached.I have set the buffer of two minute So after exact one minute the ready flag should be on But it is not so ......why....please tell.
you can run my code and the read rec.txt  you will see the timing of the ready on flag after every minute You will see that after every minute ready flag is on almost one second later.So after half an hour of the running application you will see that this gap will be larger from the start that is not accept able ....please reply as soon as possible
                                        ajmal
Lead Data Scientist
0 Kudos
Message 1 of 5
(3,142 Views)
Hi ajmal,

I tried opening up the code that you sent, but there is a whole lot of information and different files in there and I was unsure as to what piece of code I should even look at.

First I would recommend taking a look at some of the continuous acquisition examples found here:
C:\Program Files\National Instruments\NI-DAQ\Examples\VisualC\Ai

See if you can get those examples to work correctly, if so then you should be using the code properly.  If you want a flag to be thrown every minute then it's simply a matter of knowing the number of samples being read, the rate, and the number of iterations it will take to get to one minute's worth of data.

If you can get the examples to work and you can get a flag to work with the above method, but are still having problems with your code, then please try to break it down to the simplest example possible involving only one file, a simple continuous read and simple flag thrower.

Another thing to keep in mind is that your code is using the Traditional DAQ calls.  You should definitely take a look at some of the DAQmx examples as they are a lot easier to understand and use:
C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Analog In

Regards,
0 Kudos
Message 2 of 5
(3,116 Views)
 
Lead Data Scientist
0 Kudos
Message 3 of 5
(3,100 Views)
Hi sir thanks for repying
I have sent u the single file code above.Please compile and run the code on PCI-6025E driver version 6.9.2 or 7.4 please run this application about half an hour and note the time when ready flag is on.
i m printing  the time when daq starts scannig Please note this time and after one minute when the ready is on i also print this time on the screen.sir u can observe after every minute the ready flag doesnot on after the exact time Out put will be like that:
Start scan time 12:00:00
1 Minte data acquire 12:01:01
2 Minte data acquire 12:02:01
3 Minte data acquire 12:03:02
4 Minte data acquire 12:04:02
5 Minte data acquire 12:05:03
6 Minte data acquire 12:06:03
7 Minte data acquire 12:07:04
8 Minte data acquire 12:08:04
Please debug this problem and tell why this behave like the above out put But i want the out put like this all the time while the application is in running state:
1 Minte data acquire 12:01:00
2 Minte data acquire 12:02:00
3 Minte data acquire 12:03:00
4 Minte data acquire 12:04:00
5 Minte data acquire 12:05:00
6 Minte data acquire 12:06:00
7 Minte data acquire 12:07:00
8 Minte data acquire 12:08:00
 and so on............
 i m waiting ur reply
                             ajmal
Lead Data Scientist
0 Kudos
Message 4 of 5
(3,100 Views)
Hi ajmal,

Could you please try using this example program:
C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Analog In\Measure Voltage\Cont Acq-Int Clk

I ran the same example in LabVIEW and was able to get timestamps that were accurate to about 14 decimal places between flags.  This should give us a baseline, because we know that these values are correct and what are expected.  Attached is the LabVIEW code.  The code works the same either way, but it's faster for me to make a prototype in LabVIEW than to try and do the same in C++. 

Basically if you know that you are reading say 100 samples at a rate of 1000 Hz, then you know that every 10th read is 1 second's worth of data.  You can then throw that timestamp into an array or text log of the data.

Regards,
0 Kudos
Message 5 of 5
(3,083 Views)