Hi, Stefan Schaal wrote: > Thanks to Alexis's Analogy development, digital I/O is possible with Xenomai > using National Instrument DAQs. While the basic DIO functionality works in > the most current xenomai-head, I am wondering how to achieve maximal I/O > speed with the 32 bit digital I/O sub-device on my NI6259 card. > > The options are > > 1) single acquisition with a4l_sync_dio() > 2) instructions and instruction lists using a4l_snd_insnlist() and > a4l_snd_insn() > 3) streaming acquisition with commands (e.g., a4l_snd_command() and related > functions) > > My question concerns how many 32-bit DIO instructions per second I > should be able to achieve with the various options. > > For instance, option 1) seems to take about 5000 nanoseconds on my > Ubuntu 8 core i386 computer (3Ghz processors). > Is this normal? Or should it be faster? > > Option 2) seems to give me about 50% speed up, i.e., roughly 3500 > nanoseconds per DIO.
With a4l_sync_dio and/or instructions, you perform one ioctl for each acquisition. With instruction lists, you perform less syscalls but the count of copies (user <-> kernel space) is the same. So 3.5 µs for: - switching from user to kernel space - copying a little structure from user space - calling the suitable insn_bits handler - performing PCI I/O - copying data back (few bytes) to user space - switching back to user space It is not that bad, no ? Does anybody have an accurate idea on the duration of a common ioctl on such a powerful machine ? Wasting 1.5 more µs in a4l_sync_dio() is annoying. You already have noticed that a4l_sync_dio() is a wrapper function which relies on the instruction ioctl. This function does not make any more ioctl, it just computes some pointers. > > Would option 3) give me a massive speed up and get me closer to the > 20Mhz processing power of the NI 6259 board? Yes. Instead of making one syscall per acquisition, you would get a far more sensible ratio. With a4l_mmap, you would even be able to save copies from kernel space: instead of using a4l_async_read, your user process would get direct access on the kernel buffer where PCI DMA shots arrive. I have some problems with > implementing commands on my NI6259 so far. Could you remind me what was the problem ? > > Thanks a lot for any help! > > -Stefan > > _______________________________________________ > Xenomai-core mailing list > Xenomai-core@gna.org > https://mail.gna.org/listinfo/xenomai-core > Alexis. _______________________________________________ Xenomai-core mailing list Xenomai-core@gna.org https://mail.gna.org/listinfo/xenomai-core