source: MML/trunk/machine/SOLEIL/StorageRing/orbit/vfcm2zero.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 vfcm2zero(varargin)
2%VFCM2ZERO - Set vertical corrector strengths to zero
3%
4% vfcm2zero(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 vhcm2zero
15
16%
17%  Written by Gregory J. Portmann
18%  Adapted by Laurent S. Nadolski
19
20
21% Input Parser
22InteractiveFlag = 1;
23DefaultNstep = 10;
24
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
35VCORFamily = 'FVCOR';
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
49fprintf('1/ Verifier que le FOFB est arrété\n')
50fprintf('2/ Mettre les alimentations des steerers en controle local  via LabVIEW\n')
51fprintf('3/ Verifier que le SOFB tourne\n')
52fprintf('Si OK presser la touche Entree\n')
53pause
54
55fprintf('Lecture des courant des steerers\n')
56
57setpt = fract*getam(VCORFamily);
58
59for k=1:nstep
60    if InteractiveFlag
61        %disp(['   Step ' num2str(k) ' of ' num2str(nstep) ' Hit Return key to continue (Ctrl-C to stop)']);
62        disp(['   Etape ' num2str(k) ' sur ' num2str(nstep) ' Presser Enter pour continuer (Ctrl-C to stop)']);
63        pause;
64        fprintf('Attendre durant l''application des consignes et vérifier l''orbite ...\n')
65        setsp(VCORFamily, (1-k/nstep)*setpt, [], -1);       
66    else
67        setsp(VCORFamily, (1-k/nstep)*setpt, [], -1);       
68        pause(10)
69    end
70end
Note: See TracBrowser for help on using the repository browser.