?? loop.lst
字號:
C51 COMPILER V6.02 LOOP 09/28/2006 21:46:49 PAGE 1
C51 COMPILER V6.02, COMPILATION OF MODULE LOOP
OBJECT MODULE PLACED IN F:\LAIWORK\GB_ASC\LOOP.OBJ
COMPILER INVOKED BY: c:\COMP51V6\C51.EXE F:\LAIWORK\GB_ASC\LOOP.C DB SB OE LARGE
stmt level source
1 #include <loop.h>
2 //***************************************************************************************
3 //* 存儲故障信息到2000h-44b8h
4 //*故障格式為時間信息:5字節 月,日時分秒
5 //* 故障分類 1 檢測器故障,2 驅而不亮燈組 ,3不驅而亮燈組,4機柜門
6 // 4字節 2字節 2字節 1字節
7 //*************************************************************************************** /
8 save_to_error() using 1
9 {
10 1 unsigned char i;
11 1 lcd_error_addr=XBYTE[0X3ea7]*256+XBYTE[0X3ea8];
12 1
13 1 switch(error_type){
14 2 case 0x01:lcd_error[5]=error_type; //檢測器故障
15 2 lcd_error[6]=(hpp>>8);
16 2 lcd_error[7]=(hpp);
17 2 lcd_error[8]=(lpp>>8);
18 2 lcd_error[9]=(lpp);
19 2 break;
20 2 case 0x02:lcd_error[5]=error_type; //燈組故障
21 2 lcd_error[10]=(drive_no_lamp>>8);
22 2 lcd_error[11]=(drive_no_lamp);
23 2 break;
24 2 case 0x03:lcd_error[5]=error_type; //燈組故障
25 2 lcd_error[12]=(no_drive_lamp>>8);
26 2 lcd_error[13]=(no_drive_lamp);
27 2 break;
28 2 case 0x04:lcd_error[5]=error_type; //
29 2 lcd_error[14]=(door);
30 2 break;
31 2 default:break;
32 2 } //時間信息,月日時分秒
33 1 lcd_error[0]=XBYTE[0XC008];
34 1 lcd_error[1]=XBYTE[0XC007];
35 1 lcd_error[2]=XBYTE[0XC004];
36 1 lcd_error[3]=XBYTE[0XC002];
37 1 lcd_error[4]=XBYTE[0XC000];
38 1
39 1 lcd_error_addr=XBYTE[0X3ea7]*256+XBYTE[0X3ea8]; //250條故障信息
40 1 if(lcd_error_addr<0x3000)lcd_error_addr=0x3000;
41 1 if(lcd_error_addr>0x3ea6)lcd_error_addr=0x3000;
42 1
43 1 for(i=0;i<15;i++){
44 2 XBYTE[lcd_error_addr]=lcd_error[i];
45 2 lcd_error_addr++;
46 2 if(lcd_error_addr>0x3ea6)lcd_error_addr=0x3000;
47 2 }
48 1
49 1 XBYTE[0X3ea7]=(lcd_error_addr>>8);
50 1 XBYTE[0X3ea8]=lcd_error_addr;
51 1 }
52
53
54 /*****************************************************************************************************/
55 // 掃描線圈,判斷線圈故障,判斷有無車輛通過
C51 COMPILER V6.02 LOOP 09/28/2006 21:46:49 PAGE 2
56 /*****************************************************************************************************/
57 void cljc()
58 {
59 1 uchar i;
60 1
61 1 flagg=0;
62 1 for(i=0; i<32; i++) loop_set[i]=1;
63 1
64 1 cs_dram = 1;
65 1 c381 = XBYTE[0XC381]; /*讀線圈狀態*/
66 1 c380 = XBYTE[0XC380];
67 1 c301 = XBYTE[0XC301];
68 1 c300 = XBYTE[0XC300];
69 1 flagh = XBYTE[0XC382]; /*低四位代表線圈板標志位為1:通道為1時無故障,通道為0時故障*/
70 1 flagl = XBYTE[0XC302]; /*低四位代表線圈板標志位為0:通道為1時無車,通道為0時有車*/
71 1 flagl = flagl&0x0f;
72 1 flagh = flagh<<4;
73 1 flag = flagl|flagh;
74 1 if((flag&0x01)==0x01) /*線圈1-4的故障判別*/
75 1 {
76 2 if((c300&0x01)==0x00) loop_error[0]++; /*線圈1故障計數*/
77 2 else loop_error[0]=0;
78 2 if(loop_error[0]>5) loop_error[0]=5;
79 2 if((c300&0x02)==0x00) loop_error[1]++; /*線圈2故障計數*/
80 2 else loop_error[1]=0;
81 2 if(loop_error[1]>5) loop_error[1]=5;
82 2 if((c300&0x04)==0x00) loop_error[2]++; /*線圈3故障計數*/
83 2 else loop_error[2]=0;
84 2 if(loop_error[2]>5) loop_error[2]=5;
85 2 if((c300&0x08)==0x00) loop_error[3]++; /*線圈4故障計數*/
86 2 else loop_error[3]=0;
87 2 if(loop_error[3]>5) loop_error[3]=5;
88 2 }
89 1 if((flag&0x02)==0x02) /*線圈5-8的故障判別*/
90 1 {
91 2 if((c300&0x10)==0x00)loop_error[4]++; /*線圈5故障計數*/
92 2 else loop_error[4]=0;
93 2 if(loop_error[4]>5)loop_error[4]=5;
94 2 if((c300&0x20)==0x00)loop_error[5]++; /*線圈6故障計數*/
95 2 else loop_error[5]=0;
96 2 if(loop_error[5]>5)loop_error[5]=5;
97 2 if((c300&0x40)==0x00)loop_error[6]++; /*線圈7故障計數*/
98 2 else loop_error[6]=0;
99 2 if(loop_error[6]>5)loop_error[6]=5;
100 2 if((c300&0x80)==0x00)loop_error[7]++; /*線圈8故障計數*/
101 2 else loop_error[7]=0;
102 2 if(loop_error[7]>5)loop_error[7]=5;
103 2 }
104 1 if((flag&0x04)==0x04) /*線圈9-12的故障判別*/
105 1 {
106 2 if((c301&0x01)==0x00)loop_error[8]++; /*線圈9故障計數*/
107 2 else loop_error[8]=0;
108 2 if(loop_error[8]>5)loop_error[8]=5;
109 2 if((c301&0x02)==0x00)loop_error[9]++; /*線圈10故障計數*/
110 2 else loop_error[9]=0;
111 2 if(loop_error[9]>5)loop_error[9]=5;
112 2 if((c301&0x04)==0x00)loop_error[10]++; /*線圈11故障計數*/
113 2 else loop_error[10]=0;
114 2 if(loop_error[10]>5)loop_error[10]=5;
115 2 if((c301&0x08)==0x00)loop_error[11]++; /*線圈12故障計數*/
116 2 else loop_error[11]=0;
117 2 if(loop_error[11]>5)loop_error[11]=5;
C51 COMPILER V6.02 LOOP 09/28/2006 21:46:49 PAGE 3
118 2 }
119 1 if((flag&0x08)==0x08) /*線圈13-16的故障判別*/
120 1 {
121 2 if((c301&0x10)==0x00)loop_error[12]++; /*線圈13故障計數*/
122 2 else loop_error[12]=0;
123 2 if(loop_error[12]>5)loop_error[12]=5;
124 2 if((c301&0x20)==0x00)loop_error[13]++; /*線圈14故障計數*/
125 2 else loop_error[13]=0;
126 2 if(loop_error[13]>5)loop_error[13]=5;
127 2 if((c301&0x40)==0x00)loop_error[14]++; /*線圈15故障計數*/
128 2 else loop_error[14]=0;
129 2 if(loop_error[14]>5)loop_error[14]=5;
130 2 if((c301&0x80)==0x00)loop_error[15]++; /*線圈16故障計數*/
131 2 else loop_error[15]=0;
132 2 if(loop_error[15]>5)loop_error[15]=5;
133 2 }
134 1 if((flag&0x10)==0x10) /*線圈17-20的故障判別*/
135 1 {
136 2 if((c380&0x01)==0x00)loop_error[16]++; /*線圈17故障計數*/
137 2 else loop_error[16]=0;
138 2 if(loop_error[16]>5)loop_error[16]=5;
139 2 if((c380&0x02)==0x00)loop_error[17]++; /*線圈18故障計數*/
140 2 else loop_error[17]=0;
141 2 if(loop_error[17]>5)loop_error[17]=5;
142 2 if((c380&0x04)==0x00)loop_error[18]++; /*線圈19故障計數*/
143 2 else loop_error[18]=0;
144 2 if(loop_error[18]>5)loop_error[18]=5;
145 2 if((c380&0x08)==0x00)loop_error[19]++; /*線圈20故障計數*/
146 2 else loop_error[19]=0;
147 2 if(loop_error[19]>5)loop_error[19]=5;
148 2 }
149 1 if((flag&0x20)==0x20) /*線圈20-24的故障判別*/
150 1 {
151 2 if((c380&0x10)==0x00)loop_error[20]++; /*線圈21故障計數*/
152 2 else loop_error[20]=0;
153 2 if(loop_error[20]>5)loop_error[20]=5;
154 2 if((c380&0x20)==0x00)loop_error[21]++; /*線圈22故障計數*/
155 2 else loop_error[21]=0;
156 2 if(loop_error[21]>5)loop_error[21]=5;
157 2 if((c380&0x40)==0x00)loop_error[22]++; /*線圈23故障計數*/
158 2 else loop_error[22]=0;
159 2 if(loop_error[22]>5)loop_error[22]=5;
160 2 if((c380&0x80)==0x00)loop_error[23]++; /*線圈24故障計數*/
161 2 else loop_error[23]=0;
162 2 if(loop_error[23]>5)loop_error[23]=5;
163 2 }
164 1 if((flag&0x40)==0x40) /*線圈24-28的故障判別*/
165 1 {
166 2 if((c381&0x01)==0x00)loop_error[24]++; /*線圈25故障計數*/
167 2 else loop_error[24]=0;
168 2 if(loop_error[24]>5)loop_error[24]=5;
169 2 if((c381&0x02)==0x00)loop_error[25]++; /*線圈26故障計數*/
170 2 else loop_error[25]=0;
171 2 if(loop_error[25]>5)loop_error[25]=5;
172 2 if((c381&0x04)==0x00)loop_error[26]++; /*線圈27故障計數*/
173 2 else loop_error[26]=0;
174 2 if(loop_error[26]>5)loop_error[26]=5;
175 2 if((c381&0x08)==0x00)loop_error[27]++; /*線圈28故障計數*/
176 2 else loop_error[27]=0;
177 2 if(loop_error[27]>5)loop_error[27]=5;
178 2 }
179 1 if((flag&0x80)==0x80) /*線圈28-32的故障判別*/
C51 COMPILER V6.02 LOOP 09/28/2006 21:46:49 PAGE 4
180 1 {
181 2 if((c381&0x10)==0x00)loop_error[28]++; /*線圈29故障計數*/
182 2 else loop_error[28]=0;
183 2 if(loop_error[28]>5)loop_error[28]=5;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -