|
|
|
@@ -25,6 +25,58 @@ classdef Oscilloscope < Equipment |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
function s = get.acquisition(sc) |
|
|
|
s = sc.query('ACQ:STAT?'); |
|
|
|
end |
|
|
|
|
|
|
|
function run(sc) |
|
|
|
sc.write('RUN'); |
|
|
|
end |
|
|
|
|
|
|
|
function single(sc) |
|
|
|
sc.write('SING'); |
|
|
|
end |
|
|
|
|
|
|
|
function stop(sc) |
|
|
|
sc.write('STOP'); |
|
|
|
end |
|
|
|
|
|
|
|
function auto(sc) |
|
|
|
sc.write_noerror('AUT'); |
|
|
|
end |
|
|
|
|
|
|
|
function enable_channels(sc) |
|
|
|
for i = 1:sc.nchannels |
|
|
|
sc.(['ch',num2str(i)]).state = 'ON'; |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
function disable_channels(sc) |
|
|
|
for i = 1:sc.nchannels |
|
|
|
sc.(['ch',num2str(i)]).state = 'OFF'; |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
function setMeasurement(sc,measurement,type,source1,source2) |
|
|
|
prefix = ['MEAS',num2str(measurement),':']; |
|
|
|
fprintf(num2str(nargin)) |
|
|
|
if nargin < 5 |
|
|
|
source2 = 'CH2'; |
|
|
|
if nargin < 4 |
|
|
|
source1 = 'CH1'; |
|
|
|
end |
|
|
|
end |
|
|
|
source = [source1,', ',source2]; |
|
|
|
sc.write([prefix,'SOUR ',source]); |
|
|
|
sc.write([prefix,'MAIN ',type]); |
|
|
|
end |
|
|
|
|
|
|
|
function m = getMeasurement(sc,measurement) |
|
|
|
m = sc.query(['MEAS',num2str(measurement),':RES:ACT?']); |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
% function data = waveform(ch,cha) |
|
|
|
% ch.scope.clear; |
|
|
|
% ch.scope.write('CHAN1:TYPE HRES'); |
|
|
|
|