-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcheck_owon_config.m
63 lines (63 loc) · 1.91 KB
/
check_owon_config.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
function [config] = check_owon_config(os)
% Checking Configuration and mapping the
% ADC data convertion rule
if strcmp(os.Status, 'closed')
fopen(os);
end
%%
% Timebase
out = query(os, ':HORI:SCAL?');
config.timebase = strcat(out);
fprintf('HOR:SCALE %s',out);
out = query(os, ':HORI:OFFS?');
config.timeoffset = strcat(out);
fprintf('HOR:OFFSET %s',out);
%%
% Trigger
out = query(os, ':TRIG:TYPE?');
fprintf('TRIG:TYPE %s', out);
TRIGTYPE = sprintf(':TRIG:%s', out(1:end-3));
out = query(os, [TRIGTYPE ':HOLD?']);
fprintf('TRIG:HOLDOFF %s',out);
out = query(os, [TRIGTYPE ':MODE?']);
TRIGTYPEMODE = sprintf('%s:%s', TRIGTYPE, out(1:end-3));
fprintf('TRIG:MODE %s',out);
out = query(os, [TRIGTYPE ':SWE?']);
fprintf('TRIG:SWEEP %s', out);
out = query(os, [TRIGTYPEMODE ':SOUR?']);
fprintf('TRIG:SOURCE %s', out);
out = query(os, [TRIGTYPEMODE ':COUP?']);
fprintf('TRIG:COUPLING %s', out);
out = query(os, [TRIGTYPEMODE ':SLOP?']);
fprintf('TRIG:SLOPE %s', out);
out = query(os, [TRIGTYPEMODE ':LEV?']);
fprintf('TRIG:LEVEL %s', out);
%%
% Acquire
out = query(os, [':ACQ:MODE?']);
config.acq_mode = strcat(out);
fprintf('ACQ:MODE %s', out);
out = query(os, [':ACQ:DEPMEM?']);
config.acq_depmem = strcat(out);
fprintf('ACQ:DEPTHMEM %s', out);
%%
% Channel
for n = 1:2
CHn = sprintf(':CH%d',n);
out = query(os, [CHn ':BAND?']);
config.ch_bwlim{n} = strcat(out);
fprintf('%s:BWLIMIT %s', CHn, out);
out = query(os, [CHn ':COUP?']);
config.ch_coup{n} = strcat(out);
fprintf('%s:COUPLING %s', CHn, out);
out = query(os, [CHn ':SCAL?']);
config.ch_scale{n} = strcat(out);
fprintf('%s:SCALE %s', CHn, out);
out = query(os, [CHn ':OFFS?']);
config.ch_offset{n} = strcat(out);
fprintf('%s:OFFSET %s', CHn, out);
out = query(os, [CHn ':DISP?']);
config.ch_status{n} = strcat(out);
fprintf('%s:DISPLAY %s', CHn, out);
end
% fclose(os);