From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Read voltage and process realtime.

I have a PCI-6251 DAQ card and the DAQ Documentation and SW Combo kit.
 
I would like to write a Visual C++ program to read an analog voltage and process that voltage realtime.
 
I noticed the function DAQmxReadAnalogF64.  But it seams that I can only process the readArray after it is filled.
 
How do I read one analog input sample?  So that I can process it immediately.
 
Thanks,
 
Kevin
0 Kudos
Message 1 of 3
(2,697 Views)

Why don't you just use 1 for the numSampsPerChan?   I have to warn you though if you do that you won't be able to run at very fast rates in your application.

 

StuartG

Message 2 of 3
(2,687 Views)

Hi Kevin,

Just to add to Stuart's suggestion, please take a look at the DAQmx C examples that install with the driver located at C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C on your computer.  In particular, navigate to Analog In >> Measure Slow Varying Signal >> One Sample. 

Thanks!

Laura

 

Message 3 of 3
(2,675 Views)