From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx Read slows VI significantly

Solved!
Go to solution

Hello all,

 

I am currently developing control software for a test stand running a life cycle test on a number of pumps. I need to be able to read from both analog and digital sensors as well as write to digital outputs to automatically control the fixture. Up to this point I have simply been simulating the I/O within the software, and everything functions correctly when no hardware is being used. Now, my last step is to connect the hardware to the program. I'm attempting to use DAQmx VIs to read from and write to my compact DAQ cards. My problem is that when I run the DAQmx Read VI, my program slows down significantly. The program loop is set to 50ms, but with the DAQmx Read running, it takes 1-3 seconds to iterate the loop. This is far to slow for the precision control I need for the test fixture. I'm not sure what I'm doing wrong that is causing the program to slow down. It might have something to do with how I have my tasks set up, since I have not done that before.

 

Any ideas how I can acquire a single reading from each input for each loop iteration without slowing the whole program down? I'll keep messing with it and see if I figure out what's slowing me down too. 

 

Thanks for any advice. 

 

- Dylan Howard 

 

Software: LabVIEW 2017

Hardware: NI cDAQ-9189 with NI 9214, NI 9205, NI 9375

 

Dylan Howard
Lab Technologist, Alto-Shaam Inc.
0 Kudos
Message 1 of 3
(2,607 Views)
Solution
Accepted by topic author Dylanh

Setup the DAQ BEFORE your loop.  You are recreating that task every iteration, and that can take a considerable amount of time.  Then you need to make sure you stop and clear the task after your loop.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 3
(2,594 Views)

Doh! And I spent two hours trying to figure that out. Thanks for the easy fix. 

Dylan Howard
Lab Technologist, Alto-Shaam Inc.
0 Kudos
Message 3 of 3
(2,587 Views)