02-22-2022 12:38 AM
I know that this question asked here multiple times, but I I'm interested in a particular detail. When I use DAQ Read twice first signal is correct. However second signal undergoes aliasing. I want use two tasks because I need Read with different rates. Why is this happening? Both signals are sine and on waveform chart it is clear that the second signal is also a sine, but with an increased period
02-22-2022 06:44 AM
To me it looks like you ran this vi many times without clearing the chart. So the chart shows an *accumulation* of lots of brief bursts of samples of ai2 (a.k.a. "Voltage 4"). The graph shows a *single* burst of samples. In both cases, the behavior is pretty constant and flat over the course of the 100 msec burst. But with the chart and repeated runs, you can see what might be 1/4 cycle or less of a very slow sine wave.
I know of no devices that support multiple distinct AI sampling tasks at a time. I suspect it's likely that you *want* to observe these channels at the same time instead of the one-at-a-time back and forth you're stuck with now.
The approach I'd recommend is different than what you're trying. One option is to just sample at the higher rate and use software-based resampling / interpolation to produce data at the lower rate. Or you could just keep higher rate from both channels even though it's overkill for one of them.
Have a look at the shipping examples too. It's fairly uncommon to need "unreserve", and it isn't even useful to call it before the call to DAQmx Read (which will implicitly start the task for you).
I generally also recommend making explicit calls to DAQmx Start and Stop rather than relying on the auto-start behavior of DAQmx Read. It isn't always necessary, but it's a better habit to establish.
-Kevin P