LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

real time acquisition

Hello,

I'm actually trying to acquire 2 AI Voltages signal in real time with a PCI 6221 (250 KS/s). With this samplig rate, it should be possible to have a measurement every 4 µs .... In order to do this, i use the fonction DAQmxReadAnalogF64 in a while loop as shown in NI example. But in this code, the measurement take at least 30ms.

An other problem, if that if i could do a measurement every 4µs the clock() give me time at +/- 1ms.

I have 2 request :

- Could I do a real "Real time" measurement using the maximum sample rate of the PCI 6221 ?

- How could I date my sample under the ms ?

Thank you in advance.

Best Regards.

Raphael Beck
0 Kudos
Message 1 of 2
(3,167 Views)
Hi Raphael,

To address your questions re: the PCI 6221 M Series multifunction DAQ board:

1) The maximum sample rate of this board is 250 kS/s. This means that you are correct in that the maximum time between samples is 4 us. However, since you are collecting on 2 channels, the maximum rate per channel will be halved, so you will only be able to collect 1 sample per channel ever 8 us.

2) You don't need to create two separate channels for this acquisition. You can create 1 task, and add both channels to it simply by changing the channel string from "Dev1/ai0" to "Dev1/ai0:1".

There is a shipping example included with the NI-DAQ 7.4 installation which details exactly how you can do this.

The reason that you were not seeing samples Your code was not using a particular function to set the timing of the acquisition: "DAQmxCfgSampClkTiming".

To add a timestamp to your data, you could record the tick count at the beginning of your acquisition, and since you know the sample rate, it would be a simple task to correlate each sample to the initial start of the acquisition.

I have attached the shipping example for your perusal.

Good luck with the rest of your application!

Best Regards,

Evan R.
Applications Engineer
National Instruments
http://www.ni.com/support
Message 2 of 2
(3,141 Views)