source: MML/trunk/machine/SOLEIL/StorageRing/orbit/hfcm2zero.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.9 KB
Line 
1function hfcm2zero(varargin)
2%HFCM2ZERO - Set horizontal corrector strengths to zero
3%
4% hfcm2zero(fraction, nstep)
5%
6%  INPUTS
7%  1. fract - fraction of corrector strength to put to zero
8%            {1} means correctors set to zero
9%             0.5 means half of the corrector strength set to zero
10%  2. nstep - number of step for zeroing correctors {Default: 5}
11%  3. Optional - 'Interactive' Wait for user for each step {Default}
12%                'NoInteractive' pause 10 s for each step     
13%
14%  See Also vfcm2zero
15
16%
17%  Written by Gregory J. Portmann
18%  Adapted by Laurent S. Nadolski
19
20InteractiveFlag = 1;
21DefaultNstep = 10;
22iPause = 1;
23
24% Input Parser
25for i = length(varargin):-1:1
26    if strcmpi(varargin{i},'Interactive')
27        InteractiveFlag = 1;
28        varargin(i) = [];
29    elseif strcmpi(varargin{i},'NoInteractive')
30        InteractiveFlag = 0;
31        varargin(i) = [];
32    end
33end
34       
35HCORFamily = 'FHCOR';
36
37if length(varargin) < 1
38    fract = 1;
39else
40    fract = varargin{1};
41end
42
43if length(varargin) < 2
44    nstep = DefaultNstep;
45else
46    nstep = varargin{2};
47end
48
49
50fprintf('1/ Verifier que le FOFB est arrété\n')
51fprintf('2/ Mettre les alimentations des steerers en controle local  via LabVIEW\n')
52fprintf('3/ Verifier que le SOFB tourne\n')
53fprintf('Si OK presser la touche Entree\n')
54pause
55
56
57fprintf('Lecture des courant des steerers\n')
58setpt = fract * getam(HCORFamily);
59
60for k = 1:nstep,
61    if InteractiveFlag
62        %disp(['   Step ' num2str(k) ' of ' num2str(nstep) ' Hit Return key to continue (Ctrl-C to stop)']);
63        disp(['   Etape ' num2str(k) ' sur ' num2str(nstep) ' Presser Enter pour continuer (Ctrl-C to stop)']);
64        pause;
65        fprintf('Attendre durant l''application des consignes et vérifier l''orbite ...\n')
66        setsp(HCORFamily, (1-k/nstep)*setpt, [], -1);
67    else
68        fprintf('Pause for %d s\n', iPause)
69        setsp(HCORFamily, (1-k/nstep)*setpt, [], -1);
70        pause(iPause)
71    end
72end
Note: See TracBrowser for help on using the repository browser.