03-20-2018 02:07 PM
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
Solved! Go to Solution.
03-20-2018 02:34 PM
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.
03-20-2018 02:41 PM
Doh! And I spent two hours trying to figure that out. Thanks for the easy fix.