02-28-2006 04:06 AM
02-28-2006 07:56 AM
02-28-2006 09:02 AM
02-28-2006 09:19 AM
03-01-2006 03:59 AM
03-01-2006 07:41 AM
03-01-2006 08:12 AM
03-02-2006 10:11 AM
Hi Marco,
I benchmarked a similar comparison with an M series device on my Dell 1.8GHz computer using LabVIEW and Windows XP. I found that Traditional DAQ write time was about 15 microseconds and DAQmx was about 19 microseconds. It sounds like your computer may be a little slower than mine.
For digital reads and writes, DAQmx is slightly slower than Traditional DAQ mainly because the API is more flexible. For instance, it allows specifying whether lines are inverted in the channel configuration. Also it allows a variety of reads (port-based, single line, array of lines, etc.), and it allows different port sizes (U32, U8, etc.). Also, it supports multi-threaded access on a per-task basis. These additional features require the implementation to consider more cases, and there is some small amount of additional synchronization overhead. Of course, all this extra flexibility is no good if you don't need it and if what you're most concerned about is performance.
I work on the NI-DAQmx team and we're aware that single point performance is critical. We're experimenting with some optimizations specifically for digital single port reads/writes. Digital single port reads/writes is one case where Traditional DAQ (especially the Traditional DAQ C API) is extremely efficient and it is a hard compare. Single point digital reads and writes are especially critical for control applications where hardware-timed (correlated) digital is inappropriate.
Two other facts to note:
1. Because of the improved state model, DAQmx is overall much faster than Traditional DAQ if you consider all types of driver operations including buffering, single point AI, retriggered AI, multithreaded operation, etc.
2. For the absolute best single point performance with DAQmx, LabVIEW Real-time is the way to go. Using the LabVIEW ETS real-time system, DAQmx can perform a digital port operations in less than 5 microseconds on an 8176 controller, and there is almost no jitter compared with what you get in Windows. The main reason for the improved performance is that the real-time operating system is a single mode OS. There is no user to kernel transition like on Windows. On my Windows XP box, the kernel transition adds about 10-12 microseconds of overhead.
03-02-2006 10:32 AM
03-02-2006 11:21 AM
Hi Graziano,
I haven't been able to to reproduce your problem with Starting two digital tasks.
To reproduce, I created one digital input task with lines 0:3 and one digital output task with lines 4:7, I start both tasks and then I take turns reading from one task and writing to the other. It works fine and my program doesn't hang.
Can you create a single Digital Output task that includes all your digital lines? With a digital output task, the lines are by default bidirectional. You can call DAQmx Read and DAQmx Write on all lines. Also, you can configure the lines for input or output on the fly by setting the channel property.