03-03-2021 12:57 AM
I use HW timed single point mode to do some operations.
I want to achieve a sampling rate of 5k. But now it is only 1k and error-200714 will occur.
the error-200714 told me: Reduce your sample clock rate, the number of channels in the task, or the number of programs your computer is executing concurrently.
Is there something wrong with my program?
Is there a way to make the sampling rate faster?
Thanks!
03-03-2021 01:37 AM
Hi Max,
@MaxPan wrote:
I use HW timed single point mode to do some operations.
I want to achieve a sampling rate of 5k. But now it is only 1k and error-200714 will occur.
On a default Windows computer it will be hard to impossible to reach a sample rate of 5kS/s by reading single samples!
And when you want 5kS/s sample rate then you should not set it to just 1 kS/s…
@MaxPan wrote:
Is there something wrong with my program?
Is there a way to make the sampling rate faster?
It's wrong to read just one sample after the other for such sample rates.
You can get higher sample rates once you read multiple samples per DAQmxRead call…
(Did you examine the DAQmx example VIs coming with LabVIEW?)
03-05-2021 02:58 AM
I have reference DAQmx example.
but the error-200714 still happens.
03-05-2021 03:22 AM
Hi Max,
did you read the error explanation?
Did you try some lower sample rates?
Which kind of hardware do you use?
What happens when you use "1 sample on demand" software timing?
What's the reason to choose "hw timed single point" mode?
03-05-2021 09:29 AM
If you're running in Highlight mode you'll fill the buffer and get an error asking you to slow down ...
03-05-2021 10:26 AM
Very general thoughts & suggestions:
1. "Hardware Timed Single Point" is almost never the right choice when running under Windows. It's probably only worth considering under RT.
2. It looks like you're trying to run a control loop at 5 kHz. What's the process you're trying to control? Most commonplace things don't have the inherent response bandwidth to *need* 5 kHz control.
3. You could perform AI *sampling* at >5 kHz, but you shouldn't expect to *iterate* your control loop at 5 kHz. Higher-speed AI sampling is done with a hw-clocked buffered task. You request a block of samples at a time (i.e., you don't *iterate* at the same rate you *sample*) and this adds *latency*. The first data in the block represents what was going on a little while earlier.
4. This will be where you make tradeoffs. A hw-clocked buffered task gives you regular sample timing but more latency. A software-timed unbuffered task gives you sample times that are subject to Windows timing irregularity, but generally lower latency.
5. The output task should change to on-demand software timing. (You do this by removing the call to DAQmx Timing.)
6. So now your control loop will run:
- slower but at a more consistent rate if you read same-sized blocks of data from a hw-clocked buffered AI task
- faster but at a more variable rate if you read single samples from a software-timed AI task
-Kevin P
4.