NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Member
Rked
Posts: 9
0 Kudos

does return main keeps task still in system and be available for other tasks

Hello out there,

 

I'm heavily stuck to a difficult problem:

 

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?

And could the DAQmxLoadTask function retrieve it?

 

Regards

 

Rked

Member
SEgeler
Posts: 183
0 Kudos

Re: does return main keeps task still in system and be available for other tasks

Hi Rked,

 

how does the "doesn't work" show? Is there an error message? A crash / hang?

 

Regards,

 

Stefan

Stefan Egeler
Group Leader Applications Engineering @ NI Germany
CTD, CLAD
By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page