Code covered by the BSD License  

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

image thumbnail

PicoScope® 2000 Series - MATLAB® Generic Instrument Driver

by

 

01 Feb 2013 (Updated )

MATLAB Instrument Driver for use with PicoScope 2000 Series oscilloscopes (Beta Release)

PS2000Config.m
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Filename:    PS2000Config.m
%
% Copyright:   Pico Technology Limited 2013
%
% Author:      HSM
%
% Description:
%   
%   Contains configuration data for setting parameters for a PicoScope 2000
%   Oscilloscope device.
%
%   Run this script in the MATLAB environment prior to connecting to the 
%   device.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%% SETUP PATH

addpath('') %Edit to specify location of dll files or place dlls in same directory
addpath('..');
addpath('..\Functions');

%% LOAD ENUMS AND STRUCTURES

[ps2000Methodinfo, ps2000Structs, ps2000Enuminfo, ps2000ThunkLibName]=PS2000MFile;

%% PICOSCOPE SETTINGS
% Define Settings for PicoScope 2000 series.

% Channel Settings

% Channel A
channelSettings.channelA.enabled = PicoConstants.TRUE;
channelSettings.channelA.dc = PicoConstants.TRUE;
channelSettings.channelA.range = ps2000Enuminfo.enPS2000Range.PS2000_1V;

% Channel B
channelSettings.channelB.enabled = PicoConstants.TRUE;
channelSettings.channelB.dc = PicoConstants.TRUE;
channelSettings.channelB.range = ps2000Enuminfo.enPS2000Range.PS2000_2V;

% Simple Trigger settings
simpleTrigger.source = ps2000Enuminfo.enPS2000Channel.PS2000_CHANNEL_A; % Set to PS2000_NONE to disable
simpleTrigger.threshold = 500;
simpleTrigger.direction = ps2000Enuminfo.enPS2000TriggerDirection.PS2000_RISING;
simpleTrigger.delay = -50;
simpleTrigger.autoTriggerMs = 10000; % 10 seconds

% Advanced Trigger settings % TBD

% Signal Generator settings

% General Signal Generator
sigGen.offsetVoltage    = 500;  %mv
sigGen.pkToPk           = 2000; %mv
sigGen.sweepType        = ps2000Enuminfo.enPS2000SweepType.PS2000_UP;
sigGen.sweeps           = 0;

% Built In 
sigGen.builtIn.waveType = ps2000Enuminfo.enPS2000WaveType.PS2000_SINE;
sigGen.builtIn.startFrequency = 500.0;  % Hz
sigGen.builtIn.stopFrequency = 5000.0;  % Hz
sigGen.builtIn.increment = 500;         % Hz
sigGen.builtIn.dwellTime = 1;           % seconds

% AWG Specific

% Create a sin(x) + sin(2x) wave

x = [0:(2 * pi)/ (PicoConstants.AWG_BUFFER_4KS - 1):2 * pi];
y = sin(x) + sin(2*x);

% Normalise the wave
sigGen.awg.waveform = normalise(y);
clear x;
clear y;

Contact us