02-19-2016 01:50 PM
My attached VI takes around 150-170ms to complete. By my scan rate and sample size it should take around 10 ms.
Adding the channel property node: AI.ADCTimingMode to High Speed removed approx 100ms of delay (250-280 ms previously).
I'm trying to get my main program to read approx 8 channels between various modules (mA, VDC, and RTD) at 25+ Hz.
02-19-2016 02:04 PM
Move the "Create channel" and "Clear task" VIs out of the timing section.
If you want to do this at 25 Hz you don't need to constantly create and clear the same measurement. Create the task outside of your For or While or Timed Loop structure, do the measurements inside the structure, then clear the task once the loop concludes.
02-19-2016 02:49 PM
Still getting 150+ ms Read Time.
02-19-2016 03:03 PM
What about also moving the property node for timing mode and the clock set VI out of the structure?
02-19-2016 03:07 PM
No change
02-19-2016 10:36 PM
Why do this in a sequenced structure? If you go to the Help menu, select "Find Examples...", then select HArdware Input and Output/DAQmx/Analog Input/Curren - SW-Timed Input.vi you should see a good example of what to do. I do it that way and can reliably get 500 Hz with a loop that does a lot more than just read current.
02-20-2016 02:11 PM
ian99rt a écrit :Still getting 150+ ms Read Time.
That's because you're using implicit state transition. When you are not setting the states explicitely with DAQmx Control Task.vi the task will have to go throught the following states: unverified to Verified to Reserved to Commited and finally Running. Have a look at this thread where I explain in more details these transitions. If you move the DAQmx property node and Sample Clock.vi before the sequence and add Control Task.vi set to Commited after SAmple Clock.vi you should see an improvement.
Ben64
02-22-2016 10:18 AM
Adding the DAQ Control Task to "Commited" got the read time down to 36ms with a sampling rate of 4000, and sample size of 2. With values shown I'm between 51ms and 69ms.
Now I'm trying to reconfigure to read multiple channels with the same Daqmx Virtual Channel call.
02-23-2016 02:32 PM
I was able to get my data acquistion below 100 ms by changing the DaqMX Timing to Continuous and linking the sample size to DaqMX Read.
02-23-2016 03:11 PM
@ian99rt wrote:I was able to get my data acquistion below 100 ms by changing the DaqMX Timing to Continuous and linking the sample size to DaqMX Read.
Usually in continuous input mode you put the DAQmx Read.vi in a while loop and you start the task before the loop. Check the Current-Continuous Input.vi example Help -> Find Examples ... -> Hardware Input and Output -> DAQmx -> Analog Input).
Ben64