02-14-2018 11:15 AM
Hi everyone!
I am trying to sample voltage on 8 AI channels using NI-9205. All the channels are connected differentially and all are sampling "at the same time".
The challenge is to be able to change the AI input range in some channels to either i) gain resolution or ii) avoid oversaturating the ADC at a certain point in time.
I have been able to achieve this by using the attached VI, but I think this slows down the rate of data sampling. Is there a more efficient way to dynamically set the AI range on multiple channels? At 30k sampling rate with 100 samples per channel to collect, each loop should take approx 27ms (8 channels x 100 samples)/30000kHz = 0.027sec. Unfortunately, with the way my VI is arranged, it takes about 100ms
Is there a way to speed it up?
Cheers!
Solved! Go to Solution.
02-14-2018 11:25 AM - edited 02-14-2018 11:26 AM
Hi retro,
at 30kHz samplerate I would expect a loop iteration time of 100 samples/30kS/s = 1/300s ~= 3.3ms…
Is there a way to speed it up?
No.
Creating a new task, setting up all channels, setting sample rate, starting the task, doing the reading and stopping the task will take its time…
Your example is quite bad: you constantly create a new task, but you don't clean up that task! This is a NO-GO!
02-14-2018 11:43 AM
Indeed, this was the only way that I could find to change the AI input range of each channel automatically.
Is there a better way to change the AI range of each channel without Starting and stopping the task?
Also, what do you mean by clening it up?
Many thanks!
02-14-2018 11:56 AM
Hi retro,
Is there a better way to change the AI range of each channel without Starting and stopping the task?
No.
Also, what do you mean by clening it up?
In each iteration of the loop you create a new task, do some work and stop the task. But you don't call DAQmxClearTask…
02-14-2018 12:11 PM
Ok, many thanks, Gerd!