measurement state

This commit is contained in:
Silas Labor Zizou
2024-10-29 14:38:22 +01:00
parent 99fe2ca106
commit cf4e0f2b12
14 changed files with 1469 additions and 319 deletions

View File

@@ -52,7 +52,7 @@ classdef Exfo_laser < handle
if obj.safety_mode
warning("Safety_mode ON: Display all information. Ask when switching laser. Turn safety_mode off in class instance or during initialization Exfo_laser(...,'safety_mode',0)");
else
warning("safety_mode OFF: EVERYTHING IS EXECUTED WITHOUT ASKING :-) BE SHURE WHAT YOU DO");
warning("safety_mode OFF: EVERYTHING IS EXECUTED WITHOUT ASKING :-) BE SURE WHAT YOU DO");
end
end

View File

@@ -53,8 +53,11 @@ classdef OptAtten < handle
try
%connect to device
v = visadev('TCPIP::134.245.243.248::INSTR');
debug = 0;
if debug
disp(['Connected to Instrument: ',char(v.Vendor),' ',char(v.Model),' SerNo:',char(v.SerialNumber)]);
@@ -213,7 +216,7 @@ classdef OptAtten < handle
ch_info_txt = ['OptAtten: ',num2str(i),' -> Attenuated by: ',num2str(options.value(i)),' dB; Cur Output: ',num2str(state.outputpower(i)),'dBm'];
disp(ch_info_txt);
end
end
end
@@ -258,11 +261,6 @@ classdef OptAtten < handle
answer = sscanf(line,'%f');
obj.power_state(cnt) = answer;
writeline(v, [':READ' num2str(s) ':POW?']);
line = readline(v);
answer = sscanf(line,'%f');
obj.power_state(cnt) = answer;
writeline(v, [':INP' num2str(s) ':ATT?']);
line = readline(v);
answer = sscanf(line,'%f');
@@ -273,7 +271,7 @@ classdef OptAtten < handle
answer = sscanf(line,'%f');
obj.wavelength_state(cnt) = answer;
writeline(v, [':INP' num2str(s) ':WAV?']);
writeline(v, [':INP' num2str(s) ':ATT:SPE?']);
line = readline(v);
answer = sscanf(line,'%f');
obj.speed_state(cnt) = answer;
@@ -294,6 +292,25 @@ classdef OptAtten < handle
end
end
function [p1,p2,p3,p4]=readPower(obj)
v = visadev('TCPIP::134.245.243.248::INSTR');
cnt = 1;
for s = 1:2:7
writeline(v, [':READ' num2str(s) ':POW?']);
line = readline(v);
answer = sscanf(line,'%f');
obj.power_state(cnt) = answer;
cnt = cnt+1;
end
p1 = obj.power_state(1);
p2 = obj.power_state(2);
p3 = obj.power_state(3);
p4 = obj.power_state(4);
end
end
end

View File

@@ -131,7 +131,7 @@ classdef ScopeKeysight
%use this to finetune autoscaling - VERY helpful
% higher value leads to higher scaling
fintunefactor = 1.4; % within [1,...,2]
fintunefactor = 1.5; % within [1,...,2]
obj.writeNcheck(v,sprintf(':CHANnel%u:RANGe %.3f',n,range/fintunefactor));
end
else
@@ -141,6 +141,8 @@ classdef ScopeKeysight
% After Autoscale, let the user adjust the scope scaling...
% "options.waitUntilClick" was a shit name but now this is it :-)
if options.waitUntilClick
if 0
% Create a dialog box with the desired text
d = dialog('Name', 'Scale Scope then press continue', 'Position', [300, 300, 300, 180]);
@@ -160,6 +162,9 @@ classdef ScopeKeysight
% Pause execution until the dialog box is closed
uiwait(d);
else
holdAndShowValue
end
end
if obj.extRef