To download NI software, including the products shown below, visit ni.com/downloads.
Overview
This example shows how to change the sampling rate while acquiring data.
Description
The sample rate is initialized at 1000 Hz. In order to change the sampling rate while acquiring data, the task must be stopped, the sample clock must be reconfigured and then the task must run again. This VI achieves this through the advent of an event structure which performs this every time that the rate control experiences a value change. After a timeout of 10ms, data is acquired continuously at this new sample rate, until another value change occurs at the rate control.
Requirements
Software
Hardware
Steps to Implement or Execute Code
Additional Information or References
The following image displays the event that occurs when a value change occurs on the rate control:
The following image displays the event that occurs when no value change occurs on the rate control:
**This document has been updated to meet the current required format for the NI Code Exchange.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
Is possible to do this without interrupting acquisition? Like use external sample clock on M series board? I try change AI sampling rate on the fly using external sample clock but it didnt work well thanks. 🙂
how about the time between stop and restart,
do I know if the interval of timing between the last point of fast sampled data and the first point of slow sampled data?
from what I understand, the time stamp it the timing when computer read in the data.
I am using USB-6002.
Do you have any example on how to do this (change sampling rate) in C#? Thanks.