1 | function outStruct = idReadUndState(inStruct, idType, dispData) |
---|
2 | |
---|
3 | % Reading-in insertion device state, encoders positions, and current in correctors |
---|
4 | % according to its type |
---|
5 | % idType is expected to be: 'HU80_TEMPO', 'U20_PROXIMA1', 'HU640_DESIRS', ... |
---|
6 | |
---|
7 | idDevServMain01 = ''; |
---|
8 | idDevServMain02 = ''; |
---|
9 | idDevServMain03 = ''; |
---|
10 | idDevServCor01 = ''; |
---|
11 | idDevServCor02 = ''; |
---|
12 | idDevServCor03 = ''; |
---|
13 | idDevServCor04 = ''; |
---|
14 | idDevServVac01 = ''; |
---|
15 | |
---|
16 | if strncmp(idType, 'U20', 3) |
---|
17 | if strcmp(idType, 'U20_PROXIMA1') |
---|
18 | idDevServMain01 = 'ans-c10/ei/c-u20'; %to check the name |
---|
19 | %idDevServCor01 = 'ans-c08/ei/m-hu80.2_chan1'; |
---|
20 | %idDevServCor02 = 'ans-c08/ei/m-hu80.2_chan2'; |
---|
21 | %idDevServCor03 = 'ans-c08/ei/m-hu80.2_chan3'; |
---|
22 | %idDevServCor04 = 'ans-c08/ei/m-hu80.2_chan4'; |
---|
23 | %idDevServVac01 = 'tdl-i08-m/vi/jba.1'; |
---|
24 | elseif strcmp(idType, 'U20_SWING') |
---|
25 | idDevServMain01 = 'ans-c11/ei/c-u20'; %to check the name |
---|
26 | %idDevServCor01 = 'ans-c08/ei/m-hu80.2_chan1'; |
---|
27 | %idDevServCor02 = 'ans-c08/ei/m-hu80.2_chan2'; |
---|
28 | %idDevServCor03 = 'ans-c08/ei/m-hu80.2_chan3'; |
---|
29 | %idDevServCor04 = 'ans-c08/ei/m-hu80.2_chan4'; |
---|
30 | %idDevServVac01 = 'tdl-i08-m/vi/jba.1'; |
---|
31 | elseif strcmp(idType, 'U20_CRISTAL') |
---|
32 | idDevServMain01 = 'ans-c06/ei/c-u20'; %to check the name |
---|
33 | %idDevServCor01 = 'ans-c08/ei/m-hu80.2_chan1'; |
---|
34 | %idDevServCor02 = 'ans-c08/ei/m-hu80.2_chan2'; |
---|
35 | %idDevServCor03 = 'ans-c08/ei/m-hu80.2_chan3'; |
---|
36 | %idDevServCor04 = 'ans-c08/ei/m-hu80.2_chan4'; |
---|
37 | %idDevServVac01 = 'tdl-i08-m/vi/jba.1'; |
---|
38 | elseif strcmp(idType, 'U20_SIXS') |
---|
39 | idDevServMain01 = 'ans-c14/ei/c-u20'; %to check the name |
---|
40 | %idDevServCor01 = 'ans-c08/ei/m-hu80.2_chan1'; |
---|
41 | %idDevServCor02 = 'ans-c08/ei/m-hu80.2_chan2'; |
---|
42 | %idDevServCor03 = 'ans-c08/ei/m-hu80.2_chan3'; |
---|
43 | %idDevServCor04 = 'ans-c08/ei/m-hu80.2_chan4'; |
---|
44 | %idDevServVac01 = 'tdl-i08-m/vi/jba.1'; |
---|
45 | elseif strcmp(idType, 'U20_GALAXIES') |
---|
46 | idDevServMain01 = 'ans-c07/ei/c-u20'; %to check the name |
---|
47 | %idDevServCor01 = 'ans-c08/ei/m-hu80.2_chan1'; |
---|
48 | %idDevServCor02 = 'ans-c08/ei/m-hu80.2_chan2'; |
---|
49 | %idDevServCor03 = 'ans-c08/ei/m-hu80.2_chan3'; |
---|
50 | %idDevServCor04 = 'ans-c08/ei/m-hu80.2_chan4'; |
---|
51 | %idDevServVac01 = 'tdl-i08-m/vi/jba.1'; |
---|
52 | elseif strcmp(idType, 'U24_PXIIA') |
---|
53 | idDevServMain01 = 'ans-c11/ei/c-u24'; %to check the name |
---|
54 | %idDevServCor01 = 'ans-c08/ei/m-hu80.2_chan1'; |
---|
55 | %idDevServCor02 = 'ans-c08/ei/m-hu80.2_chan2'; |
---|
56 | %idDevServCor03 = 'ans-c08/ei/m-hu80.2_chan3'; |
---|
57 | %idDevServCor04 = 'ans-c08/ei/m-hu80.2_chan4'; |
---|
58 | %idDevServVac01 = 'tdl-i08-m/vi/jba.1'; |
---|
59 | elseif strcmp(idType, 'WSV50_PSICHE') |
---|
60 | idDevServMain01 = 'ans-c03/ei/c-wsv50'; %to check the name |
---|
61 | %idDevServCor01 = 'ans-c08/ei/m-hu80.2_chan1'; |
---|
62 | %idDevServCor02 = 'ans-c08/ei/m-hu80.2_chan2'; |
---|
63 | %idDevServCor03 = 'ans-c08/ei/m-hu80.2_chan3'; |
---|
64 | %idDevServCor04 = 'ans-c08/ei/m-hu80.2_chan4'; |
---|
65 | %idDevServVac01 = 'tdl-i08-m/vi/jba.1'; |
---|
66 | |
---|
67 | elseif strcmp(idType, 'U18_TOMO') |
---|
68 | idDevServMain01 = 'ans-c13/ei/l-U18.1'; %to check the name |
---|
69 | %idDevServCor01 = 'ans-c08/ei/m-hu80.2_chan1'; |
---|
70 | %idDevServCor02 = 'ans-c08/ei/m-hu80.2_chan2'; |
---|
71 | %idDevServCor03 = 'ans-c08/ei/m-hu80.2_chan3'; |
---|
72 | %idDevServCor04 = 'ans-c08/ei/m-hu80.2_chan4'; |
---|
73 | %idDevServVac01 = 'tdl-i08-m/vi/jba.1'; |
---|
74 | |
---|
75 | elseif strcmp(idType, 'U20_NANO') |
---|
76 | idDevServMain01 = 'ans-c13/ei/l-U20.2'; %to check the name |
---|
77 | %idDevServCor01 = 'ans-c08/ei/m-hu80.2_chan1'; |
---|
78 | %idDevServCor02 = 'ans-c08/ei/m-hu80.2_chan2'; |
---|
79 | %idDevServCor03 = 'ans-c08/ei/m-hu80.2_chan3'; |
---|
80 | %idDevServCor04 = 'ans-c08/ei/m-hu80.2_chan4'; |
---|
81 | %idDevServVac01 = 'tdl-i08-m/vi/jba.1'; |
---|
82 | |
---|
83 | |
---|
84 | end |
---|
85 | % Gap encoders |
---|
86 | inStruct.encoder1 = readattribute([idDevServMain01, '/encoder1Position']); |
---|
87 | inStruct.encoder2 = readattribute([idDevServMain01, '/encoder2Position']); |
---|
88 | % Currents in the correction channels |
---|
89 | %inStruct.curCorCh1 = readattribute([idDevServCor, '/...']); |
---|
90 | %inStruct.curCorCh2 = readattribute([idDevServCor, '/...']); |
---|
91 | |
---|
92 | elseif strncmp(idType, 'HU80', 4) |
---|
93 | if strcmp(idType, 'HU80_TEMPO') |
---|
94 | idDevServMain01 = 'ans-c08/ei/m-hu80.2'; |
---|
95 | idDevServCor01 = 'ans-c08/ei/m-hu80.2_chan1'; |
---|
96 | idDevServCor02 = 'ans-c08/ei/m-hu80.2_chan2'; |
---|
97 | idDevServCor03 = 'ans-c08/ei/m-hu80.2_chan3'; |
---|
98 | idDevServCor04 = 'ans-c08/ei/m-hu80.2_chan4'; |
---|
99 | idDevServVac01 = 'tdl-i08-m/vi/jba.1'; |
---|
100 | elseif strcmp(idType, 'HU80_PLEIADES') |
---|
101 | idDevServMain01 = 'ans-c04/ei/m-hu80.1'; |
---|
102 | idDevServCor01 = 'ans-c04/ei/m-hu80.1_chan1'; |
---|
103 | idDevServCor02 = 'ans-c04/ei/m-hu80.1_chan2'; |
---|
104 | idDevServCor03 = 'ans-c04/ei/m-hu80.1_chan3'; |
---|
105 | idDevServCor04 = 'ans-c04/ei/m-hu80.1_chan4'; |
---|
106 | idDevServVac01 = 'ans-c04/vi/pi.02'; %to change to tdl when it' installed !!! |
---|
107 | elseif strcmp(idType, 'HU80_SEXTANTS') |
---|
108 | idDevServMain01 = 'ans-c14/ei/m-hu80.2';%'ans-c14/ei/m-hu80.1_motorscontrol'; |
---|
109 | idDevServCor01 = 'ans-c14/ei/m-hu80.2_chan1'; %'ans-c14/ei/m-hu80.1_chan1'; |
---|
110 | idDevServCor02 = 'ans-c14/ei/m-hu80.2_chan2'; %'ans-c14/ei/m-hu80.1_chan2'; |
---|
111 | idDevServCor03 = 'ans-c14/ei/m-hu80.2_chan3'; %'ans-c14/ei/m-hu80.1_chan3'; |
---|
112 | idDevServCor04 = 'ans-c14/ei/m-hu80.2_chan4'; %'ans-c14/ei/m-hu80.1_chan4'; |
---|
113 | idDevServVac01 = 'tdl-i14-m/vi/pi.01'; |
---|
114 | end |
---|
115 | |
---|
116 | % Gap encoders |
---|
117 | inStruct.idEncoder1 = readattribute([idDevServMain01, '/encoder1Position']); |
---|
118 | %inStruct.idEncoder1 = tango_read_attribute2(idDevServMain01, 'encoder1Position'); |
---|
119 | inStruct.idEncoder2 = readattribute([idDevServMain01, '/encoder2Position']); |
---|
120 | %inStruct.idEncoder2 = tango_read_attribute2(idDevServMain01, 'encoder2Position'); |
---|
121 | inStruct.idEncoder3 = readattribute([idDevServMain01, '/encoder3Position']); |
---|
122 | %inStruct.idEncoder3 = tango_read_attribute2(idDevServMain01, 'encoder3Position'); |
---|
123 | inStruct.idEncoder4 = readattribute([idDevServMain01, '/encoder4Position']); |
---|
124 | %inStruct.idEncoder4 = tango_read_attribute2(idDevServMain01, 'encoder4Position'); |
---|
125 | |
---|
126 | % Phase encoders |
---|
127 | inStruct.idEncoder5 = readattribute([idDevServMain01, '/encoder5Position']); |
---|
128 | %inStruct.idEncoder5 = tango_read_attribute2(idDevServMain01, 'encoder5Position'); |
---|
129 | inStruct.idEncoder6 = readattribute([idDevServMain01, '/encoder6Position']); |
---|
130 | %inStruct.idEncoder6 = tango_read_attribute2(idDevServMain01, 'encoder6Position'); |
---|
131 | |
---|
132 | % Currents in the correction channels |
---|
133 | inStruct.idCurCorCh1 = readattribute([idDevServCor01, '/current']); |
---|
134 | inStruct.idCurCorCh2 = readattribute([idDevServCor02, '/current']); |
---|
135 | inStruct.idCurCorCh3 = readattribute([idDevServCor03, '/current']); |
---|
136 | inStruct.idCurCorCh4 = readattribute([idDevServCor04, '/current']); |
---|
137 | |
---|
138 | % Pressure in the ring in the proximity of the SR spot made by the undulator |
---|
139 | inStruct.ringPres = readattribute([idDevServVac01, '/pressure']); |
---|
140 | |
---|
141 | if dispData ~= 0 |
---|
142 | fprintf('pressure = %d\n', inStruct.ringPres); |
---|
143 | fprintf('idEncoder1 = %f\n', inStruct.idEncoder1); |
---|
144 | fprintf('idEncoder2 = %f\n', inStruct.idEncoder2); |
---|
145 | fprintf('idEncoder3 = %f\n', inStruct.idEncoder3); |
---|
146 | fprintf('idEncoder4 = %f\n', inStruct.idEncoder4); |
---|
147 | fprintf('idEncoder5 = %f\n', inStruct.idEncoder5); |
---|
148 | fprintf('idEncoder6 = %f\n', inStruct.idEncoder6); |
---|
149 | fprintf('idCurCorCh1 = %f\n', inStruct.idCurCorCh1); |
---|
150 | fprintf('idCurCorCh2 = %f\n', inStruct.idCurCorCh2); |
---|
151 | fprintf('idCurCorCh3 = %f\n', inStruct.idCurCorCh3); |
---|
152 | fprintf('idCurCorCh4 = %f\n', inStruct.idCurCorCh4); |
---|
153 | end |
---|
154 | |
---|
155 | elseif strncmp(idType, 'HU52', 4) |
---|
156 | if strcmp(idType, 'HU52_DEIMOS') |
---|
157 | idDevServMain01 = 'ans-c07/ei/m-hu52.1'; |
---|
158 | idDevServCor01 = 'ans-c07/ei/m-hu52.1_chan1'; |
---|
159 | idDevServCor02 = 'ans-c07/ei/m-hu52.1_chan2'; |
---|
160 | idDevServCor03 = 'ans-c07/ei/m-hu52.1_chan3'; |
---|
161 | idDevServCor04 = 'ans-c07/ei/m-hu52.1_chan4'; |
---|
162 | %idDevServVac01 = 'tdl-i07-m/vi/jba.1'; |
---|
163 | idDevServVac01 = 'ans-c07/vi/pi.02'; |
---|
164 | elseif strcmp(idType, 'HU52_LUCIA') |
---|
165 | idDevServMain01 = 'ans-c16/ei/m-hu52.1'; |
---|
166 | idDevServCor01 = 'ans-c16/ei/m-hu52.1_chan1'; |
---|
167 | idDevServCor02 = 'ans-c16/ei/m-hu52.1_chan2'; |
---|
168 | idDevServCor03 = 'ans-c16/ei/m-hu52.1_chan3'; |
---|
169 | idDevServCor04 = 'ans-c16/ei/m-hu52.1_chan4'; |
---|
170 | idDevServVac01 = 'ans-c16/vi/pi.02'; %to change to tdl when it' installed !!! |
---|
171 | end |
---|
172 | |
---|
173 | % Gap encoders |
---|
174 | inStruct.idEncoder1 = readattribute([idDevServMain01, '/encoder1Position']); |
---|
175 | %inStruct.idEncoder1 = tango_read_attribute2(idDevServMain01, 'encoder1Position'); |
---|
176 | inStruct.idEncoder2 = readattribute([idDevServMain01, '/encoder2Position']); |
---|
177 | %inStruct.idEncoder2 = tango_read_attribute2(idDevServMain01, 'encoder2Position'); |
---|
178 | inStruct.idEncoder3 = readattribute([idDevServMain01, '/encoder3Position']); |
---|
179 | %inStruct.idEncoder3 = tango_read_attribute2(idDevServMain01, 'encoder3Position'); |
---|
180 | inStruct.idEncoder4 = readattribute([idDevServMain01, '/encoder4Position']); |
---|
181 | %inStruct.idEncoder4 = tango_read_attribute2(idDevServMain01, 'encoder4Position'); |
---|
182 | |
---|
183 | % Phase encoders |
---|
184 | inStruct.idEncoder5 = readattribute([idDevServMain01, '/encoder5Position']); |
---|
185 | %inStruct.idEncoder5 = tango_read_attribute2(idDevServMain01, 'encoder5Position'); |
---|
186 | inStruct.idEncoder6 = readattribute([idDevServMain01, '/encoder6Position']); |
---|
187 | %inStruct.idEncoder6 = tango_read_attribute2(idDevServMain01, 'encoder6Position'); |
---|
188 | |
---|
189 | % Currents in the correction channels |
---|
190 | inStruct.idCurCorCh1 = readattribute([idDevServCor01, '/current']); |
---|
191 | inStruct.idCurCorCh2 = readattribute([idDevServCor02, '/current']); |
---|
192 | inStruct.idCurCorCh3 = readattribute([idDevServCor03, '/current']); |
---|
193 | inStruct.idCurCorCh4 = readattribute([idDevServCor04, '/current']); |
---|
194 | |
---|
195 | % Pressure in the ring in the proximity of the SR spot made by the undulator |
---|
196 | inStruct.ringPres = readattribute([idDevServVac01, '/pressure']); |
---|
197 | |
---|
198 | if dispData ~= 0 |
---|
199 | fprintf('pressure = %d\n', inStruct.ringPres); |
---|
200 | fprintf('idEncoder1 = %f\n', inStruct.idEncoder1); |
---|
201 | fprintf('idEncoder2 = %f\n', inStruct.idEncoder2); |
---|
202 | fprintf('idEncoder3 = %f\n', inStruct.idEncoder3); |
---|
203 | fprintf('idEncoder4 = %f\n', inStruct.idEncoder4); |
---|
204 | fprintf('idEncoder5 = %f\n', inStruct.idEncoder5); |
---|
205 | fprintf('idEncoder6 = %f\n', inStruct.idEncoder6); |
---|
206 | fprintf('idCurCorCh1 = %f\n', inStruct.idCurCorCh1); |
---|
207 | fprintf('idCurCorCh2 = %f\n', inStruct.idCurCorCh2); |
---|
208 | fprintf('idCurCorCh3 = %f\n', inStruct.idCurCorCh3); |
---|
209 | fprintf('idCurCorCh4 = %f\n', inStruct.idCurCorCh4); |
---|
210 | end |
---|
211 | |
---|
212 | elseif strncmp(idType, 'HU44', 4) |
---|
213 | if strcmp(idType, 'HU44_TEMPO') |
---|
214 | idDevServMain01 = 'ans-c08/ei/m-hu44.1'; |
---|
215 | idDevServCor01 = 'ans-c08/ei/m-hu44.1_chan1'; |
---|
216 | idDevServCor02 = 'ans-c08/ei/m-hu44.1_chan2'; |
---|
217 | idDevServCor03 = 'ans-c08/ei/m-hu44.1_chan3'; |
---|
218 | idDevServCor04 = 'ans-c08/ei/m-hu44.1_chan4'; |
---|
219 | idDevServVac01 = 'ans-c08/vi/pi.02'; |
---|
220 | %idDevServVac01 = 'ans-c04/vi/pi.02'; %change it ! |
---|
221 | elseif strcmp(idType, 'HU44_MICROFOC') |
---|
222 | idDevServMain01 = 'ans-c14/ei/m-hu44.1'; |
---|
223 | idDevServCor01 = 'ans-c14/ei/m-hu44.1_chan1'; |
---|
224 | idDevServCor02 = 'ans-c14/ei/m-hu44.1_chan2'; |
---|
225 | idDevServCor03 = 'ans-c14/ei/m-hu44.1_chan3'; |
---|
226 | idDevServCor04 = 'ans-c14/ei/m-hu44.1_chan4'; |
---|
227 | idDevServVac01 = 'ans-c14/vi/pi.02'; % TO BE CHANGED !!! |
---|
228 | end |
---|
229 | |
---|
230 | % Gap encoders |
---|
231 | inStruct.idEncoder1 = readattribute([idDevServMain01, '/encoder1Position']); |
---|
232 | inStruct.idEncoder2 = readattribute([idDevServMain01, '/encoder2Position']); |
---|
233 | inStruct.idEncoder3 = readattribute([idDevServMain01, '/encoder3Position']); |
---|
234 | inStruct.idEncoder4 = readattribute([idDevServMain01, '/encoder4Position']); |
---|
235 | |
---|
236 | % Phase encoders |
---|
237 | inStruct.idEncoder5 = readattribute([idDevServMain01, '/encoder5Position']); |
---|
238 | inStruct.idEncoder6 = readattribute([idDevServMain01, '/encoder6Position']); |
---|
239 | |
---|
240 | % Currents in the correction channels |
---|
241 | inStruct.idCurCorCh1 = readattribute([idDevServCor01, '/current']); |
---|
242 | inStruct.idCurCorCh2 = readattribute([idDevServCor02, '/current']); |
---|
243 | inStruct.idCurCorCh3 = readattribute([idDevServCor03, '/current']); |
---|
244 | inStruct.idCurCorCh4 = readattribute([idDevServCor04, '/current']); |
---|
245 | |
---|
246 | % Pressure in the ring in the proximity of the SR spot made by the undulator |
---|
247 | inStruct.ringPres = readattribute([idDevServVac01, '/pressure']); |
---|
248 | |
---|
249 | if dispData ~= 0 |
---|
250 | fprintf('pressure = %d\n', inStruct.ringPres); |
---|
251 | fprintf('idEncoder1 = %f\n', inStruct.idEncoder1); |
---|
252 | fprintf('idEncoder2 = %f\n', inStruct.idEncoder2); |
---|
253 | fprintf('idEncoder3 = %f\n', inStruct.idEncoder3); |
---|
254 | fprintf('idEncoder4 = %f\n', inStruct.idEncoder4); |
---|
255 | fprintf('idEncoder5 = %f\n', inStruct.idEncoder5); |
---|
256 | fprintf('idEncoder6 = %f\n', inStruct.idEncoder6); |
---|
257 | fprintf('idCurCorCh1 = %f\n', inStruct.idCurCorCh1); |
---|
258 | fprintf('idCurCorCh2 = %f\n', inStruct.idCurCorCh2); |
---|
259 | fprintf('idCurCorCh3 = %f\n', inStruct.idCurCorCh3); |
---|
260 | fprintf('idCurCorCh4 = %f\n', inStruct.idCurCorCh4); |
---|
261 | end |
---|
262 | elseif strncmp(idType, 'HU60', 4) |
---|
263 | if strcmp(idType, 'HU60_CASSIOPEE') |
---|
264 | idDevServMain01 = 'ans-c15/ei/m-hu60.1'; |
---|
265 | idDevServCor01 = 'ans-c15/ei/m-hu60.1_chan1'; |
---|
266 | idDevServCor02 = 'ans-c15/ei/m-hu60.1_chan2'; |
---|
267 | idDevServCor03 = 'ans-c15/ei/m-hu60.1_chan3'; |
---|
268 | idDevServCor04 = 'ans-c15/ei/m-hu60.1_chan4'; |
---|
269 | idDevServVac01 = 'tdl-i15-m/vi/pi.01'; |
---|
270 | elseif strcmp(idType, 'HU60_ANTARES') |
---|
271 | idDevServMain01 = 'ans-c12/ei/m-hu60.1'; |
---|
272 | idDevServCor01 = 'ans-c12/ei/m-hu60.1_chan1'; |
---|
273 | idDevServCor02 = 'ans-c12/ei/m-hu60.1_chan2'; |
---|
274 | idDevServCor03 = 'ans-c12/ei/m-hu60.1_chan3'; |
---|
275 | idDevServCor04 = 'ans-c12/ei/m-hu60.1_chan4'; |
---|
276 | idDevServVac01 = 'ans-c12/vi/pi.02'; %to change to tdl when it' installed !!! |
---|
277 | end |
---|
278 | |
---|
279 | % Gap encoders |
---|
280 | inStruct.idEncoder1 = readattribute([idDevServMain01, '/encoder1Position']); |
---|
281 | %inStruct.idEncoder1 = tango_read_attribute2(idDevServMain01, 'encoder1Position'); |
---|
282 | inStruct.idEncoder2 = readattribute([idDevServMain01, '/encoder2Position']); |
---|
283 | %inStruct.idEncoder2 = tango_read_attribute2(idDevServMain01, 'encoder2Position'); |
---|
284 | inStruct.idEncoder3 = readattribute([idDevServMain01, '/encoder3Position']); |
---|
285 | %inStruct.idEncoder3 = tango_read_attribute2(idDevServMain01, 'encoder3Position'); |
---|
286 | inStruct.idEncoder4 = readattribute([idDevServMain01, '/encoder4Position']); |
---|
287 | %inStruct.idEncoder4 = tango_read_attribute2(idDevServMain01, 'encoder4Position'); |
---|
288 | |
---|
289 | % Phase encoders |
---|
290 | inStruct.idEncoder5 = readattribute([idDevServMain01, '/encoder5Position']); |
---|
291 | %inStruct.idEncoder5 = tango_read_attribute2(idDevServMain01, 'encoder5Position'); |
---|
292 | inStruct.idEncoder6 = readattribute([idDevServMain01, '/encoder6Position']); |
---|
293 | %inStruct.idEncoder6 = tango_read_attribute2(idDevServMain01, 'encoder6Position'); |
---|
294 | |
---|
295 | % Currents in the correction channels |
---|
296 | inStruct.idCurCorCh1 = readattribute([idDevServCor01, '/current']); |
---|
297 | inStruct.idCurCorCh2 = readattribute([idDevServCor02, '/current']); |
---|
298 | inStruct.idCurCorCh3 = readattribute([idDevServCor03, '/current']); |
---|
299 | inStruct.idCurCorCh4 = readattribute([idDevServCor04, '/current']); |
---|
300 | |
---|
301 | % Pressure in the ring in the proximity of the SR spot made by the undulator |
---|
302 | inStruct.ringPres = readattribute([idDevServVac01, '/pressure']); |
---|
303 | |
---|
304 | if dispData ~= 0 |
---|
305 | fprintf('pressure = %d\n', inStruct.ringPres); |
---|
306 | fprintf('idEncoder1 = %f\n', inStruct.idEncoder1); |
---|
307 | fprintf('idEncoder2 = %f\n', inStruct.idEncoder2); |
---|
308 | fprintf('idEncoder3 = %f\n', inStruct.idEncoder3); |
---|
309 | fprintf('idEncoder4 = %f\n', inStruct.idEncoder4); |
---|
310 | fprintf('idEncoder5 = %f\n', inStruct.idEncoder5); |
---|
311 | fprintf('idEncoder6 = %f\n', inStruct.idEncoder6); |
---|
312 | fprintf('idCurCorCh1 = %f\n', inStruct.idCurCorCh1); |
---|
313 | fprintf('idCurCorCh2 = %f\n', inStruct.idCurCorCh2); |
---|
314 | fprintf('idCurCorCh3 = %f\n', inStruct.idCurCorCh3); |
---|
315 | fprintf('idCurCorCh4 = %f\n', inStruct.idCurCorCh4); |
---|
316 | end |
---|
317 | |
---|
318 | elseif strncmp(idType, 'HU36', 4) |
---|
319 | if strcmp(idType, 'HU36_SIRIUS') |
---|
320 | idDevServMain01 = 'ans-c15/ei/c-hu36'; |
---|
321 | idDevServCor01 = 'ans-c15/ei/c-hu36_chan1'; |
---|
322 | idDevServCor02 = 'ans-c15/ei/c-hu36_chan2'; |
---|
323 | idDevServCor03 = 'ans-c15/ei/c-hu36_chan3'; |
---|
324 | idDevServCor04 = 'ans-c15/ei/c-hu36_chan4'; |
---|
325 | idDevServVac01 = 'tdl-i15-c/vi/pi.01';%to change to tdl when it' installed !!! |
---|
326 | end |
---|
327 | |
---|
328 | % Gap encoders |
---|
329 | inStruct.idEncoder1 = readattribute([idDevServMain01, '/encoder1Position']); |
---|
330 | %inStruct.idEncoder1 = tango_read_attribute2(idDevServMain01, 'encoder1Position'); |
---|
331 | inStruct.idEncoder2 = readattribute([idDevServMain01, '/encoder2Position']); |
---|
332 | %inStruct.idEncoder2 = tango_read_attribute2(idDevServMain01, 'encoder2Position'); |
---|
333 | inStruct.idEncoder3 = readattribute([idDevServMain01, '/encoder3Position']); |
---|
334 | %inStruct.idEncoder3 = tango_read_attribute2(idDevServMain01, 'encoder3Position'); |
---|
335 | inStruct.idEncoder4 = readattribute([idDevServMain01, '/encoder4Position']); |
---|
336 | %inStruct.idEncoder4 = tango_read_attribute2(idDevServMain01, 'encoder4Position'); |
---|
337 | |
---|
338 | % Phase encoders |
---|
339 | inStruct.idEncoder5 = readattribute([idDevServMain01, '/encoder5Position']); |
---|
340 | %inStruct.idEncoder5 = tango_read_attribute2(idDevServMain01, 'encoder5Position'); |
---|
341 | inStruct.idEncoder6 = readattribute([idDevServMain01, '/encoder6Position']); |
---|
342 | %inStruct.idEncoder6 = tango_read_attribute2(idDevServMain01, 'encoder6Position'); |
---|
343 | |
---|
344 | % Currents in the correction channels |
---|
345 | inStruct.idCurCorCh1 = readattribute([idDevServCor01, '/current']); |
---|
346 | inStruct.idCurCorCh2 = readattribute([idDevServCor02, '/current']); |
---|
347 | inStruct.idCurCorCh3 = readattribute([idDevServCor03, '/current']); |
---|
348 | inStruct.idCurCorCh4 = readattribute([idDevServCor04, '/current']); |
---|
349 | |
---|
350 | % Pressure in the ring in the proximity of the SR spot made by the undulator |
---|
351 | inStruct.ringPres = readattribute([idDevServVac01, '/pressure']); |
---|
352 | |
---|
353 | if dispData ~= 0 |
---|
354 | fprintf('pressure = %d\n', inStruct.ringPres); |
---|
355 | fprintf('idEncoder1 = %f\n', inStruct.idEncoder1); |
---|
356 | fprintf('idEncoder2 = %f\n', inStruct.idEncoder2); |
---|
357 | fprintf('idEncoder3 = %f\n', inStruct.idEncoder3); |
---|
358 | fprintf('idEncoder4 = %f\n', inStruct.idEncoder4); |
---|
359 | fprintf('idEncoder5 = %f\n', inStruct.idEncoder5); |
---|
360 | fprintf('idEncoder6 = %f\n', inStruct.idEncoder6); |
---|
361 | fprintf('idCurCorCh1 = %f\n',inStruct.idCurCorCh1); |
---|
362 | fprintf('idCurCorCh2 = %f\n',inStruct.idCurCorCh2); |
---|
363 | fprintf('idCurCorCh3 = %f\n',inStruct.idCurCorCh3); |
---|
364 | fprintf('idCurCorCh4 = %f\n',inStruct.idCurCorCh4); |
---|
365 | end |
---|
366 | elseif strncmp(idType, 'HU42', 4) |
---|
367 | if strcmp(idType, 'HU42_HERMES') |
---|
368 | idDevServMain01 = 'ans-c10/ei/m-hu42.1'; |
---|
369 | idDevServCor01 = 'ans-c10/ei/m-hu42.1_chan1'; |
---|
370 | idDevServCor02 = 'ans-c10/ei/m-hu42.1_chan2'; |
---|
371 | idDevServCor03 = 'ans-c10/ei/m-hu42.1_chan3'; |
---|
372 | idDevServCor04 = 'ans-c10/ei/m-hu42.1_chan4'; |
---|
373 | idDevServVac01 = 'tdl-i10-m/vi/pi.01';%to change to tdl when it' installed !!! |
---|
374 | end |
---|
375 | |
---|
376 | % Gap encoders |
---|
377 | inStruct.idEncoder1 = readattribute([idDevServMain01, '/encoder1Position']); |
---|
378 | inStruct.idEncoder2 = readattribute([idDevServMain01, '/encoder2Position']); |
---|
379 | inStruct.idEncoder3 = readattribute([idDevServMain01, '/encoder3Position']); |
---|
380 | inStruct.idEncoder4 = readattribute([idDevServMain01, '/encoder4Position']); |
---|
381 | |
---|
382 | % Phase encoders |
---|
383 | inStruct.idEncoder5 = readattribute([idDevServMain01, '/encoder5Position']); |
---|
384 | inStruct.idEncoder6 = readattribute([idDevServMain01, '/encoder6Position']); |
---|
385 | |
---|
386 | % Currents in the correction channels |
---|
387 | inStruct.idCurCorCh1 = readattribute([idDevServCor01, '/current']); |
---|
388 | inStruct.idCurCorCh2 = readattribute([idDevServCor02, '/current']); |
---|
389 | inStruct.idCurCorCh3 = readattribute([idDevServCor03, '/current']); |
---|
390 | inStruct.idCurCorCh4 = readattribute([idDevServCor04, '/current']); |
---|
391 | |
---|
392 | % Pressure in the ring in the proximity of the SR spot made by the undulator |
---|
393 | inStruct.ringPres = readattribute([idDevServVac01, '/pressure']); |
---|
394 | |
---|
395 | if dispData ~= 0 |
---|
396 | fprintf('pressure = %d\n', inStruct.ringPres); |
---|
397 | fprintf('idEncoder1 = %f\n', inStruct.idEncoder1); |
---|
398 | fprintf('idEncoder2 = %f\n', inStruct.idEncoder2); |
---|
399 | fprintf('idEncoder3 = %f\n', inStruct.idEncoder3); |
---|
400 | fprintf('idEncoder4 = %f\n', inStruct.idEncoder4); |
---|
401 | fprintf('idEncoder5 = %f\n', inStruct.idEncoder5); |
---|
402 | fprintf('idEncoder6 = %f\n', inStruct.idEncoder6); |
---|
403 | fprintf('idCurCorCh1 = %f\n',inStruct.idCurCorCh1); |
---|
404 | fprintf('idCurCorCh2 = %f\n',inStruct.idCurCorCh2); |
---|
405 | fprintf('idCurCorCh3 = %f\n',inStruct.idCurCorCh3); |
---|
406 | fprintf('idCurCorCh4 = %f\n',inStruct.idCurCorCh4); |
---|
407 | end |
---|
408 | |
---|
409 | elseif strncmp(idType, 'HU64', 4) |
---|
410 | if strcmp(idType, 'HU64_HERMES') |
---|
411 | idDevServMain01 = 'ans-c10/ei/m-hu64.2'; |
---|
412 | idDevServCor01 = 'ans-c10/ei/m-hu64.2_chan1'; |
---|
413 | idDevServCor02 = 'ans-c10/ei/m-hu64.2_chan2'; |
---|
414 | idDevServCor03 = 'ans-c10/ei/m-hu64.2_chan3'; |
---|
415 | idDevServCor04 = 'ans-c10/ei/m-hu64.2_chan4'; |
---|
416 | %idDevServVac01 = 'tdl-i07-m/vi/jba.1'; |
---|
417 | idDevServVac01 = 'ans-c07/vi/pi.02'; |
---|
418 | end |
---|
419 | |
---|
420 | % Gap encoders |
---|
421 | inStruct.idEncoder1 = readattribute([idDevServMain01, '/encoder1Position']); |
---|
422 | %inStruct.idEncoder1 = tango_read_attribute2(idDevServMain01, 'encoder1Position'); |
---|
423 | inStruct.idEncoder2 = readattribute([idDevServMain01, '/encoder2Position']); |
---|
424 | %inStruct.idEncoder2 = tango_read_attribute2(idDevServMain01, 'encoder2Position'); |
---|
425 | inStruct.idEncoder3 = readattribute([idDevServMain01, '/encoder3Position']); |
---|
426 | %inStruct.idEncoder3 = tango_read_attribute2(idDevServMain01, 'encoder3Position'); |
---|
427 | inStruct.idEncoder4 = readattribute([idDevServMain01, '/encoder4Position']); |
---|
428 | %inStruct.idEncoder4 = tango_read_attribute2(idDevServMain01, 'encoder4Position'); |
---|
429 | |
---|
430 | % Phase encoders |
---|
431 | inStruct.idEncoder5 = readattribute([idDevServMain01, '/encoder5Position']); |
---|
432 | %inStruct.idEncoder5 = tango_read_attribute2(idDevServMain01, 'encoder5Position'); |
---|
433 | inStruct.idEncoder6 = readattribute([idDevServMain01, '/encoder6Position']); |
---|
434 | %inStruct.idEncoder6 = tango_read_attribute2(idDevServMain01, 'encoder6Position'); |
---|
435 | |
---|
436 | % Currents in the correction channels |
---|
437 | inStruct.idCurCorCh1 = readattribute([idDevServCor01, '/current']); |
---|
438 | inStruct.idCurCorCh2 = readattribute([idDevServCor02, '/current']); |
---|
439 | inStruct.idCurCorCh3 = readattribute([idDevServCor03, '/current']); |
---|
440 | inStruct.idCurCorCh4 = readattribute([idDevServCor04, '/current']); |
---|
441 | |
---|
442 | % Pressure in the ring in the proximity of the SR spot made by the undulator |
---|
443 | inStruct.ringPres = readattribute([idDevServVac01, '/pressure']); |
---|
444 | |
---|
445 | |
---|
446 | |
---|
447 | elseif strncmp(idType, 'HU256', 5) |
---|
448 | |
---|
449 | elseif strcmp(idType, 'HU640_DESIRS') |
---|
450 | idDevServMain01 = 'ans-c05/ei/l-hu640_ps1'; |
---|
451 | idDevServMain02 = 'ans-c05/ei/l-hu640_ps2'; |
---|
452 | idDevServMain03 = 'ans-c05/ei/l-hu640_ps3'; |
---|
453 | |
---|
454 | % Currents in the main coils |
---|
455 | inStruct.idCurMain1 = readattribute([idDevServMain01, '/current']); |
---|
456 | inStruct.idCurMain2 = readattribute([idDevServMain02, '/current']); |
---|
457 | inStruct.idCurMain3 = readattribute([idDevServMain03, '/current']); |
---|
458 | |
---|
459 | if dispData ~= 0 |
---|
460 | % Display on screen |
---|
461 | fprintf('RMS ecart orbite X = \n') |
---|
462 | fprintf('RMS ecart orbite Z = \n' ) |
---|
463 | fprintf('PS1 = %f\n', inStruct.idCurMain1) |
---|
464 | fprintf('PS2 = %f\n', inStruct.idCurMain2) |
---|
465 | fprintf('PS3 = %f\n', inStruct.idCurMain3) |
---|
466 | end |
---|
467 | end |
---|
468 | outStruct = inStruct; |
---|