Commit 00fccb92 authored by beam dyn's avatar beam dyn
Browse files

files saved in directory created by qempanel

parent 4599238a
function [n_and_dateX] =StartMresStimX(n,Xamp)
set_path
function [n_and_dateX] =StartMresStimX(n,Xamp,qemres)
% set_path
t1=clock
[IX, IZ, PX, PZ, N1X, N1Z ,N2X, N2Z]= savePID
[IX, IZ, PX, PZ, N1X, N1Z ,N2X, N2Z]= savePID(qemres)
pause(.1)
setPID(0,0,0,0,0,0,0,0,2000,2000)
devaclock=dvopen ('tango:sr/d-mfdbk/aclock')
......@@ -77,15 +77,12 @@ err=dvcmd(devInjPDamp,'devON')
devaclock=dvopen ('tango:sr/d-mfdbk/aclock')
err=dvcmd(devaclock,'Stop')
save lastMresH n_and_dateX Xamp
save(fullfile(qemres.datadir,'lastMresH'),'n_and_dateX','Xamp');
time=time_label;
file=['TimeLabelX',time];
DirLabel=pwd;
cd ..
cd libera_data
cd TimeLabel
pwd
save(file,'n_and_dateX' , 'Xamp')
dir
cd (DirLabel)
save(fullfile(qemres.datadir,file),'n_and_dateX' , 'Xamp')
err=dvcmd(devfofbcorh,'StopCorrection');
\ No newline at end of file
function [n_and_dateZ] =StartMresStimZ(n,Zamp)
set_path
function [n_and_dateZ] =StartMresStimZ(n,Zamp,qemres)
%set_path
t1=clock
[IX, IZ, PX, PZ, N1X, N1Z ,N2X, N2Z]= savePID
[IX, IZ, PX, PZ, N1X, N1Z ,N2X, N2Z]= savePID(qemres)
pause(.1)
setPID(0,0,0,0,0,0,0,0,2000,2000)
devaclock=dvopen ('tango:sr/d-mfdbk/aclock')
......@@ -73,15 +73,10 @@ pause(.1)
devaclock=dvopen ('tango:sr/d-mfdbk/aclock')
err=dvcmd(devaclock,'Stop')
save lastMresV n_and_dateZ Zamp
save(fullfile(qemres.datadir,'lastMresV'),'n_and_dateZ','Zamp');
time=time_label;
file=['TimeLabelZ',time];
DirLabel=pwd
cd ..
cd libera_data
cd TimeLabel
pwd
save(file,'n_and_dateZ','Zamp')
dir
cd (DirLabel)
save(fullfile(qemres.datadir,file),'n_and_dateZ','Zamp')
err=dvcmd(devfofbcorh,'StopCorrection');
\ No newline at end of file
function [IX, IZ, PX, PZ, N1X, N1Z ,N2X, N2Z]= savePID
function [IX, IZ, PX, PZ, N1X, N1Z ,N2X, N2Z]= savePID(qemres)
namefofbcorh=['tango:sr/d-fofbcorrection/globalX'];
namefofbcorv=['tango:sr/d-fofbcorrection/globalX'];
devIX=dvopen('tango:sr/d-fofbcorrection/globalX/IntegralGain');
......@@ -17,5 +17,6 @@ IZ=dvcmd(devIZ,'DevRead');
PZ=dvcmd(devPZ,'DevRead');
N1Z=dvcmd(devN1Z,'DevRead');
N2Z=dvcmd(devN2Z,'DevRead');
save lastPIDset IX IZ PX PZ N1X N1Z N2X N2Z
save(fullfile(qemres.datadir,'lastPIDset'),'IX',...
'IZ', 'PX', 'PZ', 'N1X', 'N1Z', 'N2X', 'N2Z');
......@@ -256,15 +256,10 @@ else % AC rm measurement
% ADD WARNING MESSAGE or question window to test FOFB is running.
answer = questdlg('Enable AC steerers. TEST FOFB (ON, then OFF). When ok press Yes','FOFB test');
answer = questdlg('TEST FOFB (ON, then OFF). When ok press Yes','FOFB test');
if strcmp(answer,'Yes')
if get(handles.PartialRMcheckbox,'Value') % FULL/PARTIAL
set(handles.PartialRMcheckbox,'Value',0.0)
set(handles.FullRMcheckbox,'Value',1.0)
disp('Force Full for AC measurement')
end
set(handles.statustext,'String','AC RM measurement');
n=80000; % total excitation duration in 0.1 ms (10kHz samples)
......@@ -273,9 +268,12 @@ else % AC rm measurement
Xamp=8000; % amplitude of horizontal excitation (a.u.)
Zamp=1500; % amplitude of vertical excitation (a.u.)
% ensure that the correct functions are used
addpath('/mntdirect/_operation/machine/matlab/qem/ACORM')
% measure RM
[n_and_dateX] = StartMresStimX(n,Xamp);
[n_and_dateZ] = StartMresStimZ(n,Zamp);
[n_and_dateX] = StartMresStimX(n,Xamp,qemres);
[n_and_dateZ] = StartMresStimZ(n,Zamp,qemres);
% get data from Fast Data Archiver
[normI,phi,firstX,MresH,MresVH] = CalMresfdaH(n_and_dateX,Xamp); %#ok<ASGLU>
......@@ -642,3 +640,10 @@ function ACRMcheckbox_Callback(hObject, eventdata, handles)
% Hint: get(hObject,'Value') returns toggle state of ACRMcheckbox
set(handles.ACRMcheckbox,'Value',1.0)
set(handles.DCRMcheckbox,'Value',0.0)
if get(handles.PartialRMcheckbox,'Value') % FULL/PARTIAL
set(handles.PartialRMcheckbox,'Value',0.0)
set(handles.FullRMcheckbox,'Value',1.0)
disp('Force Full for AC measurement')
end
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment