Code covered by the BSD License  

Highlights from
PicoScope® 3000 Series - MATLAB® Generic Instrument Driver

image thumbnail

PicoScope® 3000 Series - MATLAB® Generic Instrument Driver

by

 

07 Nov 2012 (Updated )

MATLAB Instrument Driver for use with PicoScope 3000A/B oscilloscopes

ps3000aWrapMFile
function [methodinfo,structs,enuminfo,ThunkLibName]=ps3000aWrapMFile
%PS3000AWRAPMFILE Create structures to define interfaces found in 'ps3000aWrap'.

%This function was generated by loadlibrary.m parser version  on Wed Nov 26 14:10:31 2014
%perl options:'ps3000aWrap.i -outfile=ps3000aWrapMFile.m'
ival={cell(1,0)}; % change 0 to the actual number of functions to preallocate the data.
structs=[];enuminfo=[];fcnNum=1;
fcns=struct('name',ival,'calltype',ival,'LHS',ival,'RHS',ival,'alias',ival);
ThunkLibName=[];
% extern int16_t _stdcall AutoStopped ( uint16_t deviceIndex ); 
fcns.name{fcnNum}='AutoStopped'; fcns.calltype{fcnNum}='stdcall'; fcns.LHS{fcnNum}='int16'; fcns.RHS{fcnNum}={'uint16'};fcnNum=fcnNum+1;
% extern uint32_t _stdcall AvailableData ( uint16_t deviceIndex , uint32_t * startIndex ); 
fcns.name{fcnNum}='AvailableData'; fcns.calltype{fcnNum}='stdcall'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'uint16', 'uint32Ptr'};fcnNum=fcnNum+1;
% extern PICO_STATUS _stdcall ClearTriggerReady ( uint16_t deviceIndex ); 
fcns.name{fcnNum}='ClearTriggerReady'; fcns.calltype{fcnNum}='stdcall'; fcns.LHS{fcnNum}='ulong'; fcns.RHS{fcnNum}={'uint16'};fcnNum=fcnNum+1;
% extern PICO_STATUS _stdcall decrementDeviceCount ( uint16_t deviceIndex ); 
fcns.name{fcnNum}='decrementDeviceCount'; fcns.calltype{fcnNum}='stdcall'; fcns.LHS{fcnNum}='ulong'; fcns.RHS{fcnNum}={'uint16'};fcnNum=fcnNum+1;
% extern uint16_t _stdcall getDeviceCount ( void ); 
fcns.name{fcnNum}='getDeviceCount'; fcns.calltype{fcnNum}='stdcall'; fcns.LHS{fcnNum}='uint16'; fcns.RHS{fcnNum}=[];fcnNum=fcnNum+1;
% extern PICO_STATUS _stdcall GetStreamingLatestValues ( uint16_t deviceIndex ); 
fcns.name{fcnNum}='GetStreamingLatestValues'; fcns.calltype{fcnNum}='stdcall'; fcns.LHS{fcnNum}='ulong'; fcns.RHS{fcnNum}={'uint16'};fcnNum=fcnNum+1;
% extern PICO_STATUS _stdcall initWrapUnitInfo ( int16_t handle , uint16_t * deviceIndex ); 
fcns.name{fcnNum}='initWrapUnitInfo'; fcns.calltype{fcnNum}='stdcall'; fcns.LHS{fcnNum}='ulong'; fcns.RHS{fcnNum}={'int16', 'uint16Ptr'};fcnNum=fcnNum+1;
% extern int16_t _stdcall IsReady ( uint16_t deviceIndex ); 
fcns.name{fcnNum}='IsReady'; fcns.calltype{fcnNum}='stdcall'; fcns.LHS{fcnNum}='int16'; fcns.RHS{fcnNum}={'uint16'};fcnNum=fcnNum+1;
% extern int16_t _stdcall IsTriggerReady ( uint16_t deviceIndex , uint32_t * triggeredAt ); 
fcns.name{fcnNum}='IsTriggerReady'; fcns.calltype{fcnNum}='stdcall'; fcns.LHS{fcnNum}='int16'; fcns.RHS{fcnNum}={'uint16', 'uint32Ptr'};fcnNum=fcnNum+1;
% extern PICO_STATUS _stdcall RunBlock ( uint16_t deviceIndex , int32_t preTriggerSamples , int32_t postTriggerSamples , uint32_t timebase , uint32_t segmentIndex ); 
fcns.name{fcnNum}='RunBlock'; fcns.calltype{fcnNum}='stdcall'; fcns.LHS{fcnNum}='ulong'; fcns.RHS{fcnNum}={'uint16', 'int32', 'int32', 'uint32', 'uint32'};fcnNum=fcnNum+1;
% extern PICO_STATUS _stdcall setAppAndDriverBuffers ( uint16_t deviceIndex , int16_t channel , int16_t * appBuffer , int16_t * driverBuffer , uint32_t bufferLength ); 
fcns.name{fcnNum}='setAppAndDriverBuffers'; fcns.calltype{fcnNum}='stdcall'; fcns.LHS{fcnNum}='ulong'; fcns.RHS{fcnNum}={'uint16', 'int16', 'int16Ptr', 'int16Ptr', 'uint32'};fcnNum=fcnNum+1;
% extern PICO_STATUS _stdcall setMaxMinAppAndDriverBuffers ( uint16_t deviceIndex , int16_t channel , int16_t * appMaxBuffer , int16_t * appMinBuffer , int16_t * driverMaxBuffer , int16_t * driverMinBuffer , uint32_t bufferLength ); 
fcns.name{fcnNum}='setMaxMinAppAndDriverBuffers'; fcns.calltype{fcnNum}='stdcall'; fcns.LHS{fcnNum}='ulong'; fcns.RHS{fcnNum}={'uint16', 'int16', 'int16Ptr', 'int16Ptr', 'int16Ptr', 'int16Ptr', 'uint32'};fcnNum=fcnNum+1;
% extern PICO_STATUS _stdcall setAppAndDriverDigiBuffers ( uint16_t deviceIndex , int16_t digiPort , int16_t * appDigiBuffer , int16_t * driverDigiBuffer , uint32_t bufferLength ); 
fcns.name{fcnNum}='setAppAndDriverDigiBuffers'; fcns.calltype{fcnNum}='stdcall'; fcns.LHS{fcnNum}='ulong'; fcns.RHS{fcnNum}={'uint16', 'int16', 'int16Ptr', 'int16Ptr', 'uint32'};fcnNum=fcnNum+1;
% extern PICO_STATUS _stdcall setMaxMinAppAndDriverDigiBuffers ( uint16_t deviceIndex , int16_t digiPort , int16_t * appMaxDigiBuffer , int16_t * appMinDigiBuffer , int16_t * driverMaxDigiBuffer , int16_t * driverMinDigiBuffer , uint32_t bufferLength ); 
fcns.name{fcnNum}='setMaxMinAppAndDriverDigiBuffers'; fcns.calltype{fcnNum}='stdcall'; fcns.LHS{fcnNum}='ulong'; fcns.RHS{fcnNum}={'uint16', 'int16', 'int16Ptr', 'int16Ptr', 'int16Ptr', 'int16Ptr', 'uint32'};fcnNum=fcnNum+1;
% extern PICO_STATUS _stdcall setChannelCount ( uint16_t deviceIndex , int16_t channelCount ); 
fcns.name{fcnNum}='setChannelCount'; fcns.calltype{fcnNum}='stdcall'; fcns.LHS{fcnNum}='ulong'; fcns.RHS{fcnNum}={'uint16', 'int16'};fcnNum=fcnNum+1;
% extern PICO_STATUS _stdcall setEnabledChannels ( uint16_t deviceIndex , int16_t * enabledChannels ); 
fcns.name{fcnNum}='setEnabledChannels'; fcns.calltype{fcnNum}='stdcall'; fcns.LHS{fcnNum}='ulong'; fcns.RHS{fcnNum}={'uint16', 'int16Ptr'};fcnNum=fcnNum+1;
% extern PICO_STATUS _stdcall setDigitalPortCount ( uint16_t deviceIndex , int16_t digitalPortCount ); 
fcns.name{fcnNum}='setDigitalPortCount'; fcns.calltype{fcnNum}='stdcall'; fcns.LHS{fcnNum}='ulong'; fcns.RHS{fcnNum}={'uint16', 'int16'};fcnNum=fcnNum+1;
% extern PICO_STATUS _stdcall setEnabledDigitalPorts ( uint16_t deviceIndex , int16_t * enabledDigitalPorts ); 
fcns.name{fcnNum}='setEnabledDigitalPorts'; fcns.calltype{fcnNum}='stdcall'; fcns.LHS{fcnNum}='ulong'; fcns.RHS{fcnNum}={'uint16', 'int16Ptr'};fcnNum=fcnNum+1;
% extern PICO_STATUS _stdcall SetPulseWidthQualifier ( int16_t handle , uint32_t * pwqConditionsArray , int16_t nConditions , uint32_t direction , uint32_t lower , uint32_t upper , uint32_t type ); 
fcns.name{fcnNum}='SetPulseWidthQualifier'; fcns.calltype{fcnNum}='stdcall'; fcns.LHS{fcnNum}='ulong'; fcns.RHS{fcnNum}={'int16', 'uint32Ptr', 'int16', 'uint32', 'uint32', 'uint32', 'uint32'};fcnNum=fcnNum+1;
% extern PICO_STATUS _stdcall SetPulseWidthQualifierV2 ( int16_t handle , uint32_t * pwqConditionsArrayV2 , int16_t nConditions , uint32_t direction , uint32_t lower , uint32_t upper , uint32_t type ); 
fcns.name{fcnNum}='SetPulseWidthQualifierV2'; fcns.calltype{fcnNum}='stdcall'; fcns.LHS{fcnNum}='ulong'; fcns.RHS{fcnNum}={'int16', 'uint32Ptr', 'int16', 'uint32', 'uint32', 'uint32', 'uint32'};fcnNum=fcnNum+1;
% extern PICO_STATUS _stdcall SetTriggerConditions ( int16_t handle , uint32_t * conditionsArray , int16_t nConditions ); 
fcns.name{fcnNum}='SetTriggerConditions'; fcns.calltype{fcnNum}='stdcall'; fcns.LHS{fcnNum}='ulong'; fcns.RHS{fcnNum}={'int16', 'uint32Ptr', 'int16'};fcnNum=fcnNum+1;
% extern PICO_STATUS _stdcall SetTriggerConditionsV2 ( int16_t handle , uint32_t * conditionsArray , int16_t nConditions ); 
fcns.name{fcnNum}='SetTriggerConditionsV2'; fcns.calltype{fcnNum}='stdcall'; fcns.LHS{fcnNum}='ulong'; fcns.RHS{fcnNum}={'int16', 'uint32Ptr', 'int16'};fcnNum=fcnNum+1;
% extern PICO_STATUS _stdcall SetTriggerProperties ( int16_t handle , uint32_t * propertiesArray , int16_t nProperties , int32_t autoTrig ); 
fcns.name{fcnNum}='SetTriggerProperties'; fcns.calltype{fcnNum}='stdcall'; fcns.LHS{fcnNum}='ulong'; fcns.RHS{fcnNum}={'int16', 'uint32Ptr', 'int16', 'int32'};fcnNum=fcnNum+1;
% extern PICO_STATUS _stdcall resetNextDeviceIndex ( void ); 
fcns.name{fcnNum}='resetNextDeviceIndex'; fcns.calltype{fcnNum}='stdcall'; fcns.LHS{fcnNum}='ulong'; fcns.RHS{fcnNum}=[];fcnNum=fcnNum+1;
structs.tWrapUnitInfo.members=struct('handle', 'int16', 'channelCount', 'int16', 'enabledChannels', 'int16#4', 'digitalPortCount', 'int16', 'enabledDigitalPorts', 'int16#4', 'ready', 'int16', 'numSamples', 'int32', 'startIndex', 'uint32', 'overflow', 'int16', 'triggeredAt', 'uint32', 'triggered', 'int16', 'autoStop', 'int16', 'driverBuffers', 'int16PtrPtr', 'appBuffers', 'int16PtrPtr', 'bufferLengths', 'uint32#4', 'driverDigiBuffers', 'int16PtrPtr', 'appDigiBuffers', 'int16PtrPtr', 'digiBufferLengths', 'uint32#4');
enuminfo.enPS3000AWrapDigitalPortIndex=struct('PS3000A_WRAP_DIGITAL_PORT0',0,'PS3000A_WRAP_DIGITAL_PORT1',1);
methodinfo=fcns;

Contact us