Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Octave on GNU/Linux

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

0 Kudos
Message 1 of 3
(4,270 Views)
Hello Bayle,
 
The DAQmx Base driver does not support Octave, so that's why you are having trouble getting them to communicate. You should contact the company that makes Octave to see if they have a good way to interface with NIs hardware. If they don't, calling the DAQmx Base C API is your best option. Have a great day!
 
Sincerely,
Marni S.
0 Kudos
Message 2 of 3
(4,252 Views)
in case anyone else needs to do this, at the time of the above thread I wrote an Octave wrapper for the National Instruments' NIDAQmx interface. It uses SOAP RPC, so you can issue commands over the network from a different computer from the one actually connected to the N.I. DAQ. I never released it but it's in SVN: http://neurodata.svn.sourceforge.net/viewvc/neurodata/e-rig/trunk/nidaqmxbase-soap/

 

Caution: since i haven't touched it for 2 years, there may be some bit rot.

 

0 Kudos
Message 3 of 3
(3,948 Views)