Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Fastest Realtime Analog Acquisition?

We are using a DaqPad 6016 to emulate some hardware.  I am monitoring 2 Analog inputs and controlling 2 Analog outputs.

When the inputs are high,  I step increase the voltage of my outputs.  The application on the other end is watching my steps, and when I output the correct voltage, it stops driving the input.

I need this loop to run as fast as possible.
1. Read the inputs.
2. If input1 is high enough, increase output1.
3. If input2 is high enough, increase output2.

I have been using on demand timing, and have noticed that my call to ReadSingleSample is too slow for this application (~100ms).

I have used buffering, but I always ended up reading old samples, ie I am getting high voltage when the other application has already turned off that input.

Is there a way to speed up on demand timing.  Or is there a way to turn on buffering, but have the call to read the value just return the latest?

Thanks in advance for your help!
0 Kudos
Message 1 of 2
(3,064 Views)
Hello Lokimon,

On-demand timing is usually slower than using sample clock timing, because the first is software timing while the second uses hardware timing.  For your application, where you are just interested in the last data point, using sample clock timing with a 1 Samp read VI would make the most sense.  This would sample using hardware timing, which is more accurate than software timing, and you would return the last point. 

I would recommend looking at the Cont Acq&Graph Voltage-Int Clk shipping example as an example.  This will show you how to setup sample clock timing using the DAQmx Timing VI.  It will also show how to start and stop a continuous task, which will also be important for your application - for reasons explained in this KnowledgeBase.

Post again if you need any further questions.
Micaela N
National Instruments
0 Kudos
Message 2 of 2
(3,048 Views)