Wouter Horlings пре 8 година
родитељ
комит
96e21d08a9
7 измењених фајлова са 29 додато и 12 уклоњено
  1. +6
    -6
      MOD2-files/EXP6/Experiment6_triangular_wave.m
  2. BIN
      OOequipment/Experiment5.zip
  3. BIN
      OOequipment/Experiment5_Solution.zip
  4. BIN
      OOequipment/RC_TransferFunction.mlx
  5. BIN
      OOequipment/RLC_TransferFunction.mlx
  6. +17
    -0
      OOequipment/subfiles/Channel.m
  7. +6
    -6
      OOequipment/subfiles/Equipment.m

+ 6
- 6
MOD2-files/EXP6/Experiment6_triangular_wave.m Прегледај датотеку

@@ -21,12 +21,12 @@ T2 = T/2;
T15 = 3*T/2;

drv=[];
for t=0:T/50:2*T;
if (t<T/2) drv=[drv -B+rc*t]; end;
if (T/2<=t)&(t<T) drv=[drv 3*B-rc*t]; end;
if (T<=t)&(t<T15) drv=[drv -5*B+rc*t]; end;
if (T15<=t) drv=[drv 7*B-rc*t]; end;
end;
for t=tv
if (t<T2) drv=[drv -B+rc*t]; end
if (T2<=t)&&(t<T) drv=[drv 3*B-rc*t]; end
if (T<=t)&&(t<T15) drv=[drv -5*B+rc*t]; end
if (T15<=t) drv=[drv 7*B-rc*t]; end
end

epdhv = ehv + dhv;
epdpvhv = epdhv + vhv;


BIN
OOequipment/Experiment5.zip Прегледај датотеку


BIN
OOequipment/Experiment5_Solution.zip Прегледај датотеку


BIN
OOequipment/RC_TransferFunction.mlx Прегледај датотеку


BIN
OOequipment/RLC_TransferFunction.mlx Прегледај датотеку


+ 17
- 0
OOequipment/subfiles/Channel.m Прегледај датотеку

@@ -15,6 +15,7 @@ classdef Channel
probe
label
type
probeunit
end
methods
@@ -50,6 +51,14 @@ classdef Channel
function out = get.type(ch)
out = ch.CHAN('type?');
end
function out = get.probeunit(ch)
out = ch.scope.query(['PROB',num2str(ch.channelnumber),':SET:ATT:UNIT?']);
end
function out = get.probe(ch)
out = ch.scope.query(['PROB',num2str(ch.channelnumber),':SET:ATT:MAN?']);
end
function ch = set.state(ch,in)
ch.CHAN('state',in);
@@ -107,6 +116,14 @@ classdef Channel
out = str2double(ch.MEAS('phas'));
end
function ch = set.probeunit(ch,unit)
ch.scope.write(['PROB',num2str(ch.channelnumber),':SET:ATT:UNIT ', unit]);
end
function ch = set.probe(ch,man)
ch.scope.write(['PROB',num2str(ch.channelnumber),':SET:ATT:MAN ', man]);
end
function data = waveform(ch,window)
ch.scope.single;
if nargin < 2


+ 6
- 6
OOequipment/subfiles/Equipment.m Прегледај датотеку

@@ -240,8 +240,8 @@ classdef Equipment < handle
methods (Access = protected, Hidden)
function setPrologix(ecq)
fprintf(ecq.tcp, '++mode 1'); %set device in controller mode
fprintf(ecq.tcp, '++auto 0'); %disable automatic datapull. this avoids errors on equipment.
ecq.write_unsafe('++mode 1'); %set device in controller mode
ecq.write_unsafe('++auto 0'); %disable automatic datapull. this avoids errors on equipment.
end
function delete(ecq)
@@ -265,10 +265,10 @@ classdef Equipment < handle
persistent tcpconnection; %make variable persistent to share tcp-handles across multiple function calls.
if isempty(tcpconnection)
%if the tcpconnection is empty (first time function
%call) make a struct in the variable.
tcpconnection = struct;
end
%if the tcpconnection is empty (first time function
%call) make a struct in the variable.
tcpconnection = struct;
end
[ipname,ipAddress] = Equipment.ip2structname(ipAddress,abs(port)); %Get a structname and a cleaned ipaddress.
if port > 0 %if port number is positive a connection is made.


Loading…
Откажи
Сачувај