|
|
|
@@ -41,30 +41,30 @@ classdef FunctionGenerator < Equipment |
|
|
|
end |
|
|
|
|
|
|
|
function fg = set.waveform(fg,w) |
|
|
|
fg.write(strcat('FUNCtion:SHAPe ', FunctionGenerator.getWave(w))); |
|
|
|
fg.write(['FUNCtion:SHAPe ' FunctionGenerator.getWave(w)]); |
|
|
|
end |
|
|
|
|
|
|
|
function fg = set.frequency(fg,f) |
|
|
|
Equipment.forceNum(f); |
|
|
|
fg.write(strcat('FREQuency ', num2str(f))); |
|
|
|
fg.write(['FREQuency ' num2str(f)]); |
|
|
|
end |
|
|
|
|
|
|
|
function fg = set.voltage(fg,v) |
|
|
|
Equipment.forceNum(v); |
|
|
|
fg.write(strcat('VOLTage ', num2str(v))); |
|
|
|
fg.write(['VOLTage ' num2str(v)]); |
|
|
|
end |
|
|
|
|
|
|
|
function fg = set.unit(fg,u) |
|
|
|
fg.write(strcat('VOLTage:UNIT ', FunctionGenerator.getUnit(u))); |
|
|
|
fg.write(['VOLTage:UNIT ' FunctionGenerator.getUnit(u)]); |
|
|
|
end |
|
|
|
|
|
|
|
function fg = set.offset(fg,o) |
|
|
|
Equipment.forceNum(o); |
|
|
|
fg.write(strcat('VOLTage:OFFSet ', num2str(o))); |
|
|
|
fg.write(['VOLTage:OFFSet ' num2str(o)]); |
|
|
|
end |
|
|
|
|
|
|
|
function fg = set.load(fg,l) |
|
|
|
fg.write(strcat('OUTPut:LOAD ', FunctionGenerator.getLoad(l))); |
|
|
|
fg.write(['OUTPut:LOAD ' FunctionGenerator.getLoad(l)]); |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
@@ -73,7 +73,7 @@ classdef FunctionGenerator < Equipment |
|
|
|
w = regexp(num2str(win), '(si|sq|mi|ma|[trndu1-7]|s)', 'match', 'once', 'ignorecase'); |
|
|
|
|
|
|
|
if isempty(w) |
|
|
|
error(strcat('Invalid waveform: ', win)); |
|
|
|
error(['Invalid waveform: ' win]); |
|
|
|
end |
|
|
|
|
|
|
|
w = regexprep(w, {'^(1|si|(?-i)s)$', '^(2|sq|(?-i)S)$', '^[3t]$', '^[4r]$', '^[5n]$', '^[6d]$', '^[7u]$', '^mi$', '^ma$'}, ... |
|
|
|
@@ -84,7 +84,7 @@ classdef FunctionGenerator < Equipment |
|
|
|
u = regexp(num2str(uin), '([1-4]|vp|vr|db|de)', 'match', 'once', 'ignorecase'); |
|
|
|
|
|
|
|
if isempty(u) |
|
|
|
error(strcat('Invalid voltage unit: ', uin)); |
|
|
|
error(['Invalid voltage unit: ' uin]); |
|
|
|
end |
|
|
|
|
|
|
|
u = regexprep(u, {'^(1|vp)$', '^(2|vr)$', '^(3|db)$', '^(4|de)$'}, ... |
|
|
|
@@ -95,7 +95,7 @@ classdef FunctionGenerator < Equipment |
|
|
|
l = regexp(num2str(lin), '([12]|50|in|mi|ma)', 'match', 'once', 'ignorecase'); |
|
|
|
|
|
|
|
if isempty(l) |
|
|
|
error(strcat('Invalid load: ', lin)); |
|
|
|
error(['Invalid load: ' lin]); |
|
|
|
end |
|
|
|
|
|
|
|
u = regexprep(l, {'^(1|50)$', '^(2|in)$', '^mi$', '^ma$'}, ... |
|
|
|
|