From: Sean on
I am attempting to access a NI-DAQmx TaskHandle in the Matlab workspace. The catch is that I want to create the TaskHandle in a mex file. I don't want to create the handle object in Matlab because not all synchronous functions are supported by the DAQ toolbox.

So, after I create the TaskHandle in the mex file, I was hoping it would 'appear' in my matlab workspace when I called the mex function from Matlab. It didn't work. I declared the TaskHandle object outside the mexFunction.

Does anyone have experience with passing TaskHandle objects up to Matlab?

(btw: The two unsupported DAQ Toolbox functions are synchronous slave sample clock sourcing and infinite continuous slave samples. Matlab confirms these are both open 'bugs' they will resolve in good time...)

I have confirmed my TaskHandle works and collects DAQ A/D data with a similar ANSI C function in MSVC.
From: Sean on
Update:

The mex file did not appear to be workable. Instead, I used loadlibrary to load the nicauiu.dll and nidaqmx.h header file. Then I used calllib to execute the ANSI C function calls in NI-DAQmx.

All the details are at http://www.jr-worldwi.de/work/matlab/ which is the homepage for the matlab poster 'Jens_DE'.

Jens_DE saved my hide on this problem...



"Sean " <slastuka(a)apl.washington.edu> wrote in message <hplpct$kq6$1(a)fred.mathworks.com>...
> I am attempting to access a NI-DAQmx TaskHandle in the Matlab workspace. The catch is that I want to create the TaskHandle in a mex file. I don't want to create the handle object in Matlab because not all synchronous functions are supported by the DAQ toolbox.
>
> So, after I create the TaskHandle in the mex file, I was hoping it would 'appear' in my matlab workspace when I called the mex function from Matlab. It didn't work. I declared the TaskHandle object outside the mexFunction.
>
> Does anyone have experience with passing TaskHandle objects up to Matlab?
>
> (btw: The two unsupported DAQ Toolbox functions are synchronous slave sample clock sourcing and infinite continuous slave samples. Matlab confirms these are both open 'bugs' they will resolve in good time...)
>
> I have confirmed my TaskHandle works and collects DAQ A/D data with a similar ANSI C function in MSVC.