06-29-2009 10:26 AM
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.
06-29-2009 02:53 PM
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
06-30-2009 01:59 AM
07-06-2009
09:31 AM
- last edited on
06-25-2024
04:36 PM
by
Content Cleaner
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®"
12-30-2009 06:48 PM
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?
04-09-2010 01:30 AM