03-12-2019 11:01 AM
Hi,
I'm programming a simple control application in C under Windows, with NI-DAQmx and Visual Studio. Using a USB-6003, the software reads a single value on each of 3 analog voltage inputs, does a bit of calculation and then writes a single value on each of 2 analog voltage outputs, the whole thing in an endless loop.
The excecution time for the calculation, loop overhead and everything else is just a few tens of microseconds. But the DAQmxReadAnalogF64 and DAQmxWriteAnalogF64 commands are taking around 1 millisecond each to execute - which is about 5x slower than I need it to be. I am using DAQmxStartTask before entering the loop.
Is this the best I can do with this hardware, or am I missing something? If the former is true, what direction should I go in to get these analog reads and writes running faster?
Thanks in advance!
Solved! Go to Solution.
03-13-2019 11:09 AM - edited 03-13-2019 11:10 AM
It seems that you are performing some sort of control, that should run live. Normally in this case, one needs a Chassis, like a cRIO or PXI, because they are equiped with controller hardware, on which the VI's run.
With a low cost USB device, calculation and VI execution will take place on your computer in Windows. This means that data is acquired, sent over USB (which is not real-time capable) to the computer, perform calculations and then send some data back to the device for generating outputs. I have tried something similar with a USB-6211 and couldn't get the loop rate lower than 10ms I remember.
03-13-2019 01:35 PM
Great, thanks, that helps a lot.