Currently I work on a project that is realized in Matlab. So I have Matlabcode that needs to access a NI acquisition card. This is done via MatlabExecutable (short: mex). This just creates a dll file from a cpp file:
Matlab code -> C file-> NI card.
The problem is that normally - in a single c file - you create a task, configure it, start acquisition, check for errors, exiting c code.
BUT, I have following situation:
Matlab -> create_task (configure, etc) -> NI
Matlab -> start_acquisition -> NI
Matlab -> cleanup -> NI
So I need to get the taskHandle from each step. And here I'm stucked. It doesnt work.
Matlab -> create task -> NI: everthing is fine I got all parameters created and I receive the task Handle back to Matlab
Matlab -> start_acq -> NI: I hand over the task Handle but the function DAQmxLoadTask(handle) doesnt work.
Besides my implementation, would it work?? Will the task still be in the system if the c file runs through without cleaning/destoying the task?