How to Dynamically Change the Sampling Rate of a DAQ Assistant?

Updated May 3, 2018

Reported In

Software

  • LabVIEW Base

Driver

  • NI-DAQmx

Issue Details

I am using the DAQ Assistant Express VI inside of a while loop to acquire a distinct set of finite samples for each iteration of the loop. I would like to change the sampling rate of the DAQ Assistant for each while loop iteration, how can I accomplish this?

Solution

Because of the DAQ Assistant does not stop the task it creates until a true is wired into the stop terminal, the task must be stopped to change properties such as the sampling rate. You can use the DAQmx VIs to stop the task, and then change the sampling rate. The DAQ Assistant will restart the task automatically.



This can also be accomplished by using the DAQmx driver VIs exclusively. Numerous DAQmx example programs are available in LabVIEW under Help»Find Examples to help get started programming with DAQmx.

Additional Information

If you are trying to use this example code for a continuous acquisition, data points will be lost in between iterations of the while loop.

WAS THIS ARTICLE HELPFUL?

Not Helpful