‎02-19-2008 03:28 PM
‎02-20-2008 08:57 AM
‎02-20-2008 09:03 AM
‎02-20-2008 09:41 AM
‎02-20-2008 09:48 AM
Escrito por Ranoxerox:
...
I just want basic IO (Mode 0) but in order to do this I have 3 options :
1. wait till the problem is fixed (if ever)
2. write a C app service wrapper around the daqmxbase
3. write a PCI device driver for the card.
...
I had the same problem months ago and the solution I choose was the second. I used a C wrapper that send the data stream through a listening Java socket in the local machine. This way, you can have the DAQ native program in a host and the Java application in another. Just assure to disable the Nagle algorithm in native part if you need "real-time" data stream. Another approach is to send the data through standard output and collect it in standard input on the Java app (only if the standard input is not already use for another thing, like the 99% of applications I have seen in Java).
This way, in unix you can do:
./nativeDAQ | java mypackage.MyApplication
Hope this help. Your options 1 (wait for support) and 3 (write PCI driver) seems worse to me 🙂
‎02-20-2008 10:01 AM
‎02-20-2008 10:36 AM
In my previous job the device was a NI-6009 (USB interface) so nothing to do with PCI, and NI only have nidaqmx-base drivers in Linux, so the native part was a C program that uses nidaqmx-base to send the data to the no-delay sockets. The sampling rate was 10 Hz (so 10 nodelay packets, 96 bits/packet in TCP header) and 4 analog channels (32bits), so the bit rate was 10x(4x32+96)=2240 bit/s, not much. This was fine for me, but maybe it is not good for you. Callculate with your data or simply try it 🙂
Escrito por Ranoxerox:
Thanks maht,
Definately sound advice,
previously I was using a PC DIO instead of a PCI. I can see there is a big difference from my point of view of writing a program which does a simple outb write to a know memory address (PC Card) vs dealing with all the initialization of the PCI card. Which card are you using? And would you be will to share the your small wrapper? Did you end up going with NODELAY sockets or stdin input, or both?
Best Regards,
Ranoxerox.
‎02-21-2008 02:42 AM
‎02-21-2008 04:42 AM
Uhmm, it's true ... the multithreading stuff 🙂
Escrito por Ranoxerox:
Thanks maht ,
I have started making a service wrapper for the DAQmxBase calls. My initial design would be a multi-threaded socket server, however, I noticed when I put the DAQmxBaseWriteDigitalU32 & DAQmxBaseReadDigitalU32 calls would fail when called on by a thread. Yet, if the wrapper function was called by the main thread which got the task handle - the DAQmxBaseWriteDigitalU32 & DAQmxBaseReadDigitalU32 would succeed.
As I could not see any means around this, my design has changed so that the socket portion of the server is multi-threaded but each thread will append their data to a queue. Only the main thread will process the queue and do the DAQmxBase calls. I only see this or just being completely single threaded as a solution.
Do you have any suggestions to proceed?
Regards,
Ranoxerox.
‎02-21-2008 12:39 PM