Bläddra i källkod

waveform_script afgerond. hfreject functie toegevoegd aan trigger

master
Wouter Horlings 8 år sedan
förälder
incheckning
5ab1a353ff
4 ändrade filer med 39 tillägg och 2 borttagningar
  1. Binär
      OOequipment/Waveform.mlx
  2. +2
    -1
      OOequipment/subfiles/Oscilloscope.m
  3. +9
    -0
      OOequipment/subfiles/Trigger.m
  4. +28
    -1
      OOequipment/subfiles/Waveform_script.m

Binär
OOequipment/Waveform.mlx Visa fil


+ 2
- 1
OOequipment/subfiles/Oscilloscope.m Visa fil

@@ -132,7 +132,8 @@ classdef Oscilloscope < Equipment
end
function messageclose(sc)
sc.write('DISP:DIAL:CLOS');
sc.opc;
sc.write_unsafe('DISP:DIAL:CLOS');
end


+ 9
- 0
OOequipment/subfiles/Trigger.m Visa fil

@@ -13,6 +13,7 @@ classdef Trigger
slope
level
coupling
hfreject
end
methods
@@ -40,6 +41,10 @@ classdef Trigger
s = tr.gettrig('EDGE:COUP?');
end
function s = get.hfreject(tr)
s = tr.gettrig('EDGE:FILT:HFR?');
end
function tr = set.mode(tr,string)
tr.settrig(['mode ',string]);
end
@@ -60,6 +65,10 @@ classdef Trigger
tr.settrig(['EDGE:COUP ',string]);
end
function tr = set.hfreject(tr,string)
tr.settrig(['EDGE:FILT:HFR ' string]);
end
end


+ 28
- 1
OOequipment/subfiles/Waveform_script.m Visa fil

@@ -1,6 +1,33 @@
oscilloscope.run;
functiongenerator.frequency = frequency;
functiongenerator.voltage = amplitude;
functiongenerator.waveform = waveform;
oscilloscope.trigger.source='ch1';
oscilloscope.trigger.hfreject = 'on';
clear ax;
oscilloscope.auto;
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)

Laddar…
Avbryt
Spara