source: MML/trunk/machine/SOLEIL/Booster/readbpm.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.5 KB
Line 
1function [X Z Q Sum Va Vb Vc Vd] = readbpm(varargin)
2% READBPM - Gets turn by turn sample data for one BPM
3%
4%  INPUTS
5%  1. num - bpm number
6%  Optionnal
7%  Display/NoDisplay
8%
9%  OUTPUTS
10%  1. X - Horizontal data
11%  2. Z - Vertical data
12%  3. Q - Quadrupole signal data
13%  4. Sum - Sum signal data
14%  5. Va electrode data
15%  6. Vb electrode data
16%  7. Vc electrode data
17%  8. Vd electrode data
18%
19%
20% See Also getbpmrawdata
21
22%
23%  Written by Laurent S. Nadolski
24
25DisplayFlag = 1;
26
27for i = length(varargin):-1:1
28    if strcmpi(varargin{i},'Display')
29        DisplayFlag = 1;
30        varargin(i) = [];
31    elseif strcmpi(varargin{i},'NoDisplay')
32        DisplayFlag = 0;
33        varargin(i) = [];
34    end
35end
36
37if isempty(varargin)
38   error('Give a BPM number')
39else
40    num = varargin{1};
41end
42
43AO=getao;
44
45attr_name = ...
46   {'XPosVector','ZPosVector', 'QuadVector', 'SumVector', ...
47    'VaVector', 'VbVector', 'VcVector', 'VdVector'};
48
49rep = tango_read_attributes(AO.BPMx.DeviceName{num},attr_name);
50
51X   = rep(1).value;
52Z   = rep(2).value;
53Q   = rep(3).value;
54Sum = rep(4).value;
55Va  = rep(5).value;
56Vb  = rep(6).value;
57Vc  = rep(7).value;
58Vd  = rep(8).value;
59
60if DisplayFlag
61
62    subplot(2,2,1)
63    plot(X)
64    ylabel('X (mm)')
65    grid on
66
67    subplot(2,2,2)
68    plot(Z)
69    ylabel('Z (mm)')
70    grid on
71
72    subplot(2,2,3)
73    plot(Sum)
74    ylabel('SUM')
75    xlabel('turn number')
76    grid on
77
78    subplot(2,2,4)
79    plot(Q)
80    ylabel('Q')
81    xlabel('turn number')
82    grid on
83
84    suptitle(sprintf('Turn by turn data for %s',AO.BPMx.DeviceName{num}))
85end
Note: See TracBrowser for help on using the repository browser.