📄 testprog.lst
字号:
806 2 if(m_tc >2320) m_total_t0 = (m_tc - 2050)/290 ;
807 2 else m_total_t0 = 1;
808 2 m_t0_c = 0;
809 2
810 2 if( m_tc < 1600 ) return;
811 2
812 2 if(m_get_gzfs ==1 )
813 2 {
814 3 if(m_tc > 8600) m_tc = 8600;
815 3 if(m_pulse_count == 1)
816 3 {
817 4 silent = 44300 + m_tc*2; //45536
818 4 }
819 3 else if(m_pulse_count == 2)
820 3 {
821 4 silent = 45100 + m_tc*2; //45536
822 4 }
823 3 else return;
824 3
825 3 TH0 = silent/256;
826 3 TL0 = silent%256;
827 3 ET0 = SET;
828 3 TR0 = SET;
829 3 return;
830 3 }
831 2 /**/ else if( m_get_gzfs == 4 )
832 2 {
833 3 if(m_tc > m_left_fdb_tc ) m_tc = m_left_fdb_tc; //第一步,
834 3
835 3 silent = 44200 + m_tc*2; //44200
836 3 //----------------------------------------------
837 3 if(m_pulse_count == 3 ||m_pulse_count== 4)
838 3 {
839 4 silent = silent + m_fdb_tc*2; //44200
840 4 }
841 3 TH0 = silent/256;
842 3 TL0 = silent%256;
843 3 ET0 = SET;
844 3 TR0 = SET;
845 3 return;
846 3 }
847 2 else
848 2 {
849 3 if(m_tc > 8900) m_tc = 8900;
850 3 silent = 44200 + m_tc*2; //44200
851 3 TH0 = silent/256;
852 3 TL0 = silent%256;
853 3 ET0 = SET;
854 3 TR0 = SET;
855 3 return;
856 3 }
857 2 }
858 1
859 1 if(m_br_fs) return; //假如封锁,立即退出采样
860 1
861 1 if(m_ms_count ==1 ||m_ms_count ==11 )
C51 COMPILER V7.00 TESTPROG 11/18/2007 17:17:47 PAGE 15
862 1 {
863 2
864 2 m_cur2_new = channel(151);//channel(2); //电流取样
865 2 m_vol2_new = channel(167);//channel(4); //二次电压
866 2 if(m_ms_count == 11)
867 2 m_vol2_11 = m_vol2_new;
868 2
869 2 if(m_get_gzfs == 4 && m_pulse_count == 2) goto next_h_11;
870 2 if(m_cur2_new > m_cur2_09 + 500 && m_cur2 > m_cur2_div6) goto next_111_h;//250->350
871 2
872 2 if(m_dtj > 109 ) // > 6000
873 2 { //250-> 380
874 3 if(m_cur2_new > m_vol2_new + 980 && m_cur2_new < 0x7f0) goto next_111_h;//900->950
875 3 if(m_vol2_new + m_get_o109 + 80 < m_vol2_old_01 )//320 pay attention to this number !!!!!
876 3 {
877 4 goto next_111_h;
878 4 }
879 3 }
880 2 else if(m_dtj > 72)// 4000 - 6000
881 2 { //80->320
882 3 if(m_cur2_new > m_vol2_new + 990 && m_cur2_new < 0x7f0) goto next_111_h;//750->900
883 3 if(m_vol2_new + m_get_o72 + 40 < m_vol2_old_01 )//240
884 3 {
885 4 goto next_111_h;
886 4 }
887 3 }
888 2 else // < 4000
889 2 { //80-> 300
890 3 // if(m_cur2_new > m_vol2_new + 550 && m_cur2_new < 0x7f0) goto next_111_h;//500->550
891 3 if(m_vol2_new + m_get_o36 < m_vol2_old_01 )//120
892 3 {
893 4 if( m_cur2 > m_cur2_div6) goto next_111_h; //240 m_cur2_new > m_vol2_new + 100 &&
894 4 }
895 3 }
896 2
897 2 // attention: for high voltage and low current
898 2 // if(m_vol2_new + 500 < m_vol2_old_01 )//180->200
899 2 // goto next_11_h;
900 2 next_h_11:
901 2 m_vol2_old_01 = m_vol2_new;
902 2 return;
903 2
904 2 next_111_h: //--------------------- spark at this time
905 2 TR0 = CLEAR; //关闭定时器0,
906 2 ET0 = CLEAR;
907 2 U_DRV = SET; //因为火花,关闭进一步的脉冲
908 2 m_br_fs = TRUE;
909 2 return;
910 2 }
911 1
912 1 if(m_br_fs) return; //假如封锁,立即退出采样
913 1 if(m_ms_count ==2 ||m_ms_count ==12) //2 ms
914 1 {
915 2 m_cur2_new = channel(151);//channel(2); //电流取样
916 2 m_vol2_new = channel(167);//channel(4); //二次电压
917 2 if(m_ms_count == 12)
918 2 m_vol2_12 = m_vol2_new;
919 2
920 2 //--------------------------------------本段判断偏励磁
921 2 //电流只有一半导通,判断电流反馈值的不规则性即可
922 2 if(m_get_gzfs == 1 )
923 2 {
C51 COMPILER V7.00 TESTPROG 11/18/2007 17:17:47 PAGE 16
924 3 if(m_pulse_count ==2)
925 3 {
926 4 if(m_cur2_old > m_cur2_new + 550) m_count_plc ++; //一个高,一个低
927 4 else
928 4 m_count_plc = 0;
929 4 m_cur2_old = m_cur2_new;
930 4 }
931 3 else if(m_pulse_count == 3)
932 3 {
933 4 if(m_cur2_old > m_cur2_new + 450) m_count_plc ++; //一个高,一个低
934 4 else
935 4 m_count_plc = 0;
936 4 m_cur2_old = m_cur2_new;
937 4 }
938 3 }
939 2 else if( m_get_gzfs == 4 )
940 2 {
941 3 if(m_pulse_count ==1)
942 3 {
943 4 if(m_cur2_old > m_cur2_new + 600) m_count_plc ++; //一个高,一个低
944 4 else
945 4 m_count_plc = 0;
946 4 m_cur2_old = m_cur2_new;
947 4 }
948 3 if(m_pulse_count ==2)
949 3 {
950 4 m_cur2_old = m_cur2_new;
951 4 }
952 3 else if(m_pulse_count == 3)
953 3 {
954 4 if(m_cur2_old > m_cur2_new + 500) m_count_plc ++; //一个高,一个低
955 4 else
956 4 m_count_plc = 0;
957 4 m_cur2_old = m_cur2_new;
958 4 }
959 3 else if(m_pulse_count == 4)
960 3 {
961 4 if(m_cur2_old > m_cur2_new + 200) m_count_plc ++; //一个高,一个低
962 4 else
963 4 m_count_plc = 0;
964 4 m_cur2_old = m_cur2_new;
965 4 }
966 3 }
967 2 /**/
968 2 else
969 2 {
970 3 if(m_cur2_new > m_cur2_old)
971 3 {
972 4 if(m_cur2_new - m_cur2_old > 650) m_count_plc ++; //一个高,一个低 600->650 2007/11/18
973 4 else
974 4 m_count_plc = 0;
975 4 }
976 3 else
977 3 {
978 4 if(m_cur2_old - m_cur2_new > 650) m_count_plc ++; //一个高,一个低 600->650 2007/11/18
979 4 else
980 4 m_count_plc = 0;
981 4 }
982 3 m_cur2_old = m_cur2_new;
983 3 }
984 2
985 2
C51 COMPILER V7.00 TESTPROG 11/18/2007 17:17:47 PAGE 17
986 2 // attention: for high voltage and low current
987 2 //------------------------700->900
988 2 if(m_dtj > 90 )
989 2 {
990 3 if(m_cur2_new > m_vol2_new + 900 && m_cur2 > m_cur2_div6) // && m_cur2_new < 0x7f0
991 3 {
992 4 TR0 = CLEAR; //关闭定时器0,
993 4 ET0 = CLEAR;
994 4 U_DRV = SET; //因为火花,关闭进一步的脉冲
995 4 m_br_fs = TRUE;
996 4 }
997 3 }
998 2 else
999 2 {
1000 3 if(m_cur2_new > m_vol2_new + 800 && m_cur2 > m_cur2_div6) // && m_cur2_new < 0x7f0
1001 3 {
1002 4 TR0 = CLEAR; //关闭定时器0,
1003 4 ET0 = CLEAR;
1004 4 U_DRV = SET; //因为火花,关闭进一步的脉冲
1005 4 m_br_fs = TRUE;
1006 4 }
1007 3 }
1008 2
1009 2 // m_vol2_o
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -