Hi,
We don't currently have any MATLAB examples that we have created for our products including the DrDAQ (both USB and parallel port versions).
However, there is an example created by another Customer that shows how to use MATLAB with a PicoScope 2000 series PC Oscilloscope which you can use as a starting point. Please visit
http://www.picoapps.com/coders-corner/ and look under the Mini-apps section.
Create a directory on your PC containing the appropriate dll and the corresponding DrDAQApi.h file, and create your MATLAB script in this directory. An example to load the library, and open and close a connection to the USB DrDAQ would be:
- Code: Select all
function usbDrDAQ
global data;
loadlibrary('USBDrDAQ.dll',' usbDrDaqApi.h');
if ~libisloaded('USBDrDAQ')
error('library USBDrDAQ.dll or usbDrDaqApi.h not found') %check if the library is loaded
end
data.unithandle = 0;
% Open a connection
[status, data.unithandle] = calllib('USBDrDAQ', 'UsbDrDaqOpenUnit', data.unithandle)
% Call some functions on the DrDAQ
% Close the connection
status = calllib('USBDrDAQ', 'UsbDrDaqCloseUnit', data.unithandle)
Once you have loaded the library in, you can use the 'libfunctionsview' function to view the functions from the dll that have been loaded into the MATLAB environment providing you have not unloaded the library.
I hope this helps.