Hello, I'm interested in making Octave (an open-source Matlab
sorta-clone) communicate with an M-series DAQ while running on Debian
GNU/Linux.
I've got the GNU/Linux drivers ("ni-daqmx base") installed and working.
However, there seems to be a problem getting Octave's C API to work
with -mx base's C API. Specifically, if I simply compile any C
extension for Octave (for example, the "Oregonator" example from
Octave's manual) and link it to the library "nidaqmxbase", then Octave
hangs when you call the function that you defined. Note that Octave
hangs even if no DAQ functions are called -- the mere linking of the
library is enough. (I don't know if this is NI's fault, or Octave's;
I've already reported the problem to the Octave team; see
http://www.octave.org/mailing-lists/bug-octave/2005/835).
So, I figured I'd just have to make a standalone program to house the
calls to the -mx base API which Octave would call. Then I ran into a
second problem: the first time an application calls the -mx base API,
it pauses for about 15 seconds. This kind of delay is fine once, but if
I ran a separate program each time I wanted to give the DAQ a command,
then there would be a long pause for each command, which is
unacceptable.
So, I can't call the API from Octave, and I can't write a simple
standalone program. As a workaround, I'm currently writing a server
which runs in the background and uses UNIX sockets to communicate with
clients. The idea is that Octave extension functions will act as
clients to the server, telling it which DAQ commands to execute. The
server will then call the -mx base C API. This way the server can be
started once and left running, so the long initialization only has to
happen once; yet the library ""nidaqmxbase" doesn't have to be linked
to the Octave extensions.
This strategy works, but it's ridiculous. Can anyone suggest something
simpler? Specifically, does anyone have any ideas how to make the
"nidaqmxbase" library work with Octave DLD files, or how to shorten the
long initialization time upon the first call to the mxbase C API?
Thanks,
bayle