⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 loop.lst

📁 ASC 信号机控制程序,国内最先进的信号机控制程序
💻 LST
📖 第 1 页 / 共 3 页
字号:
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 + -