PicoScope 7 Software
Available on Windows, Mac and Linux
Code: Select all
loadlibrary 'PS5000.dll' 'ps5000Api.h' addheader 'picoStatus.h' mfilename 'PS5000MFile';
if ~libisloaded('PS5000')
error('library PS5000.dll or PS5000.h not found') %check if the library is loaded
end
pBufferChA = libpointer('int16Ptr', zeros(4000000, 1));
[methodinfo,structs,enuminfo] = PS5000MFile; % Data and method structure for the ps5000 api.
unithandle = 0; % Handle to the opened unit.
maxsamples = 4000000; % Aantal samples = 1000000
noOfPreTriggerSamples = 0; % Aantal samples er genomen moeten worden voor de trigger
noOfPostTriggerSamples = 4000000; % Aantal samples er dienen genomen te worden na een trigger
timebase = 627; % Om het sampleinterval in te stellen 627
oversample = 1;
timeIndisposedMs = []; % Callback not used
segmentIndex = 0; % Leave set to 0 unless the data is being captured in a specific segment on the device.
lpReady = []; % Callback not used
pParameter = []; % Callback not used
overflow = []; % Callback not used
channelA = enuminfo.enPS5000Channel.PS5000_CHANNEL_A; % Instellen voor het gebruik van channel A
%range = enuminfo.enPS5000Range.PS5000_20V; % Instellen van onze spanningsrange
range = Voltagerange;
downSampleRatioMode = enuminfo.enRatioMode.RATIO_MODE_NONE;
true1 = enuminfo.enTriggerState.CONDITION_TRUE;
[status_open,unithandle] = calllib('PS5000','ps5000OpenUnit',unithandle); % Openen van onze picoscope
status_ps5000SetChannel = calllib('PS5000','ps5000SetChannel',unithandle,channelA,true1,true1,range); % Instellen van onze channel
status_ps5000GetTimebase = calllib('PS5000','ps5000GetTimebase',unithandle,timebase,4000000,0,oversample,maxsamples,0); % instellen van de tijdsbasis
status_ps5000RunBlock = calllib('PS5000','ps5000RunBlock',unithandle, noOfPreTriggerSamples,...
noOfPostTriggerSamples, timebase, oversample, timeIndisposedMs, segmentIndex, lpReady, pParameter); % Meting starten van onze picoscope
ready = 0;
% Poll the driver until it has captured some data
while(ready == 0)
[status_read, ready] = calllib('PS5000', 'ps5000IsReady', unithandle, ready);
pause(0.1);
end
status_ps5000SetDataBuffer = calllib('PS5000','ps5000SetDataBuffer',unithandle,channelA,pBufferChA,4000000); % Waarden in pBufferCha opslaan
status_ps5000GetValues = calllib('PS5000','ps5000GetValues',unithandle,0,4000000,0,downSampleRatioMode,0,overflow); % Ophalen van onze waarden uit de databuffer
bufferChA = get(pBufferChA, 'Value');
status_close = calllib('PS5000','ps5000CloseUnit',unithandle);
Code: Select all
loadlibrary 'PS5000.dll' 'ps5000Api.h' addheader 'picoStatus.h' mfilename 'PS5000MFile';
Code: Select all
loadlibrary 'PS5000.dll' 'PS5000MFile';