Hello and please help

Post your MATLAB discussions here
Post Reply
peter.uk
Newbie
Posts: 0
Joined: Mon Aug 17, 2015 2:20 pm

Hello and please help

Post by peter.uk »

I am a physicist using an ADC24 for lab measurements and planning to build custom operating software using Matlab
I have a problem getting started. I am using Windows 7 64-bit enterprise SP1
Here is the problem:
mex -setup
MEX configured to use 'Microsoft Windows SDK 7.1 (C)' for C language compilation.
Warning: The MATLAB C and Fortran API has changed to support MATLAB
variables with more than 2^32-1 elements. In the near future
you will be required to update your code to utilize the
new API. You can find more information about this at:
http://www.mathworks.com/help/matlab/ma ... t-api.html.
To choose a different language, select one from the following:
mex -setup C++
mex -setup FORTRAN

LibNam = ‘PicoHRDL’

>> loadlibrary(LibNam,'HRDL')
Error using loadlibrary (line 447)
Failed to preprocess the input file.
Output from preprocessor is:HRDL.h
C:\Users\adminlocal\Documents\MATLAB\HRDL.h(14) : fatal error C1189: #error : Operating
system not defined

I note the HRDL.h file refers to WIN32. Is this the problem? I have tried some obvious changes without success.

Hitesh

Re: Hello and please help

Post by Hitesh »

Hi peter.uk,

We recommend the use of the prototype files provided as part of the Software Development Kit.

If you have downloaded SDK v10.5.2.1, please navigate to the MATLAB/picohrdl/x64 folder and copy the picoHRDLMFile .m and PicoHRDL_thunk_pcwin64.dll files to a location on your MATLAB path.

You can then call

Code: Select all

loadlibrary('picohrdl.dll', @picoHRDLMFile);
The prototype file will give you access to the enumerations defined in the header file.

Hope this helps.

peter.uk
Newbie
Posts: 0
Joined: Mon Aug 17, 2015 2:20 pm

Re: Hello and please help

Post by peter.uk »

Dear Hitesh
Didn't sort things out I'm afraid. I am using the sdk you specify (though I note there is a new, specifically 64-bit version as of yesterday)
Here is Matlab print-out:
>> loadlibrary('picohrdl.dll',@picoHRDLMFile);
Warning: The library name case did not match the file name.
The library will be named "PicoHRDL".
> In loadlibrary (line 185)
Error using loadlibrary (line 447)
There was an error loading the library "C:\Users\adminlocal\Documents\MATLAB\PicoHRDL.dll"
C:\Users\adminlocal\Documents\MATLAB\PicoHRDL.dll is not a valid Win32 application.
Caused by:
Error using loaddefinedlibrary
C:\Users\adminlocal\Documents\MATLAB\PicoHRDL.dll is not a valid Win32 application.

Hitesh

Re: Hello and please help

Post by Hitesh »

Hi Peter,

I suspect that you may have been using the dll from the root directory of the SDK zip file as opposed to the one from the x64 directory.

Also, the warning relates to the name case i.e. 'PicoHRDL.dll' instead of 'picohrdl.dll'.

As the new SDK has been uploaded, please download and install the 64-bit version (copy out the driver file) and try the command again. Please use the prototype file and 'thunk' dll file from the x64 directory of the old SDK.

Regards,

peter.uk
Newbie
Posts: 0
Joined: Mon Aug 17, 2015 2:20 pm

Re: Hello and please help

Post by peter.uk »

Dear Hitesh
Looks as though you were right--thanks for the help
Should I have been able to find thid ino somewhere on the website?
Regards
Peter

Hitesh

Re: Hello and please help

Post by Hitesh »

Hi Peter,

I have updated the following post which now makes this clear in a note.

Best wishes,

Post Reply