Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx timing issues (USB 6008)

Hello all. I have an application made in Labview. In it the main loop is a while-loop that includes DAQmx read and write functions. The purpose of this program is that it polls information from a file, which is written to by another program (so there are some file I/O functions in the loop as well).
 
function of the loop:
every 50 ms:
read file, read 4 analog inputs. Do stuff with these new data.
 
every 5 ms:
manipulate and write new data to digital output port.
 
Now the problem is that when I run these two programs together the Labview application slows down. What I want to happen every 5 ms happens about every 70 ms. Giving Labview higher priority in task manager helps alot, but slows down the other program. Also removing the DAQmx functions from the loop helps significantly, so I think they require alot of cpu.
 
My question is do you have a suggestion to improve the performance of my application? I can only select "1 sample (on demand)" from the DAQ assistant as the task timing choice (USB-6008 is not supported for N samples).
0 Kudos
Message 1 of 3
(3,288 Views)
The best thing you can do to improve the efficiency of this program is to use the actual DAQmx VIs in LabVIEW to do your data acquisition.  Express VIs are great for setting up simple acquisition, but they can also add function calls that you may not want to run multiple times.  I would suggest right clicking on that express VI and selecting generate DAQmx code to get a look at what the express VI is really doing.  It will generate a configuration VI that you should look at.  Since you are running in a loop, you would want this configuration to be outside of the loop.  Your program should be set up to create the channel, set up the timing, start the hardware acquisition, and then in your loop, you will read the data out of the hardware buffer.  I would also suggest looking at some of the example VIs in the example finder and studying how they work.  Finally, take a look at this page:
 
 
It's a great page that describes the most important DAQmx VIs that you will use. 
 
Have a great day,
Brian
Brian Coalson

Software Engineer
National Instruments
Message 2 of 3
(3,282 Views)
I'll give that a go an get back, hopefully with some more promising results. Thanks
0 Kudos
Message 3 of 3
(3,063 Views)