Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.naic.edu/~phil/hardware/vertex/sharemegsvertex/floppy_bckup/lcuv2_2/LCU_ver2.2/MONI.LST
Дата изменения: Mon Mar 5 21:23:54 2001
Дата индексирования: Thu Jan 15 11:13:09 2009
Кодировка:

Поисковые слова: m 17


CP581 PAGE 1
moni 03-05-:1
14:23:54

Line# Source Line Microsoft C Compiler Version 6.00A

1 /* MONI.C LCU/CP581 S1095034L-2.0 15.09.1997 */
2
3 #include
4 #include "prog.h"
5 #include "netzwerk.h"
6 #include "extern.c"
7 void moni(void)
8 {
9 /* extern int i,mil; i doesn't need to be global */
10 int i; /* make i local*/
11 char tpa0f[10];
12
13 /* Position display AZ */
14 ftext(m_pos[0],8,4,1,tpa0f);
15 outram(7,7,19,19,0x1f00,0,8,tpa0f);
16
17 /* Position display GD */
18 ftext(m_pos[1],8,4,1,tpa0f);
19 outram(7,7,41,41,0x1f00,0,8,tpa0f);
20
21 /* Position display CH */
22 ftext(m_pos[2],8,4,1,tpa0f);
23 outram(7,7,65,65,0x1f00,0,8,tpa0f);
24
25 if((mode_sel[0]&0x0e00)!=0){ /* preset, prog. tr., stow display set
point*/
26 ftext(setpoint[0],8,4,1,tpa0f);
27 outram(9,9,19,19,0x1700,0,8,tpa0f);
28 } else {
29 outram(9,9,19,19,0x1700,0,8," ");
30 }
31
32 if((mode_sel[2]&0x0e00)!= 0){ /* preset, prog. tr., stow display s
etpoint*/
33 ftext(setpoint[1],8,4,1,tpa0f);
34 outram(9,9,41,41,0x1700,0,8,tpa0f);
35 } else {
36 outram(9,9,41,41,0x1700,0,8," ");
37 }
38
39 if((mode_sel[4]&0x0e00)!=0){/* preset, prog. tr., stow display setp
oint*/
40 ftext(setpoint[2],8,4,1,tpa0f);
41 outram(9,9,65,65,0x1700,0,8,tpa0f);
42 } else {
43 outram(9,9,65,65,0x1700,0,8," ");
44 }
45
46 ftext1(m_rate[0],8,4,1,tpa0f);
47 outram(11,11,19,19,0x1700,0,8,tpa0f);
48
49 ftext1(m_rate[1],8,4,1,tpa0f);
50 outram(11,11,41,41,0x1700,0,8,tpa0f);
51
52 ftext1(m_rate[2],8,4,1,tpa0f);
53 outram(11,11,65,65,0x1700,0,8,tpa0f);


CP581 PAGE 2
moni 03-05-:1
14:23:54

Line# Source Line Microsoft C Compiler Version 6.00A

54 if (axis ==0) {
55 ftext(time_ms,9,3,8,tpa0f);
56 outram(21,21,68,68,0x1700,0,9,tpa0f);
57 }
58
59 /********** LOCAL ONLY SWITCH *************************************/
60 if((mode_sel[0]&0x0003) == 0){
61 if((stat1[0] & 0x0040)== 0x0040)
62 mode_sel[0] = (mode_sel[0] & 0xfff0)| 0x0002;
63 }
64 if((mode_sel[2]&0x0003) == 0){
65 if((stat1[6] & 0x0040)== 0x0040)
66 mode_sel[2] = (mode_sel[2] & 0xfff0)| 0x0002;
67 }
68 if((mode_sel[4]&0x0003) == 0){
69 if((stat1[12] & 0x0040)== 0x0040)
70 mode_sel[4] =(mode_sel[4] & 0xfff0)| 0x0002;
71 }
72 /******************************************************************/
73
74 if (mil <=0){
75 if ((stat1[0] & 0x0f00) == 0) mode_sel[0] = mode_sel[0]&0xf0ff
;
76 if ((stat1[6] & 0x0f00) == 0) mode_sel[2] = mode_sel[2]&0xf0ff
;
77 if ((stat1[12] & 0x0f00) == 0) mode_sel[4] = mode_sel[4]&0xf0ff
;
78 mil = 0;
79 }
80
81 if (auxm == 0) {
82 if ((stat1[0] & 0x0001) == 0x0001){
83 i=1;
84 if (mil < 190) mode_sel[0] = (mode_sel[0]&0xf0f0) | 0x0001;

85 } else {
86 i = (mode_sel[0] & 0x000f);
87 }
88 switch(i) {
89 case 1:
90 outram(15,15,16,16,0x1700,0,15," PCU ");
91 break;
92 case 2:
93 outram(15,15,16,16,0x1700,0,15," LCU ");
94 break;
95 case 4:
96 outram(15,15,16,16,0x1700,0,15," OCU ");
97 break;
98 case 8:
99 outram(15,15,16,16,0x1700,0,15," MCS ");
100 break;
101 default:
102 outram(15,15,16,16,0x1700,0,15," ");
103 break;
104
105 }


CP581 PAGE 3
moni 03-05-:1
14:23:54

Line# Source Line Microsoft C Compiler Version 6.00A

106 if ((stat1[6] & 0x0001) == 0x0001) {
107 i=1;
108 if (mil < 190) mode_sel[2] = ((mode_sel[2]&0xf0f0)|0x0001);

109 /*pjp001 () previous line*/
110 } else {
111 i= (mode_sel[2] & 0x000f);
112 }
113 switch(i) {
114 case 1:
115 outram(15,15,39,39,0x1700,0,15," PCU ");
116 break;
117 case 2:
118 outram(15,15,39,39,0x1700,0,15," LCU ");
119 break;
120 case 4:
121 outram(15,15,39,39,0x1700,0,15," OCU ");
122 break;
123 case 8:
124 outram(15,15,39,39,0x1700,0,15," MCS ");
125 break;
126 default:
127 outram(15,15,339,39,0x1700,0,15," ");
128 break;
129 }
130 if ((stat1[12] & 0x0001) == 0x0001){
131 i=1;
132 if (mil < 190) mode_sel[4] = (mode_sel[4]&0xf0f0) | 0x0001;

133 } else {
134 i= (mode_sel[4] & 0x000f);
135 }
136
137 switch(i) {
138 case 1:
139 outram(15,15,63,63,0x1700,0,15," PCU ");
140 break;
141 case 2:
142 outram(15,15,63,63,0x1700,0,15," LCU ");
143 break;
144 case 4:
145 outram(15,15,63,63,0x1700,0,15," OCU ");
146 break;
147 case 8:
148 outram(15,15,63,63,0x1700,0,15," MCS ");
149 break;
150 default:
151 outram(15,15,63,63,0x1700,0,15," ");
152 break;
153 }
154 }
155 switch(stat1[0] & 0x0f00) {
156 case 0x0100:
157 outram(13,13,16,16,0x1700,0,15," RATE ");
158 break;
159


CP581 PAGE 4
moni 03-05-:1
14:23:54

Line# Source Line Microsoft C Compiler Version 6.00A

160 case 0x0200:
161 outram(13,13,16,16,0x1700,0,15," PRESET ");
162 break;
163
164 case 0x0400:
165 outram(13,13,16,16,0x1700,0,15," STOW ");
166 break;
167
168 case 0x0800:
169 outram(13,13,16,16,0x1700,0,15," PROGRAM TRACK ");
170 break;
171
172 default:
173 outram(13,13,16,16,0x1700,0,15," STOP ");
174 break;
175 }
176
177 switch(stat1[6] & 0x0f00) {
178 case 0x0100:
179 outram(13,13,39,39,0x1700,0,15," RATE ");
180 break;
181
182 case 0x0200:
183 outram(13,13,39,39,0x1700,0,15," PRESET ");
184 break;
185
186 case 0x0400:
187 outram(13,13,39,39,0x1700,0,15," STOW ");
188 break;
189
190 case 0x0800:
191 outram(13,13,39,39,0x1700,0,15," PROGRAM TRACK ");
192 break;
193
194 default:
195 outram(13,13,39,39,0x1700,0,15," STOP ");
196 break;
197 }
198
199 switch(stat1[12] & 0x0f00) {
200 case 0x0100:
201 outram(13,13,63,63,0x1700,0,15," RATE ");
202 break;
203
204 case 0x0200:
205 outram(13,13,63,63,0x1700,0,15," PRESET ");
206 break;
207
208 case 0x0400:
209 outram(13,13,63,63,0x1700,0,15," STOW ");
210 break;
211
212 case 0x0800:
213 outram(13,13,63,63,0x1700,0,15," PROGRAM TRACK ");
214 break;
215


CP581 PAGE 5
moni 03-05-:1
14:23:54

Line# Source Line Microsoft C Compiler Version 6.00A

216 default:
217 outram(13,13,63,63,0x1700,0,15," STOP ");
218 break;
219 }
220
221
222 if (auxm == 0) {
223 /*************************************** AZIMUTH ******************
*/
224 if (axis == 0 ){
225 switch(stat1[1]&0x0300) {
226 case 0x0100:
227 outram(19,19,16,16,0x1700,0,15," GROUP 1 OFF ");
228 ignore[0] = 0x00ff;
229 ignore[1] = 0xf000;
230 ignore[2] = 0xa290;
231 break;
232 case 0x0200:
233 outram(19,19,16,16,0x1700,0,15," GROUP 2 OFF ");
234 ignore[0] = 0xff00;
235 ignore[1] = 0x0f00;
236 ignore[2] = 0x5190;
237 break;
238
239 default:
240 outram(19,19,16,16,0x1700,0,15," ");
241 ignore[0] = 0xffff;
242 ignore[1] = 0xffff;
243 ignore[2] = 0xf3ff;
244 break;
245 }
246 }
247 if ( ((stat1[1] & 0x000d) !=0 )|| /* v2.2 mods*/
248 ((stat1[2] & 0xd720) !=0 )||
249 ( stat1[3] !=0 )||
250 ( stat1[4] !=0 )||
251 ((stat1[5] & 0xf390) !=0 )||
252 ((gestdr & 0x2000) !=0 )) {
253
254 if (((stat1[3]&ignore[0]) ==0 ) &&
255 ((stat1[4]&ignore[1]) ==0 ) &&
256 ((stat1[5]&ignore[2]) ==0 ) &&
257 ((stat1[2]&0xd100) ==0 ) &&
258 ((stat1[1]&0x000c) == 0 ||(stat1[1]&0x0002) == 0x0002) &&
259
260 ((stat1[2]&0x0600) < 0x0600) &&
261 ((gestdr&0x2000) ==0 )) {
262
263 if((stat1[2] & 0x0020) == 0x0020){
264 outram(17,17,16,16,0x9c00,0,15,"Emergency Limit");
265 } else {
266 outram(17,17,16,16,0x1e00,0,15," FAULT ");
267 }
268 } else {
269 outram(17,17,16,16,0x9c00,0,15," FAULT ");
270 }


CP581 PAGE 6
moni 03-05-:1
14:23:54

Line# Source Line Microsoft C Compiler Version 6.00A

271 } else {
272 if ((stat1[2] & 0x0001) == 0x0001) {
273 outram(17,17,16,16,0x1700,0,15," Limit ccw ");
274 } else if((stat1[2] & 0x0002) == 0x0002) {
275 outram(17,17,16,16,0x1700,0,15," Prelimit ccw ");
276 }
277
278 if((stat1[2] & 0x0010) == 0x0010) {
279 outram(17,17,16,16,0x1700,0,15," Limit cw ");
280 } else if((stat1[2] & 0x0008) == 0x0008) {
281 outram(17,17,16,16,0x1700,0,15," Prelimit cw ");
282 }
283 if((stat1[2] & 0x0004) == 0x0004) {
284 outram(17,17,16,16,0x1700,0,15," OK ");
285 }
286 }
287
288 /************************************** GREGORIAN DOME ************
****/
289 if (axis == 0){
290 switch(stat1[7]&0xff00) {
291 case 0x0100:
292 outram(19,19,39,39,0x1700,0,15," MOTOR 11 OFF ");
293 ignore[3] = 0xfcff;
294 ignore[4] = 0xfe00;
295 break;
296 case 0x0200:
297 outram(19,19,39,39,0x1700,0,15," MOTOR 12 OFF ");
298 ignore[3] = 0xf3ff;
299 ignore[4] = 0xfd00;
300 break;
301 case 0x0400:
302 outram(19,19,39,39,0x1700,0,15," MOTOR 21 OFF ");
303 ignore[3] = 0xcfff;
304 ignore[4] = 0xfb00;
305 break;
306 case 0x0800:
307 outram(19,19,39,39,0x1700,0,15," MOTOR 22 OFF ");
308 ignore[3] = 0x3fff;
309 ignore[4] = 0xf700;
310 break;
311 case 0x1000:
312 outram(19,19,39,39,0x1700,0,15," MOTOR 31 OFF ");
313 ignore[3] = 0xfffc;
314 ignore[4] = 0xef00;
315 break;
316 case 0x2000:
317 outram(19,19,39,39,0x1700,0,15," MOTOR 32 OFF ");
318 ignore[3] = 0xfff3;
319 ignore[4] = 0xdf00;
320 break;
321 case 0x4000:
322 outram(19,19,39,39,0x1700,0,15," MOTOR 41 OFF ");
323 ignore[3] = 0xffcf;
324 ignore[4] = 0xbf00;
325 break;


CP581 PAGE 7
moni 03-05-:1
14:23:54

Line# Source Line Microsoft C Compiler Version 6.00A

326 case 0x8000:
327 outram(19,19,39,39,0x1700,0,15," MOTOR 42 OFF ");
328 ignore[3] = 0xff3f;
329 ignore[4] = 0x7f00;
330 break;
331 default:
332 outram(19,19,39,39,0x1700,0,15," ");
333 ignore[3] = 0xffff;
334 ignore[4] = 0xffff;
335 break;
336 }
337 }
338
339 if ( ((stat1[7] & 0x00fd) !=0) || /* v2.2 mods*/
340 ((stat1[8] & 0xd720) !=0) ||
341 ( stat1[9] !=0) ||
342 ( stat1[10] !=0) ||
343 ((stat1[11] &0xf390) !=0) ) {
344
345 if (((stat1[9] & ignore[3])) ==0 &&
346 ((stat1[10] & ignore[4])) ==0 &&
347 ((stat1[8] & 0xd700 )) ==0 &&
348 /* */ ((stat1[7]&0x00fc) == 0 ||(stat1[7]&0x0002) == 0x0002)
&&
349 ((stat1[11] & 0xf390 )) ==0) {
350
351 if((stat1[8] &0x0020) == 0x0020) {
352 outram(17,17,39,39,0x9c00,0,15,"Emergency Limit");
353 } else {
354 outram(17,17,39,39,0x1e00,0,15," FAULT ");
355 }
356 } else {
357 outram(17,17,39,39,0x9c00,0,15," FAULT ");
358 }
359 } else {
360 if((stat1[8] & 0x0001) == 0x0001) {
361 outram(17,17,39,39,0x1700,0,15," Limit down ");
362 } else if((stat1[8] & 0x0002) == 0x0002) {
363 outram(17,17,39,39,0x1700,0,15," Prelimit down ");
364 }
365 if((stat1[8] & 0x0010) == 0x0010) {
366 outram(17,17,39,39,0x1700,0,15," Limit up ");
367 } else if ((stat1[8] & 0x0008) == 0x0008) {
368 outram(17,17,39,39,0x1700,0,15," Prelimit up ");
369 }
370
371 if((stat1[8] & 0x0004) == 0x0004)
372 outram(17,17,39,39,0x1700,0,15," OK ");
373 }
374 /******************************** CARRIAGE HOUSE ******************
****/
375 if (axis == 0){
376 switch(stat1[13]&0x0300) {
377 case 0x0100:
378 outram(19,19,63,63,0x1700,0,15," MOTOR 1 OFF ");
379 ignore[6] = 0xfcff;


CP581 PAGE 8
moni 03-05-:1
14:23:54

Line# Source Line Microsoft C Compiler Version 6.00A

380 ignore[7] = 0xfe00;
381 break;
382 case 0x0200:
383 ignore[6] = 0xf3ff;
384 ignore[7] = 0xfd00;
385 outram(19,19,63,63,0x1700,0,15," MOTOR 2 OFF ");
386 break;
387 default:
388 ignore[6] = 0xffff;
389 ignore[7] = 0xffff;
390 outram(19,19,63,63,0x1700,0,15," ");
391 break;
392 }
393 }
394 if ( ((stat1[13] & 0x0005) != 0) || /* ver2.2*/
395 ((stat1[14] & 0xd720) != 0) ||
396 ( stat1[15] != 0) ||
397 ( stat1[16] != 0) ||
398 ((stat1[17]&0xf390) != 0)) {
399
400 if (((stat1[15] & ignore[6])==0 ) &&
401 ((stat1[16] & ignore[7])==0 ) &&
402 ((stat1[14] & 0xd700) ==0 ) &&
403 ((stat1[13] & 0x0004) ==0 ) && /* mod 2.2*/
404 ((stat1[17] & 0xf390) ==0 )) {
405
406 if((stat1[14] & 0x0020) == 0x0020) {
407 outram(17,17,63,63,0x9c00,0,15,"Emergency Limit");
408 } else {
409 outram(17,17,63,63,0x1e00,0,15," FAULT ");
410 }
411 } else {
412 outram(17,17,63,63,0x9c00,0,15," FAULT ");
413 }
414 } else {
415 if((stat1[14] & 0x0008) == 0x0008) {
416 outram(17,17,63,63,0x1700,0,15," Prelimit up ");
417 }
418 if((stat1[14] & 0x0001) == 0x0001) {
419 outram(17,17,63,63,0x1700,0,15," Limit down ");
420 } else if((stat1[14] & 0x0002) == 0x0002) {
421 outram(17,17,63,63,0x1700,0,15," Prelimit down ");
422 }
423
424 if((stat1[14] & 0x0010) == 0x0010) {
425 outram(17,17,63,63,0x1700,0,15," Limit up ");
426 } else if((stat1[14] & 0x0008) == 0x0008) {
427 outram(17,17,63,63,0x1700,0,15," Prelimit up ");
428 }
429
430 if((stat1[14] & 0x0004) == 0x0004)
431 outram(17,17,63,63,0x1700,0,15," OK ");
432 }
433 }
434
435 if (axis == 0){


CP581 PAGE 9
moni 03-05-:1
14:23:54

Line# Source Line Microsoft C Compiler Version 6.00A

436 if (net_error != 0 && net_error != 21) {
437 outram(21,21,13,13,0x9c00,0,20," NETWORK ERROR ");
438 goto SF;
439 }
440 if (to_err > 0) {
441 outram(21,21,13,13,0x9c00,0,20," HOST TIMEOUT ");
442 goto SF;
443 }
444 outram(21,21,13,13,0x9c00,0,20," ");
445
446 SF: if((gestdr&0x997f) != 0){
447 outram(21,21,35,35,0x9c00,0,21," SYSTEM FAULT ");
448 } else {
449 if ((gestdr&0x0400) != 0) {
450 outram(21,21,35,35,0x9c00,0,21,"LIMIT OVERRIDE ACTIVE")
;
451 } else {
452 outram(21,21,35,35,0x9c00,0,21," ")
;
453 }
454 }
455 }
456 return;
457 }


