#ifndef __XDYYA_JI_H__ #define __XDYYA_JI_H__ #if XI_DONG_MACHINE /************************************** ** 函数名称:void SYYAJi(void) ** 函数功能:方块插稍机动作函数 ** 输入输出说明: 输入: X0 启动开关 X1 停止开关(做完当条停机) X2 紧急停机开关 X3 左计数接近开关 X4 右计数接近开关 X5 注油机液位开关 X6 注油机液压开关 X7 铜线故障 X10 成型故障 X11 卡带故障(布带1) X12 没带故障(布带2) X13 送带故障(布带3) X14 合链上限、下限位开关(合链1) X15 缺牙开关(合链2) X16 缺牙开关(合链3) X17 左送料开关上限(关) X20 左送料下限开关(开) X21 右送料上限开关(关) X22 右送料下限开关(开) X23 并链机上限开关(关) X24 并链机下限开关(开) X25 X26 X27 输出: Y0 蜂鸣器 Y1 左直流电磁铁(进) Y2 左直流电磁铁(出) Y3 右直流电磁铁(进) Y4 右直流电磁铁(出) Y5 主电机 Y6 注油机 Y7 左、右送带电机 Y10 压链电机 Y11 合链电机 Y12 合链电磁铁 Y13 左送料电机 Y14 右送料电机 Y15 并链电机 Y16 Y17 ***************************************/ extern void YYa_Action(void); extern void YYa_InitAction(void); #define YY_TOTAL_ADDR 76 #define YY_QIE_DUAN_TOTAL_ADDR 79 #define YY_ALARM_ADDR 100 #define YY_PROSPEED_ADDR 78 /* * 警告类型 警告编号 */ #define YY_NO_ALARM 0 /* 没警告*/ #define YY_KA_DAI_ALARM 0x0001 #define YY_CHENG_XING_ALARM 0x0002 #define YY_OIL_VOLUME_ALARM 0x0004 #define YY_QUE_DAI_ALARM 0x0008 #define YY_TONG_XIAN_ALARM 0x0010 #define YY_OIL_PRESSURE_ALARM 0x0020 #define YY_JIN_LIAN_ALARM 0x0040 #define YY_TOOTH_NUM_ALARM 0x0080 #define YY_EGM_ALARM 0x0100 #define VAVLE_ALARM_TIME 3000 #define MOTOR_ALARM_TIME 5000 #define YY_DCT_OUT_TIME 38 //电磁铁输出时间 #define YY_SINGLE_MODE 0 #define YY_GROUP_MODE 1 #define YY_SINGLE_ADDR 0 #define YY_GROUP_ADDR 40 #define YY_SYSTEM_ADDR 192 #define YY_LIFE_ADDR 207 #define YY_ErrorDelay cDelayTime1 #define YY_CalProcessDelay cDelayTime2 #define YY_OilCheckDelay cDelayTime3 #define YY_CheckDelay cDelayTime4 #define YY_HLDelay cDelayTime5 #define YY_LCntDelay cDelayTime6 #define YY_RCntDelay cDelayTime7 #define YY_ZYDelay cDelayTime8 #define YY_TryDelay cDelayTime10 #define YY_SJDelay cDelayTime11 #define YY_XMDelay cDelayTime12 #define YY_ZhuYouDelay cDelayTime13 #define YY_AutoStep cStepMByte #define YY_MotorStep cStepMByte1 #define YY_XiaQieStep cStepMByte2 #define YY_YuanDianStep cStepMByte3 #define YY_TuiLianStep cStepMByte4 #define YY_TuiFangKuaiStep cStepMByte5 #define YY_BinLianStep cStepMByte6 //超声花边切输入输出 #define YY_START_IN X00 #define YY_START_IN_UP (X00 && !OLDX00) #define YY_STOP_IN X01 #define YY_STOP_IN_UP (X01 && !OLDX01) #define YY_EGMSTOP_IN X02 #define YY_YW_IN X03 #define YY_YY_IN X04 #define YY_TX_IN X05 #define YY_CX_IN X06 #define YY_KD_IN X07 #define YY_ZIPPER_IN X10 #define YY_JT_IN X11 #define YY_JT_IN_UP (X11 && !OLDX11) #define YY_JT_IN_DW (!X11 && OLDX11) #define YY_HL_LIMIT_IN X12 #define YY_LEFT_SL_UP_IN X13 #define YY_LEFT_SL_DW_IN X14 #define YY_RIGHT_SL_UP_IN X15 #define YY_RIGHT_SL_DW_IN X16 #define YY_LEFT_COUNT_IN X17 #define YY_LEFT_COUNT_IN_UP (X17 && !OLDX17) #define YY_RIGHT_COUNT_IN X20 #define YY_RIGHT_COUNT_IN_UP (X20 && !OLDX20) #define YY_HL_UP_IN X30 #define YY_HL_DW_IN X31 #define YY_ALARM_LED Y00 #define YY_LEFT_IN Y01 #define YY_LEFT_OUT Y02 #define YY_RIGHT_IN Y03 #define YY_RIGHT_OUT Y04 #define YY_MAIN_MOTOR Y05 #define YY_OIL_MOTOR Y06 #define YY_HL_MOTOR Y10 #define YY_LEFT_SL_MOTOR Y13 #define YY_RIGHT_SL_MOTOR Y14 typedef __packed struct { unsigned short LeftToothNum; // 0 unsigned short LeftToothLengthCM; // 1 unsigned short LeftToothLengthINCH; // 2 unsigned short LeftToothNumSpace; // 3 unsigned short LeftToothLengthCMSpace;// 4 unsigned short LeftToothLengthINCHSpace;//5 unsigned short RightToothNum; // 6 unsigned short RightToothLengthCM; // 7 unsigned short RightToothLengthINCH; // 8 unsigned short RightToothNumSpace; // 9 unsigned short RightToothLengthCMSpace;// 10 unsigned short RightToothLengthINCHSpace;//11 unsigned short DisplyLeftToothNum; // 12 unsigned short DisplyLeftToothLengthCM; // 13 unsigned short DisplyLeftToothLengthINCH; // 14 unsigned short DisplyLeftToothNumSpace; // 15 unsigned short DisplyLeftToothLengthCMSpace;// 16 unsigned short DisplyLeftToothLengthINCHSpace;//17 unsigned short DisplyRightToothNum; // 18 unsigned short DisplyRightToothLengthCM; // 19 unsigned short DisplyRightToothLengthINCH; // 20 unsigned short DisplyRightToothNumSpace; // 21 unsigned short DisplyRightToothLengthCMSpace;// 22 unsigned short DisplyRightToothLengthINCHSpace;//23 unsigned long SetTotal; //24 unsigned long OverTotal;//26 unsigned long SetLength;//28 unsigned long OverLength;//30 unsigned short SetTimeHour; //32 unsigned short SetTimeMinute; //33 unsigned short RemainTimeHour; //34 unsigned short RemainTimeMinute; //35 unsigned short res[4]; } YY_SingleParam_str; typedef __packed struct { unsigned short LeftToothNum[5]; // 40 unsigned short LeftToothLengthCM[5]; // 45 unsigned short LeftToothLengthINCH[5]; // 50 unsigned short LeftToothNumSpace[5]; // 55 unsigned short LeftToothLengthCMSpace[5];// 60 unsigned short LeftToothLengthINCHSpace[5];//65 unsigned short RightToothNum[5]; // 70 unsigned short RightToothLengthCM[5]; // 75 unsigned short RightToothLengthINCH[5]; // 80 unsigned short RightToothNumSpace[5]; // 85 unsigned short RightToothLengthCMSpace[5];// 90 unsigned short RightToothLengthINCHSpace[5];//95 unsigned long SetTotal[5];//100 unsigned short DisplyLeftToothNum[5]; // 110 unsigned short DisplyLeftToothLengthCM[5]; // 115 unsigned short DisplyLeftToothLengthINCH[5]; // 120 unsigned short DisplyLeftToothNumSpace[5]; // 125 unsigned short DisplyLeftToothLengthCMSpace[5];// 130 unsigned short DisplyLeftToothLengthINCHSpace[5];//135 unsigned short DisplyRightToothNum[5]; // 140 unsigned short DisplyRightToothLengthCM[5]; // 145 unsigned short DisplyRightToothLengthINCH[5]; // 150 unsigned short DisplyRightToothNumSpace[5]; // 155 unsigned short DisplyRightToothLengthCMSpace[5];// 160 unsigned short DisplyRightToothLengthINCHSpace[5];//165 unsigned long OverSetTotal[5];//170 unsigned long AllSetTotal;//180 unsigned long AllSetLength;//182 unsigned long AllOverTotal;//184 unsigned long AllOverLength;//186 unsigned short SetTimeHour; //188 unsigned short SetTimeMinute;//189 unsigned short RemainTimeHour; //190 unsigned short RemainTimeMinute;//191 } YY_GroupParam_str; typedef __packed struct { unsigned short AlarmCode; // 192 unsigned short OilTime; //193 unsigned short IntOilTime; //194 unsigned short StartOilTime; //195 unsigned short RemainOilTime; //196 unsigned short JieTouToothNum; //197 unsigned long AllProductTime; //198 unsigned long AllProductLength;//200 unsigned short DisplayOilTime; //202 unsigned short NowGroup; //203 unsigned short JieTouMJToothNum;// 204 unsigned short DifferentLengthToothNum;// 205 unsigned short NextGroupBuff;// 206 unsigned short TotalDisplayState[5];//207 unsigned short ToothLength;//212 unsigned short ToothNum;//213 } YY_SystemParam_str; typedef __packed struct { unsigned short LeftRightLife[16]; // 212 unsigned short LeftRightUsedLife[16]; // 228 unsigned short RefreshTimes[16]; //244 unsigned short res[2]; unsigned short RemainLife[16]; // 262 unsigned short LifeAlarm; //278 } YY_ComponentParam_str; #define YY_DISPLAY_STATE user_datas[300] #define YY_DIAPLAY0 user_datas[350] #define YY_DIAPLAY1 user_datas[351] #define YY_DIAPLAY2 user_datas[352] #define YY_DIAPLAY3 user_datas[353] #define YY_DIAPLAY4 user_datas[354] #define YY_DIAPLAY5 user_datas[355] #define YY_DIAPLAY6 user_datas[356] #define YY_DIAPLAY7 user_datas[357] #define YY_bPYMotor M0002 #define YY_bZhuYou M0003 #define YY_bHL M0004 #define YY_bSongSi M0005 #define YY_bPYControl M0006 #define YY_bWorkState M0007 #define YY_bZYNow M0008 #define YY_bClearTotal M0009 #define YY_bOnceStartPower M0010 #define YY_bMode M0011 #define YY_bReset M0012 #define YY_bClearAlarm M0013 #define YY_bCalculateTotal M0015 #define YY_bCalInputToothNum M0016 #define YY_bCalInputLength M0017 #define YY_bCalInputLengthInch M0018 #define YY_bCalInputRightToothNum M0019 #define YY_bCalInputRightToothNumLength M0020 #define YY_bCalInputRightToothNumLengthInch M0021 #define YY_bCalInputRightKongWei M0022 #define YY_bCalInputRightKongWeiLength M0023 #define YY_bCalInputRightKongWeiLengthInch M0024 #define YY_bCalAllLength M0025 #define YY_bChangeNextGroup M0026 #define YY_bDCTEnable M0027 #define YY_bSetDCTEnable M0028 #define YY_bRunning M0030 #define YY_bStart M0031 #define YY_bStop M0032 #define YY_bAlarmStop M0033 #define YY_bSingStop M0034 #define YY_bClearPro M0035 #define YY_bClearLife1 M0050 #define YY_bClearLife2 M0051 #define YY_bClearLife3 M0052 #define YY_bClearLife4 M0053 #define YY_bClearLife5 M0054 #define YY_bClearLife6 M0055 #define YY_bClearLife7 M0056 #define YY_bClearLife8 M0057 #define YY_bClearLife9 M0058 #define YY_bClearLife10 M0059 #define YY_bClearLife11 M0060 #define YY_bClearLife12 M0061 #define YY_bClearLife13 M0062 #define YY_bClearLife14 M0063 #define YY_bClearLife15 M0064 #define YY_bClearLife16 M0065 #define YY_bClearTimes1 M0066 #define YY_bClearTimes2 M0067 #define YY_bClearTimes3 M0068 #define YY_bClearTimes4 M0069 #define YY_bClearTimes5 M0070 #define YY_bClearTimes6 M0071 #define YY_bClearTimes7 M0072 #define YY_bClearTimes8 M0073 #define YY_bClearTimes9 M0074 #define YY_bClearTimes10 M0075 #define YY_bClearTimes11 M0076 #define YY_bClearTimes12 M0077 #define YY_bClearTimes13 M0078 #define YY_bClearTimes14 M0079 #define YY_bClearTimes15 M0080 #define YY_bClearTimes16 M0081 #define YY_bFirstZY M0100 #define YY_bClear1 M0101 #define YY_bClear2 M0102 #define YY_bClear3 M0103 #define YY_bClear4 M0104 #define YY_bClear5 M0105 #endif #endif