Hi! I'm new to the external interface tools of MATLAB and I'm not very familiar with C/C++ so I was wondering if anyone here has experience.
I'm writing a control script for a near-infrared camera, which came with a driver .dll file and a brief description of the functions within it.
For example, I have a function described as:
BOOL DLL_Get_Spectra(double* pdblData, double* pdblCaseTemperature);
Description: Acquire one snapshot spectrum.
Parameter: double* pdblData: Pointer of spectrum power array allocated by the user (Buffer size >= pixel count)
double* pdblCaseTemperature: Pionter of case temperature.
Return value: Boolean TRUE: Operation completed FALSE: Operation failed
After loading dll and using libfunction, we see that the library is loaded without any problems:
[lib.pointer, doublePtr] DLL_Get_Wavelenth(double, doublePtr)
I have read how to pass pointers into MATLAB, but not much on how to read pointers from MATLAB, do I just use doublePtr.Value?
Also, MATLAB does not have a BOOL type, so how am I suppose to read the returned lib.pointer as TRUE or FALSE?
Thanks!
Best Answer