Discussion:
NIDAQmx calls 40 percent slower than NIDAQTraditional
(too old to reply)
ThinkCentre
2006-06-12 14:40:09 UTC
Permalink
I am porting an application from NIDAQ Traditional to NIDAQmx 8.1 and have noticed some performance problems.  After trying many different methods, I've been able to determine that the best case is a 40% decrease in Digital I/O performance.  Attached is some LabWindows CVI test code used to generate the following results:
 

Test with multiple reads from port 2 followed by multiple writes to port 3 of a 6508 board.
 
10,000 Reads and 10,000 Writes

- NIDAQTraditional < 1 second
- MIDAQmx reusing task ~ 5 seconds
- NIDAQmx creation and destruction of tasks for every operation ~ 149 seconds
- NIDAQmx reusing task with explicit start task < 1 second

1,000,000 Reads and 1,000,000 Writes

- NIDAQTraditional ~ 15 seconds
- NIDAQmx reusing task with explicit start task ~ 22 seconds


NIDAQ_test.zip:
http://forums.ni.com/attachments/ni/70/5033/1/NIDAQ_test.zip
Jesse O
2006-06-13 20:40:11 UTC
Permalink
Hello ThinkCentre,The <a href="http://zone.ni.com/devzone/conceptd.nsf/webmain/ee47b125bb9e053686256fbc0014c384#3" target="_blank">Frequency Asked Questions about NI-DAQmx and Traditional DAQ </a>documentation states: "Specifically, NI-DAQmx offers better single-point performance for the following:
- Software-timed Reads and Writes for analog and counter channels

- Software- or hardware-timed Reads or Writes involving multiple channels


Traditional NI-DAQ (Legacy) offers better performance for the following:
- Reads or Writes using digital channels

- Hardware-timed single point for applications with only one input and one output channel"
Therefore, you are correct in seeing that Traditional DAQ will be faster for software timed digital IO.Regards,Jesse O.Applications EngineeringNational Instruments
Message Edited by Jesse O on 06-13-2006 03:23 PM
reddog
2006-06-14 16:40:13 UTC
Permalink
I don't have any hardware or software installed where I can test this currently, but you might get slightly better DAQmx performance by using the raw read and write methods.
DAQmxWriteRawDAQmxReadRaw
Jonathan Brumley
2006-06-15 17:40:10 UTC
Permalink
For best digital performance with DAQmx make sure you are using the Single Sample Digital Port version of the Read and Write functions.&nbsp; Also, make sure you Start your tasks outside the main loop of your application.
DAQmx is a little slower than Traditional DAQ but I am surprised that you are saying it is 40% slower.&nbsp; I have benchmarked a 20% slowdown when comparing Traditional DAQ and DAQmx in LabVIEW on a Windows XP system.&nbsp; The slowdown is because DAQmx offers some additional features (such as multi-threading, more flexible digital channels, line inversion), and these features unfortunately add some overhead even if you are not using them.We are working on some performance improvements specifically for digital reads and writes for the next version of DAQmx (version 8.3).&nbsp; You may want to try out the new version when comes out.&nbsp; Another interesting point is that in DAQmx, M-Series digital is faster than E-Series digital because the M-Series hardware does not require as many steps to read or write a digital value.&nbsp; But if you are using the Windows operating system, this may not be enough to make a significant difference.DAQmx gets the best single point digital performance when using LabVIEW RT.&nbsp; An operation like Read or Write that takes 15-20 microseconds on Windows might take less than 5 microseconds using the LabVIEW ETS operating system.&nbsp; This is because the LabVIEW ETS operating system is a simpler operating system and does not require as many steps to access the hardware.
ThinkCentre
2006-06-15 20:10:11 UTC
Permalink
Thank you for your response.
From everyone's responses,&nbsp;the best performance approach involved issuing a start before any repeated tasks, and to define / create a task at the highest level possible.
Loading...