moni Local Symbols

Name Class Type Size Offset Register

tpa0f . . . . . . . . . . auto -000c
i . . . . . . . . . . . . auto -0002


Global Symbols

Name Class Type Size Offset

ad. . . . . . . . . . . . common struct/array 10 ***
alarm . . . . . . . . . . common int 2 ***
auxm. . . . . . . . . . . extern unsigned char 1 ***
axis. . . . . . . . . . . extern unsigned int 2 ***
buffer. . . . . . . . . . common far pointer 4 ***
ftext . . . . . . . . . . extern far function *** ***
ftext1. . . . . . . . . . extern far function *** ***
gestdr. . . . . . . . . . extern unsigned int 2 ***
ignore. . . . . . . . . . extern struct/array 36 ***
lese. . . . . . . . . . . common struct/array 526 ***
m_pos . . . . . . . . . . extern struct/array 20 ***
m_rate. . . . . . . . . . extern struct/array 14 ***
mil . . . . . . . . . . . extern int 2 ***
mode_sel. . . . . . . . . extern struct/array 12 ***
moni. . . . . . . . . . . global far function *** 0000
net_error . . . . . . . . extern int 2 ***
outram. . . . . . . . . . extern far function *** ***
setpoint. . . . . . . . . extern struct/array 12 ***


CP581 PAGE 10
moni 03-05-:1
14:23:54

Microsoft C Compiler Version 6.00A


Global Symbols

Name Class Type Size Offset

stat1 . . . . . . . . . . extern struct/array 36 ***
time_ms . . . . . . . . . extern long 4 ***
to_err. . . . . . . . . . extern int 2 ***

Code size = 0e7e (3710)
Data size = 0516 (1302)
Bss size = 0000 (0)

No errors detected