PicoScope 7 Software
Available on Windows, Mac and Linux
Code: Select all
[status_open, handle] = calllib('PL1000', 'pl1000OpenUnit', handle)
Code: Select all
% Start device running
status_run = calllib('PL1000', 'pl1000Run', data.unithandle, data.nSamples, BM_STREAM);
% Wait for device to become ready
while data.isReady == 0
[status_ready, data.isReady] = calllib('PL1000', 'pl1000Ready', data.unithandle, data.isReady);
end
Code: Select all
#include "picoStatus.h"
Code: Select all
rsize = 15;
string = '';
[status_get string rsize] = calllib ('PL1000', 'pl1000GetUnitInfo', hand, string, 48, rsize, 0);
Code: Select all
------------------------------------------------------------------------
Segmentation violation detected at Tue Oct 02 19:21:15 2012
------------------------------------------------------------------------
Configuration:
MATLAB Version: 7.11.0.584 (R2010b)
MATLAB License: 359886
Operating System: Microsoft Windows 7
Window System: Version 6.1 (Build 7601: Service Pack 1)
Processor ID: x86 Family 6 Model 5 Stepping 5, GenuineIntel
Virtual Machine: Java 1.6.0_17-b04 with Sun Microsystems Inc. Java HotSpot(TM) Client VM mixed mode
Default Encoding: windows-1252
Fault Count: 1
Abnormal termination:
Register State (from fault):
EAX = 00000000 EBX = 9fe70001
ECX = 001803c9 EDX = 00000018
ESP = 00c2d87c EBP = 00c2d8b0
ESI = 1e8bd956 EDI = 9fe70000
EIP = 77862d24 EFL = 00010206
CS = 0000001b DS = 00000023 SS = 00000023
ES = 00000023 FS = 0000003b GS = 00000000
Stack Trace (from fault):
[ 0] 0x77862d24 C:/Windows/SYSTEM32/ntdll.dll+00339236 ( RtlFreeHeap+000298 )
[ 1] 0x77862c78 C:/Windows/SYSTEM32/ntdll.dll+00339064 ( RtlFreeHeap+000126 )
[ 2] 0x7637c3d4 C:/Windows/system32/kernel32.dll+00312276 ( HeapFree+000020 )
[ 3] 0x70214c39 C:/Windows/WinSxS/x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.4940_none_d08cc06a442b34fc/MSVCR80.dll+00019513 ( free+000205 )
[ 4] 0x7aa88170 C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00819568 ( inGetCallersWorkSpace+000928 )
[ 5] 0x7aaa005e C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00917598 ( inFunctionHandleInterface::getWorkspaceObj+013374 )
[ 6] 0x7aa7c183 C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00770435 ( inEvalExp+000643 )
[ 7] 0x7aa7c1be C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00770494 ( inEvalExp+000702 )
[ 8] 0x7aa7c24d C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00770637 ( inEvalExp+000845 )
[ 9] 0x7aa7c28c C:/Program Files/MATLAB/R2010b/bin/win32/m_interpreter.dll+00770700 ( inEvalExp+000908 )
[ 10] 0x7aa62d3d C:/Program
....
Code: Select all
loadlibrary 'PL1000.dll' 'pl1000Api.h' -mfilename 'pl1000mFile'; % Create the protofile
unloadlibrary('PL1000'); % Unload the library
Code: Select all
loadlibrary 'PL1000.dll' 'pl1000mFile'
Code: Select all
#ifndef __PL1000API_H__
#define __PL1000API_H__
Code: Select all
#include "picoStatus.h"
Further on, the status of the call to pl1000Run reports a wrong parameter, which I suspect has something to do with the above warning, hence, the argument 'BM_SINGLE' is not recognized or has the wrong type or something. I tried a lot of things, but nothing worked. Can you help figure out what goes wrong here? Thanks a lot!Type 'BLOCK_METHOD' was not found. Defaulting to type error.
Found on line 260 of input from line 89 of file pl1000Api.h
Code: Select all
global data;
[notfound,warnings] = loadlibrary('PL1000.dll','pl1000Api.h','addheader','picoStatus.h','mfilename','PL1000MFile');
% [notfound,warnings] = loadlibrary('PL1000.dll', 'PL1000MFile');
if ~libisloaded('PL1000')
error('library PL1000.dll or PL1000.h not found') %check if the library is loaded
end
try
data.unithandle = 0;
data.serial =[];
[status_OpenUnit, data.unithandle] = calllib('PL1000', 'pl1000OpenUnit', data.unithandle);
blockLength = 2e6; % [us], Interval of measurement block
nrSamples = 8100; % [-], Number of samples to collect in block
channelIDs = [1 2]; %[-], Active channels
nrOfValues = 4;
BM_SINGLE = 0;
BM_WINDOW = 1;
BM_STREAM = 2;
[status_SetInterval] = calllib('PL1000', 'pl1000SetInterval', data.unithandle, blockLength, nrSamples, channelIDs, length(channelIDs));
for k = 1
% method = libpointer('error',BM_SINGLE);
% method = BM_SINGLE;
string = 'BM_SINGLE';
method = libpointer('BLOCK_METHOD',0);
[status_Run] = calllib('PL1000', 'pl1000Run', data.unithandle, nrOfValues, method);
ready = false;
[status_Ready, ready] = calllib('PL1000', 'pl1000Ready', data.unithandle, ready);
while ~ready
end
values = zeros(1,nrOfValues);
overflow = 0;
triggerIndex = 0;
[status_GetValues, values, nrOfValues, overflow, triggerIndex] = calllib('PL1000', 'pl1000GetValues', data.unithandle, values, nrOfValues, overflow, triggerIndex);
end
status_CloseUnit = calllib('PL1000', 'pl1000CloseUnit', data.unithandle);
unloadlibrary('PL1000');
catch exception
unloadlibrary('PL1000');
throw(exception);
end
Code: Select all
#include "picoStatus.h"
Code: Select all
string = 'BM_SINGLE';
method = libpointer('BLOCK_METHOD',0);
[status_Run] = calllib('PL1000', 'pl1000Run', data.unithandle, nrOfValues, method);
Code: Select all
method = BM_SINGLE;
Code: Select all
[notfound,warnings] = loadlibrary('PL1000.dll', 'PL1000MFile');
Code: Select all
method = 0;