SDK Can't See PicoScope
SDK Can't See PicoScope
The picoscope 4000 and 5000 series library files load correctly. But when I try to open the picoscope two of the PCs correctly open the scope and return a handle (both Dell Precisions, one old running win7 and one new running win10) but the third PC (a panasonic toughbook) cannot find the picoscope.
[status_open,hPico] = calllib('ps4000','ps4000OpenUnit',hPico);
returns status_open = 3, hPico = -1
It's as though the scope is not connected to the toughbook; but the scopes show in device manager and both my 4000 series and 5000 series scopes connect correctly to picoscope 6 running on all three PCs.
What could be wrong? Where to start debugging?
Complete code (for the 4000 series scope) below:
===========================================================
function hPico=Pico_Open()
%opens the pico 4226 for control by matlab
%modified paths etc for dell 5550
setenv('MW_MINGW64_LOC','C:\TDM-GCC-64\mingw64'); %loads the compiler
pathh='C:\Program Files\Pico Technology\SDK\inc\';
pathl='C:\Program Files\Pico Technology\SDK\lib\';
loadlibrary([pathl,'ps4000.dll'],[pathh,'ps4000Api.h']); %loads the libraries
hPico=0; %sets a pointer
[status_open,hPico] = calllib('ps4000','ps4000OpenUnit',hPico); %asks for a handle to the scope
if ~status_open
disp(['pico opened with handle: ', num2str(hPico)]); %this returns hPico = -1 on the toughbook
else
errornum=dec2hex(status_open);
error(['pico failed to open with pico error ' errornum 'hex']); %returns error 3hex on the toughbook
end
------------------------------------------
Code for the 5000 series scope:
=====================================
function hPico=Pico5_Open()
%opens the pico 5000 for control by matlab
%modified paths etc for dell 5550
setenv('MW_MINGW64_LOC','C:\TDM-GCC-64\mingw64');
pathh='C:\Program Files\Pico Technology\SDK\inc\';
pathl='C:\Program Files\Pico Technology\SDK\lib\';
loadlibrary([pathl,'ps5000a.dll'],[pathh,'ps5000aApi.h']);
hPico=0;
serial=[];
res='PS5000A_DR_16BIT';
[status_open,hPico] = calllib('ps5000a','ps5000aOpenUnit',hPico,serial,res);
disp(['pico opened with handle: ', num2str(hPico)]);
if status_open %handling for the two stage power up process
errornum=dec2hex(status_open);
disp(['pico status: ' errornum ' hex']);
if status_open == 282
PS=282;
calllib('ps5000a','ps5000aChangePowerSource',hPico,PS);
disp(['pico status: ' dec2hex(status_open) ' hex']);
end
end