Being a non-too-skilled computer user, I've been unsuccessfully trying to address an NI USB-6008 A/D converter from within MATLAB R2012b on a Mac OS 10.8.3 for quite a while.
Searching through the internet ( http://www.binghamsite.com/miscellaneous/matlab-mex-and-ni-usb), I learned that the general way to go is to use the mex command from within MATLAB to compile code written in C into programs understood by MATLAB. Following the instructions provided on that website, I ran mex -setup, edited the mexopts.sh file and succeeded in compiling the simple timestwo.c file for test purposes.
I then tried to do the same to the example data acquisition .c-files provided with the NI-DAQmx Base (v 3.6) driver package. I was informed that mex objects require the inclusion of the NI-DAQmx Base header (NIDAQmxBase.h), so I tried to run
mex -I"/Applications/National Instruments/NI-DAQmx Base/includes" acquire1scan.c
The compilation fails producing a bunch of information I don't understand. However, the error messages
"Error: This platform is unsupported because long is not 4 bytes." or
"Error: This platform is unsupported because int is not the same size as long."
show up repeatedly. My Macbook uses an Intel Core i5 processor which is 64-bit, if that can have anything to do with it.
Any suggestions on how to get this running would be highly appreciated.
p.s.: Neel: Thanks for getting back to me. I'm fully aware that the Data Acquisition Toolbox, which Windows users may benefit from, would make my life much easier. But I think that I was reasonably specific about the system I'm working on and the problem I'm trying to solve. To simply suggest to go and use something entirely different is not particularly helpful.