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 | |
---|
1 | function [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 | |
---|
25 | DisplayFlag = 1; |
---|
26 | |
---|
27 | for 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 |
---|
35 | end |
---|
36 | |
---|
37 | if isempty(varargin) |
---|
38 | error('Give a BPM number') |
---|
39 | else |
---|
40 | num = varargin{1}; |
---|
41 | end |
---|
42 | |
---|
43 | AO=getao; |
---|
44 | |
---|
45 | attr_name = ... |
---|
46 | {'XPosVector','ZPosVector', 'QuadVector', 'SumVector', ... |
---|
47 | 'VaVector', 'VbVector', 'VcVector', 'VdVector'}; |
---|
48 | |
---|
49 | rep = tango_read_attributes(AO.BPMx.DeviceName{num},attr_name); |
---|
50 | |
---|
51 | X = rep(1).value; |
---|
52 | Z = rep(2).value; |
---|
53 | Q = rep(3).value; |
---|
54 | Sum = rep(4).value; |
---|
55 | Va = rep(5).value; |
---|
56 | Vb = rep(6).value; |
---|
57 | Vc = rep(7).value; |
---|
58 | Vd = rep(8).value; |
---|
59 | |
---|
60 | if 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})) |
---|
85 | end |
---|
Note: See
TracBrowser
for help on using the repository browser.