source: MML/trunk/machine/SOLEIL/common/synchro/scan_synchro_KHV.m @ 4

Last change on this file since 4 was 4, checked in by zhangj, 10 years ago

Initial import--MML version from SOLEIL@2013

File size: 1.4 KB
Line 
1function scan_synchro_KHV
2
3fprintf('************ scan KHV ********** \n');
4
5temp=tango_read_attribute2('ANS-C01/SY/LOCAL.EP.1', 'k-v.trigStepDelay');kv0=temp.value(1);
6temp=tango_read_attribute2('ANS-C01/SY/LOCAL.EP.1', 'k-h.trigStepDelay');kh0=temp.value(1);
7
8delay=[];
9xx=[];
10for i=0:16:208  % scan sur un tour
11    % setp les clk
12    tango_write_attribute2('ANS-C01/SY/LOCAL.EP.1', 'k-h.trigStepDelay',(kh0+i) );
13    %tango_write_attribute2('ANS-C01/SY/LOCAL.EP.1', 'k-v.trigStepDelay',(kv0+i) );
14    delay=[delay (i)];
15    pause(1)
16   
17    % read again
18    temp=tango_read_attribute2('ANS-C01/SY/LOCAL.EP.1', 'k-h.trigStepDelay');kh1=temp.value(1);
19    %temp=tango_read_attribute2('ANS-C01/SY/LOCAL.EP.1', 'k-v.trigStepDelay');kv1=temp.value(1);
20   
21    % déclenche les kickers
22    tango_command_inout2('ANS/SY/CENTRAL','FireSoftEvent');
23    pause(2)
24   
25    % get DD sur BPM02
26    temp=tango_read_attribute2('ANS-C01/DG/BPM.2','XPosDD');
27    X=temp.value;
28    X=X(1:50);
29    X=X-mean(X);
30    Xmin=min(X);
31    Xmax=max(X);
32    Xrms=std(X);
33    dx=(Xmax-Xmin)/2;
34    xx=[xx dx];
35   
36    figure(5)
37    subplot(2,1,1)
38    plot(X,'-ob');xlabel('Tour');ylabel('Amp  (mm)');grid on
39    subplot(2,1,2)
40    plot(delay,xx,'-ob');xlabel('Step Delay');ylabel('Amp max (mm)');grid on
41   
42   
43    fprintf('StepDelay  KH= %d   Amplitude BPM02=%d \n',kh1,dx);
44   
45end
46
47
48
49tango_write_attribute2('ANS-C01/SY/LOCAL.EP.1', 'k-h.trigStepDelay',(kh0) );
Note: See TracBrowser for help on using the repository browser.