LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NI-9208 with DaqMX analog read very slow

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.

 

Capture.JPG

0 Kudos
Message 1 of 10
(4,262 Views)

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.

0 Kudos
Message 2 of 10
(4,251 Views)

Still getting 150+ ms Read Time.

 

Capture.JPG

0 Kudos
Message 3 of 10
(4,235 Views)

What about also moving the property node for timing mode and the clock set VI out of the structure?

0 Kudos
Message 4 of 10
(4,219 Views)

No change

0 Kudos
Message 5 of 10
(4,213 Views)

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.

0 Kudos
Message 6 of 10
(4,181 Views)

ian99rt a écrit :

Still getting 150+ ms Read Time.

 

Capture.JPG


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

Message 7 of 10
(4,134 Views)

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.

 

Capture.JPG

0 Kudos
Message 8 of 10
(4,078 Views)

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.Capture.JPG

0 Kudos
Message 9 of 10
(4,049 Views)

@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

0 Kudos
Message 10 of 10
(4,042 Views)