Multifunction DAQ

Showing results for 
Search instead for 
Did you mean: 

DAQ assistant: Continuous Samples vs. 1 Sample On Demand?

I'm not sure whether to use "Continuous Samples" or "1 Sample (On Demand)" in DAQ assistant for my application.


I'd like to read 6 analog voltages from a force sensor, perform a calculation on those voltages, then output a single analog voltage to the analog input on my motion controller card. So the force sensor becomes the analog feedback for my axis. I'd like for this to happen at a rate of at least 100Hz. I'm currently getting only 280Hz from the VI shown below (does that VI look reasonable?)


I configured DAQ Assistant to read "1 sample on demand" and put that in a while loop. So each iteration of the loop it takes one reading of the 6 voltages, does a calculation, then updates the analog out voltage.


Would there be a way to use the "continuous samples" option to speed it up? I'm a little confused as to how Continuous Samples works.


My hardware: PXI7358 motion card, PXI6363 X-Series DAQ, PXI6221 M-series DAQ.


Thanks for your help.



0 Kudos
Message 1 of 2

Hi Matthewg,


in general your approach is definitely not ideal for the deterministic behavior of your control loop. Are you running this code on Windows? In this case the loop timing is not deterministic, resulting in non-deterministic delay and jitter of the complete control process.


With this said your vi itself still provides a lot of room for optimization and you should be able to improve the loop rate and the overall control behavior by switching over to single sample hardware timed AI and AO operations. Please refer to the screenshot in the "PID Control with LabVIEW and NI-DAQmx" section of this tutorial


Again, even with this improvement there is still a big chance that the control behavior get's disturbed significantly by other processes if you are running this application under Windows. LabVIEW real-time is highly recommended for thsi type of application


Kind regards,

Jochen Klier

National Instruments

0 Kudos
Message 2 of 2