#ifndef __TYYYA_JI_H__ #define __TYYYA_JI_H__ #if TONG_YONG_MACHINE | BRUCE_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); extern void YYa_ExtiActionX31(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_NO_ZIPPER_ALARM 1 /* 没拉链,自动停机*/ #define YY_KA_DAI_ALARM 2 /* 卡带异常*/ #define YY_SM_YUANWEI 3 /* 上模上限位*/ #define YY_SM_DAOWEI 4 /* 上模下限位*/ #define YY_XM_YUANWEI 5 /* 下模上限位*/ #define YY_XM_DAOWEI 6 /* 下模下限位*/ #define YY_BACK_ALARM 7 #define YY_TOTAL_ALARM 8 #define YY_TL_ALARM 9 #define YY_GZ_ALARM 10 #define YY_JD_ORIGIN_ALARM 11 #define YY_DEC_ALARM 12 #define YY_BL_ALARM 17 #define YY_SM_ALARM 18 #define YY_LENGTH_LONG_ALARM 19 #define YY_LENGTH_SHORT_ALARM 20 #define YY_JD_IN_ALARM 21 #define VAVLE_ALARM_TIME 3000 #define MOTOR_ALARM_TIME 5000 #define YY_AutoDelay cDelayTime1 #define YY_MotorDelay cDelayTime2 #define YY_ZhuYouDelay cDelayTime3 #define YY_CheckDelay cDelayTime4 #define YY_CSDelay cDelayTime5 #define YY_TBDelay cDelayTime6 #define YY_TFKDelay cDelayTime7 #define YY_TLDelay cDelayTime8 #define YY_AlarmDelay cDelayTime10 #define YY_SJDelay cDelayTime11 #define YY_XMDelay cDelayTime12 #define YY_GZDelay 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_SD_IN X11 #define YY_HL_LIMIT_IN X12 #define YY_QY1_IN X13 #define YY_QY2_IN X14 #define YY_JT_IN X15 #define YY_LEFT_COUNT_IN X16 #define YY_LEFT_COUNT_IN_UP (X16 && !OLDX16) #define YY_RIGHT_COUNT_IN X17 #define YY_RIGHT_COUNT_IN_UP (X17 && !OLDX17) #define YY_LEFT_SL_DW_IN X30 #define YY_LEFT_SL_UP_IN X31 #define YY_RIGHT_SL_DW_IN X32 #define YY_RIGHT_SL_UP_IN X33 #define YY_HL_UP_IN X34 #define YY_HL_DW_IN X35 #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_SD_MOTOR Y07 #define YY_YL_MOTOR Y10 #define YY_HL_MOTOR Y11 #define YY_HL_VAVLE Y12 #define YY_LEFT_SL_MOTOR Y13 #define YY_RIGHT_SL_MOTOR Y14 #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 206 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 OverTimeHour; //34 unsigned short OverTimeMinute; //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 AllSetToatal;//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 res[2]; // 204 } YY_SystemParam_str; typedef __packed struct { unsigned short LeftRightLife[16]; // 206 unsigned short LeftRightUsedLife[16]; // 222 unsigned short RefreshTimes[16]; //238 unsigned short res[2]; unsigned short RemainLife[16]; // 256 unsigned short LifeAlarm; //272 } YY_ComponentParam_str; //M0~M4全局固定使用 /* #define bRunning M0000 #define bStart M0001 #define bStop M0002 #define bAlarmStop M0003 #define bClearTotal M0004 */ #define YY_bMode M0005 #define YY_bHL M0006 #define YY_bPYMotor M0007 #define YY_bPYControl M0008 #define YY_bZhuYou M0009 #define YY_bOnceStartPower M0010 #define YY_bClearAll M0011 #define YY_bReset M0012 #define YY_bClearAlarm M0013 #define YY_bBackMotor M0014 #define YY_bTL M0015 #define YY_bYD M0016 #define YY_bGZ M0017 #define YY_bJD M0018 #define YY_bYuanDianDW M0020 #define YY_bTestCS M0021 #define YY_bSingle M0022 #define YY_bTFK M0023 #define YY_bTB M0024 #define YY_bYBD M0025 #define YY_bClearNowTotal M0026 #define YY_bTS M0027 #define YY_bBL M0028 #define YY_bSetGZMode M0029 #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 #endif #endif