| @@ -132,7 +132,8 @@ classdef Oscilloscope < Equipment | |||||
| end | end | ||||
| function messageclose(sc) | function messageclose(sc) | ||||
| sc.write('DISP:DIAL:CLOS'); | |||||
| sc.opc; | |||||
| sc.write_unsafe('DISP:DIAL:CLOS'); | |||||
| end | end | ||||
| @@ -13,6 +13,7 @@ classdef Trigger | |||||
| slope | slope | ||||
| level | level | ||||
| coupling | coupling | ||||
| hfreject | |||||
| end | end | ||||
| methods | methods | ||||
| @@ -40,6 +41,10 @@ classdef Trigger | |||||
| s = tr.gettrig('EDGE:COUP?'); | s = tr.gettrig('EDGE:COUP?'); | ||||
| end | end | ||||
| function s = get.hfreject(tr) | |||||
| s = tr.gettrig('EDGE:FILT:HFR?'); | |||||
| end | |||||
| function tr = set.mode(tr,string) | function tr = set.mode(tr,string) | ||||
| tr.settrig(['mode ',string]); | tr.settrig(['mode ',string]); | ||||
| end | end | ||||
| @@ -60,6 +65,10 @@ classdef Trigger | |||||
| tr.settrig(['EDGE:COUP ',string]); | tr.settrig(['EDGE:COUP ',string]); | ||||
| end | end | ||||
| function tr = set.hfreject(tr,string) | |||||
| tr.settrig(['EDGE:FILT:HFR ' string]); | |||||
| end | |||||
| end | end | ||||
| @@ -1,6 +1,33 @@ | |||||
| oscilloscope.run; | oscilloscope.run; | ||||
| functiongenerator.frequency = frequency; | functiongenerator.frequency = frequency; | ||||
| functiongenerator.voltage = amplitude; | functiongenerator.voltage = amplitude; | ||||
| functiongenerator.waveform = waveform; | |||||
| oscilloscope.trigger.source='ch1'; | |||||
| oscilloscope.trigger.hfreject = 'on'; | |||||
| clear ax; | |||||
| oscilloscope.auto; | oscilloscope.auto; | ||||
| wave = oscilloscope.waveform; | wave = oscilloscope.waveform; | ||||
| T = wave.sampletime; | |||||
| t = (0:T:T*(wave.length-1))*1000; | |||||
| ch1 = wave.ch1; | |||||
| ch2 = wave.ch2.*attenuation; | |||||
| figure; | |||||
| plot(t,ch1,t,ch2); | |||||
| title('Waveforms from Oscillscope') | |||||
| legend('Channel 1','Channel 2'); | |||||
| xlabel('Time [ms]'); | |||||
| ylabel('Amplitude [V]'); | |||||
| ax(1) = gca; | |||||
| figure; | |||||
| ax(2) = subplot(2,1,1); | |||||
| plot(t,ch1) | |||||
| xlabel('Time [ms]'); | |||||
| ylabel('Amplitude [V]'); | |||||
| title('Channel 1 from Oscillscope') | |||||
| ax(3) = subplot(2,1,2); | |||||
| plot(t,ch2) | |||||
| xlabel('Time [ms]'); | |||||
| ylabel('Amplitude [V]'); | |||||
| title('Channel 2 from Oscillscope') | |||||
| linkaxes(ax(2:3)); | |||||
| arrayfun(@(x) set(x,{'XGrid','YGrid'},{'on','on'}),ax) | |||||