03-01-2006 07:46 AM
03-01-2006 09:40 AM
03-01-2006 12:47 PM
Javier,
Thanks for the response - I've done the same thing, on different hardware.
It looks like single digital input reads are quite a bit faster than single analog input reads - it looks like the digital input read "task" defaults to some different options, or something similar. Anyway, the per-read overhead I was seeing on the analog input reads is not happening with the digital input reads - I get about 100,000 digital input read calls / second. Maybe the analog stuff is slower because of hardware setup or something - at 250 ks/s the single analog input read (16-ch scan) time must be primarily something besides the actual analog sampling time.
Thanks,
Joe
03-01-2006 03:42 PM
Hi DynoMan,
I have benchmarked the software-timed DAQmx Digital Read/Digital Write (Port U32) to be between 15 and 20 microseconds on Windows XP on my average (1.8 GHz) Dell workstation. I see you are getting about 100000 digital read calls per second, so the performance you are getting is about what I would expect on Windows XP.
The overhead is due to the kernel transition time on Windows. For instance, on an 8176 controller running LabVIEW Real-Time (ETS), the time for a digital read or write takes more like 5 microseconds. This is because, on the real-time operating system, there is no kernel transition - this is because everything runs in the kernel !
If you need to do more than 100000 digital reads per second, both the solutions I can recommend would mean buying more stuff:
1. Using one of the new M-Series boards, you can use "correlated digital" which is hardware-timed digital. With hardware-timed digital combined with continuous acquisition you will be able to get much higher throughput because the data is streamed back and forth between the processor and the device using DMA. This will help a lot if you want to read multiple digital values at once. However, with correlated digital, you will get some additional "per-read" overhead because of the affect of the additional processing required for buffered reads and writes. (This additional overhead due to buffering is probably what you were seeing in the analog case). But if you can read multiple samples at a time (e.g. 100, 1000, or 10000 samples), buffered reads are the way to go.
2. If you get LabVIEW real-time and run your app using the real-time operating system, you will get a significant performance increase for software-timed digital (3x to 4x increase in performance). But using a real-time operating system has pros and cons so this may or may not be the best solution for your application.
03-01-2006 04:43 PM
Jonathan,
FYI, I am using a PCI-6221 I/O board, with DACmx 8.0, from VB 6.
The digital input reads at 100,000 Hz are fast enough - the analog input reads is what was slower than expected.
I have the analog reads in continuous mode now, just grabbing the latest values, which is OK.
The single-read digital routine (reads P0, P1, P2) is faster than the single-read analog routine (reads AIn 0-15 RSE mode) by more than I think can be explained by the analog sampling time. I'm not sure just how DACmx works, but I think I told it to do *scans* at 2,000 Hz, so the analog read rate would be 2,000 * 16 = 32,000 samples/second, well below the 250,000 s/s rate of the board. (Got errors at 100,000 Hz, which the board can do for 1 channel, so I am thinking the 2,000 Hz is for the scan, not conversion rate.) So, the conversion time is about 0.0005 seconds (2,000 Hz). However, I had to set the task and read up to do at least 2 reads (error message when trying to use 1), so say 0.001 seconds / scan. So, I would expect about 1,000 calls a second were possible - however, I could only get about 100 calls per second. Any idea why? I have to guess there is some software overhead happening, or maybe more likely a board-configuration thing happening for gain or routine or something. Or maybe I am just not doing it quite the right way - basically using one of the (10 or so!) DACmx VB examples for the read logic.
Anyway, continuous acquisition mode and grabbing the last sample read seems to be OK for our purposes.
FYI, if I do a most-recent-sample-relative read, with an offset of 0, it is much, much slower than if I do the same read with an offset of -1 - not sure what that means, but that's what my timing shows.
Joe
03-01-2006 05:54 PM
09-15-2006 04:21 PM
09-18-2006 12:47 PM