Using MATLAB 2013a Win64

Post your MATLAB discussions here
Post Reply
SE21733
Newbie
Posts: 0
Joined: Fri Oct 05, 2012 12:42 am

Using MATLAB 2013a Win64

Post by SE21733 »

Hello Hitesh and everybody

I'm trying to restart my PicoLog 1012 on Windows 7 using MATLAB 2013a (Win64)

I have Windows SDK 7.1 installed and done mex -setup pretty much all the necessary files are in the same folder including the thunk file.

so this is my code I'm try to run

Code: Select all

loadlibrary 'PL1000.dll' 'pl1000Api.h' addheader 'picoStatus.h' mfilename 'pl1000MFile';
if ~libisloaded('PL1000')
    error('Library pl1000.dll or pl1000Api.h not found') %Check if library file loaded 
end

[methodinfo, structs, enuminfo, ThunkLibName] = ps3000aMFile;

%--------------------    Program    -------------------%
%% -- Open and enumerate the unit --
handle = libpointer('int16Ptr',zeros(1,1));  % short handle

[status_open, handle] = calllib('PL1000', 'pl1000OpenUnit', handle); 
fprintf('Opening the device \n');

%% -- Retrieved Maximum value from the data logger --
max_Value = libpointer('uint16Ptr',zeros(1,1)); % Max value

calllib('PL1000','pl1000MaxValue', handle, max_Value);
maxValue = get(max_Value,'Value');
maxValue = double(maxValue);                    % Convert int16 to double
fprintf(' Max value = %f\n',maxValue);

%----------------   Unload the library  ---------------% 
 unloadlibrary ('PL1000');
For a start I just want to retrieve the max value (it's has been long time since I use the 1012)

but I getting this error

Error using loadlibrary (line 419)
Failed to preprocess the input file.
Output from preprocessor is:pl1000Api.h
C:\Users\Sin\Documents\MATLAB\pl1000Api.h(16) : fatal error C1189: #error : Operating system not defined

Error in PicoLogMatlab_MaxVal (line 6)
loadlibrary 'PL1000.dll' 'pl1000Api.h' addheader 'picoStatus.h' mfilename 'pl1000MFile';

Hitesh

Re: Using MATLAB 2013a Win64

Post by Hitesh »

Hi SE21733,

If you use the prototype and thunk libraries from our example on File Exchange then it removes the need to use Windows SDK 7.1 and run mex-setup on your PC.

Please also refer to the example for how to load the library using the above files and note the change in the case name for the dll (pl1000.dll instead of PL1000.dll).

Regards,

Post Reply