Test and Measurement Forum

loading USB DrDAQ libraries with matlab

Post your MATLAB discussions here

loading USB DrDAQ libraries with matlab

Postby gossiaux » Wed Feb 26, 2014 4:03 pm

Dear DrDAQ,

I have tried to run DrDAQ under matlab 2013a on Windows 7, 64-bits. I went sucessfully through the followind steps:
-> Installing SDK 7.1
-> Adding the path to DrDAQ SDK (UsbDrDAQsdk_r10_5_0_28)
-> Making the link with the C++ compiler using mex -setup

Then I tried to load the libraries to "interact" with DrDAQ, and I obtained the following error message:
>> loadlibrary('USBDrDAQ.dll','usbDrDaqApi.h')
Error using loadlibrary (line 419)
Failed to preprocess the input file.
Output from preprocessor is:usbDrDaqApi.h
D:\Documents Gossiaux\DrDAQ\UsbDrDAQsdk_r10_5_0_28\usbDrDaqApi.h(9) : fatal error C1189: #error :
Operating system not defined


Having a look at usbDrDaqApi.h file, I could identity that it expects to work under WIN32:
#ifndef WIN32
#error Operating system not defined
#endif

This is obviously not the case => what should I do (I am not a C++ specialist) ? Are the .lib and the .dll files located in the x64 folder of any help ? Do I need to download an alternate version of the usbDrDaqApi.h file ?

Any input would be highly appreciated ! Thx a lot in advance.

PB Gossiaux
gossiaux
Newbie
 
Posts: 0
Joined: Wed Feb 26, 2014 3:50 pm

Re: loading USB DrDAQ libraries with matlab

Postby Karunen » Thu Feb 27, 2014 3:33 pm

Hi,

If you are using 64 bit matlab you can download the folder below,

UsbDrDAQ_x64.zip
USB DrDAQ x64 files
(164.79 KiB) Downloaded 146 times


I have altered the usbDrDaqApi.h so you now should be able to use

Code: Select all
loadlibrary('USBDrDAQ.dll','usbDrDaqApi.h')


The folder has all the dlls and headers you need to run the device on x64 MatLab.

Please note when opening device it is best to use
Code: Select all
[status, handle] = calllib('USBDrDAQ','UsbDrDaqOpenUnit', 0);


And remember to unload libraries otherwise it can cause the driver to be held in Matlab, which will stop you from opening the device until you close all MatLab processors.

Thanks,
Karunen

Technical Specialist
Pico Technology
Karunen
Zen Master
Zen Master
 
Posts: 194
Joined: Thu Nov 21, 2013 9:22 am


Return to MATLAB

Who is online

Users browsing this forum: No registered users and 0 guests