Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Continuous data acquisition with DAQmx without data acquisition toolbox

I'm trying to acquire data continuosly from my DAQ card. However, my data acquisition toolbox doesn't supported RTSI triggering, and "manual" trigger is still not fast enough. 

 

I found the sample code of JeansDE of using M-series card in Matlab by using ANSI C (http://www.jr-worldwi.de/work/matlab/index.html). Moreover, there's also sample code of continuosly acquiring data in National instruments (for example,  "ContAcq-ExtClk-DigStart.c").

 

My problem is that  I don't know how to write the CVI Callback function "EveryNCallback" in ANSI C into Matlab. 

 

[a,b] = calllib('myni', 'DAQmxRegisterEveryNSamplesEvent', uint32(AItaskHandle),  DAQmx_Val_Acquired_Into_Buffer, 1000, 0, EveryNCallback, ' ');

 

Any suggestions to write this function or another ways to overcome this problem are welcome.

 

Thanks a lot.

0 Kudos
Message 1 of 6
(5,628 Views)

Hi,

 

I'm not sure which version of Data Acquisition Toolbox & MATLAB you are using, but we did add RTSI support as part of our R2008b release, which came out in October of 2008.

 

All the best,

-Rob

 

---

Rob Purser

Manager, T&M

The MathWorks

-----
Rob Purser
Manager, Test and Measurement
MathWorks
rob.purser@mathworks.com
0 Kudos
Message 2 of 6
(5,618 Views)
My Matlab is R2006a, and it doesn't support RTSI.
0 Kudos
Message 3 of 6
(5,606 Views)

Hi,

 

 

I don't know if you already heard about or had a look at the free "NI-DAQmx Tools for The MathWorks, Inc. MATLAB®"

 

 

 

Best regards,
Joeri

National Instruments
Servicesg
0 Kudos
Message 4 of 6
(5,572 Views)

I am trying to do a similar thing here.  I would use the Data Acquisition Toolbox, but my Matlab R2009b is running on linux.  The NI-DAQmx Tools comes in a Windows installer, so I assume it is also Windows-only.

 

 

The ideal would be:

 

1. Continuous acquisition of several analog inputs.

2. Continous reporting of that data back to the Matlab environment.

3. MATLAB plots what I care about and stores the data to disk.

 

A  backup plan would be:

 

1. MEX interface to existing C-code.  (I can run the example ANSI C code from the linux command line)

2. C writes to disk

3. MATLAB reads from disk, plots and re-stores the data.

 

 

I'm pretty sure I can implement the backup plan with my existing MEX skills but I would much prefer something along the lines of the first option.  That seems to be available in the tools built by Matlab and NI but only for Windows users.

 

I know that one can create a variable in a MATLAB workspace from within C MEX so maybe that is an option?

 

Do either of you have suggestions?

0 Kudos
Message 5 of 6
(5,386 Views)

Hi T_alexis,

 

Could you solve your problem with Matlab?

 

 I am now trying to implement the same function ('DAQmxRegisterEveryNSamplesEvent') but nothing seems to work. Were you able to implement it in the end?

 

Thanks and regards,

 

Cmora

0 Kudos
Message 6 of 6
(5,127 Views)