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 | |
---|
1 | function [AM, tout, DataTime, ErrorFlag] = getbpmgroup(varargin) |
---|
2 | %GETBPMGROUP - Gets vertical orbit read into valid BPMS using TANGO groups |
---|
3 | % |
---|
4 | % INPUTS |
---|
5 | % 1. Familyname |
---|
6 | % 2. Field |
---|
7 | % 3. DeviceList - BPM devicelist |
---|
8 | % 4. time |
---|
9 | % |
---|
10 | % OUTPUTS |
---|
11 | % 1. AM - horizontal beam position |
---|
12 | % |
---|
13 | % NOTES |
---|
14 | % First shot |
---|
15 | |
---|
16 | |
---|
17 | % |
---|
18 | % Written by Laurent S. Nadolski |
---|
19 | |
---|
20 | t0 = clock; % starting time for getting data |
---|
21 | DataTime = 0; |
---|
22 | ErrorFlag = 1; |
---|
23 | Field = 'Monitor'; |
---|
24 | DeviceListTotal = family2dev('BPMz'); |
---|
25 | |
---|
26 | if isempty(varargin) |
---|
27 | DeviceList = DeviceListTotal; |
---|
28 | else |
---|
29 | DeviceList = varargin{3}; |
---|
30 | end |
---|
31 | |
---|
32 | GroupID = getfamilydata('BPMx', 'GroupId'); |
---|
33 | |
---|
34 | R = tango_group_read_attributes(GroupID, {'XPosSA', 'ZPosSA'}, 0); |
---|
35 | |
---|
36 | if tango_error |
---|
37 | tango_print_error_stack; |
---|
38 | ErrorFlag = 1; |
---|
39 | tout = etime(clock, t0); |
---|
40 | return; |
---|
41 | else |
---|
42 | if R.has_failed > 0 |
---|
43 | ErrorFlag = 1; |
---|
44 | for k=1:length(R.dev_replies), |
---|
45 | if R.dev_replies(k).hasfailed |
---|
46 | fprintf('BPM %s has failed \n', R.dev_replies(k).dev_name) |
---|
47 | end |
---|
48 | end |
---|
49 | ErrorFlag = 1; |
---|
50 | tout = etime(clock, t0); |
---|
51 | return; |
---|
52 | end |
---|
53 | end |
---|
54 | |
---|
55 | % construct data |
---|
56 | for k = 1:length(R.dev_replies), |
---|
57 | AM(k,1) = R.dev_replies(k).attr_values(1).value(1); |
---|
58 | end |
---|
59 | |
---|
60 | tout = etime(clock, t0); |
---|
61 | DataTime = R.dev_replies(1).attr_values(1).time; %time when data was measured accordint to Tango system |
---|
62 | Status = findrowindex(DeviceList, DeviceListTotal); |
---|
63 | AM = AM(Status); |
---|
Note: See
TracBrowser
for help on using the repository browser.