#ifndef __JXBKQUE_DUAN_JI_H__ #define __JXBKQUE_DUAN_JI_H__ #if JU_XING_MACHINE==1 extern void BK_QueDuan_Action(void); extern void BK_QueDuan_InitAction(void); extern void QueDuanEx_ExtiActionX31(void); extern void FastTimerAction(void); #define BKQD_DIR_P 1 #define BKQD_DIR_N 0 #define PP_NoStop 1 #define PP_Stop 0 #define BKQD_YDIR_P 1 #define BKQD_YDIR_N 0 #define CT_WORKTOTAL_ADDR 102 #define BKQD_TOTAL_ADDR 76 #define BKQD_ALARM_ADDR 100 #define BKQD_PROSPEED_ADDR 78 #define BKQD_PARAM_ZIPPER_LENGTH_ADDR 1 #define BKQD_BACK_INDUCTION_MODE 0 //后退纯感应方式 #define BKQD_BACK_MEMORY_MODE 1 //后退记忆长度方式 #define BKQD_BACK_INPUT_LENGTH_MODE 2 //后退手动输入长度方式 #define BKQD_BACK_NOMAL_DEC_MODE 0 //后退感应减速方式 #define BKQD_BACK_DIGITAL_MODE 1 //后退数控减速方式 #define BKQD_SK_MODE 0 //1为双开 #define BKQD_KB_MODE 1//1为闭口 ,0开口(一字切) /* * 警告类型 警告编号 */ #define BKQD_NO_ALARM 0 /* 没警告*/ #define BKQD_NO_ZIPPER_ALARM 1 /* 没拉链,自动停机*/ #define BKQD_KA_DAI_ALARM 2 /* 卡带异常*/ #define BKQD_SM_YUANWEI 3 /* 上模上限位*/ // #define BKQD_SM_DAOWEI 4 /* 上模下限位*/ #define BKQD_XM_YUANWEI 5 /* 下模上限位*/ #define BKQD_XM_DAOWEI 6 /* 下模下限位*/ #define BKQD_BACK_ALARM 7 #define BKQD_TOTAL_ALARM 8 #define BKQD_TL_ALARM 9 #define BKQD_GZ_ALARM 10 //勾针 #define BKQD_JD_ORIGIN_ALARM 11 #define BKQD_DEC_ALARM 12 #define BKQD_QIAN_LIMIT_ALARM 13 //前限位出错 #define BKQD_BL_ALARM 17 #define BKQD_SM_ALARM 18 #define BKQD_LENGTH_LONG_ALARM 19 #define BKQD_LENGTH_SHORT_ALARM 20 #define BKQD_PARAM_RUN_LENGTH_ALARM 21 //超出轨道运行长度 #define BKQD_PARAM_ANQUANMEN_ALARM 22 #define VAVLE_ALARM_TIME 3000 #define MOTOR_ALARM_TIME 5000 #define BKQD_PARAM_GZ_DELAY (user_datas[0]*10) #define BKQD_PARAM_ZIPPER_LENGTH (user_datas[1] | (user_datas[2] >> 16)) #define BKQD_PARAM_TL_DELAY 20//(user_datas[3]*10) #define BKQD_PARAM_YD_DELAY 20//0//(user_datas[4]*10) #define BKQD_PARAM_BACK_LOW_SPEED_LENGTH user_datas[6] //后拉慢速长度 #define BKQD_PARAM_CUT_DELAY (user_datas[7]*10) #define BKQD_PARAM_CUT_BACK_DELAY (user_datas[8]) #define BKQD_PARAM_FIRST_SPEED user_datas[9] #define BKQD_PARAM_CS_COLD_TIME (user_datas[10] * 10) //固化时间 #define BKQD_PARAM_ZS_STOP_TIME (user_datas[11] * 10) #define BKQD_PARAM_DELAY_BACK (user_datas[12]*10) #define BKQD_PARAM_CYCLE_DELAY (user_datas[14]*10) #define BKQD_PARAM_GO_HIGH_SPEED user_datas[15] #define BKQD_PARAM_GO_LOW_SPEED_LENGTH user_datas[16] #define BKQD_PARAM_GO_LOW_SPEED user_datas[17] #define BKQD_PARAM_BACK_SPEED user_datas[18] //后拉速度 #define BKQD_PARAM_BACK_LENGTH user_datas[19] ////松夹子长度后走的长度 #define BKQD_PARAM_DELAY_CS (user_datas[20] * 10) //延时超声 #define BKQD_PARAM_CS_TIME (user_datas[21] * 10) //超声时间 #define BKQD_PARAM_FZ_LENGTH user_datas[22] //反转长度 #define BKQD_PARAM_TB_TIME (user_datas[23]*10) #define BKQD_PARAM_OFFSET_LENGTH user_datas[24] //修正长度 #define BKQD_PARAM_CUT_BACK_SPEED user_datas[26] //切断后拉带速度 #define BKQD_PARAM_SJZ_LENGTH user_datas[27] //松夹子长度 #define BKQD_PARAM_BACK_MODE user_datas[30] //后退方式 1为记忆长度,0为感应方式 #define BKQD_PARAM_HL_ENABLE user_datas[33] //护链() #define BKQD_PARAM_CS_MODE user_datas[36] //0为气切1为超声切 #define BKQD_PARAM_CYCLE_LENGTH user_datas[38] //电机周长 #define BKQD_PARAM_CYCLE_PULSE user_datas[39] //电机细分 #define BKQD_PARAM_TABLE_NUM user_datas[40] //台面动作条数 #define BKQD_PARAM_MOTOR_DELAY_LENGTH ((unsigned long)user_datas[41] * user_datas[39]/user_datas[38]) //算出脉冲值 #define BKQD_PARAM_TFK_DELAY (user_datas[44]*10) //延时推方块 #define BKQD_PARAM_START_SPEED user_datas[45] #define BKQD_PARAM_ACC user_datas[46] #define BKQD_PARAM_DCC user_datas[47] #define BKQD_PARAM_CHECK_BACK_HSPEED user_datas[48] #define BKQD_PARAM_CHECK_BACK_LSPEED user_datas[49] #define BKQD_PARAM_DELAY_CHECK 100//user_datas[50] // #define BKQD_PARAM_YALIAN_LENGTH user_datas[53] //提前压并链长度 (双开用) #define BKQD_PARAM_GOUZHEN_LENGTH user_datas[54] //提前上勾针长度 #define BKQD_PARAM_TIAOSHI_MODE user_datas[55] #define BKQD_PARAM_DELAY_HL_LENGTH user_datas[56] #define BKQD_PARAM_BL_ENABLE user_datas[57] //并链就是合链 #define BKQD_PARAM_DELAY_XM (user_datas[58]*10) #define BKQD_PARAM_DELAY_XM_LENGTH user_datas[59] #define BKQD_PARAM_BACK_LOW_SPEED user_datas[60] #define BKQD_PARAM_DEC_MODE 1//user_datas[61]//0为使用感应减速 1后退使用数控降速 #define BKQD_PARAM_LT_ENABLE user_datas[62] #define BKQD_PARAM_NO_LT_DELAY_CHECK user_datas[63] #define BKQD_PARAM_ERROR_LENGTH user_datas[64] //长度允许误差 #define BKQD_PARAM_DELAYBACK_SM (user_datas[65]) //#define BKQD_PARAM_TC_LENGTH user_datas[67] //#define BKQD_PARAM_FIRST_GO_HIGHSPEED user_datas[69] #define BKQD_PARAM_LENGTH_MODE 1//user_datas[70] //实则不用 //#define BKQD_PARAM_FIRST_BACK_LOWSPEED user_datas[71] //不用 #define BKQD_PARAM_SET_TOTAL 0//(user_datas[74] | (user_datas[75] >> 16)) #define BKQD_PARAM_CS_ENABLE 1//user_datas[80] #define BKQD_PARAM_TD_DELAY (user_datas[81]*10) #define BKQD_PARAM_TD_TIME (user_datas[82]*10) #define BKQD_PARAM_DELAY_CHECK_GZ (user_datas[83]) #define BKQD_PARAM_NOW_CNT user_datas[84] #define BKQD_PARAM_ZHA_SHU user_datas[85] #define BKQD_PARAM_HL_DELAY_BACK user_datas[86] //合链延时退 #define BKQD_PARAM_RUN_LENGTH (user_datas[87]) //轨道运行长度 #define BKQD_PARAM_TFK_NUMBER user_datas[88] // 推方块次数 #define BKQD_PARAM_STOP_TIME user_datas[89] //停机时间 #define BKQD_PARAM_TDYS_DELAY user_datas[90]*10 #define BKQD_PARAM_ChuiQi_TIME (user_datas[91]*10) //吹气时间 #define BKQD_PARAM_TTFK_TIME (user_datas[92]*10) //退推方块时间 #define BKQD_PARAM_SHUANGDAO_MODE user_datas[93] //二次切模式 #define BKQD_PARAM_SHUANGDAO_LENGTH user_datas[94] //二次切模式拉出长度 #define BKQD_PARAM_TL_MODE 0 #define BKQD_PARAM_ON_BACK_LENGTH 3000 #define BKQD_AutoDelay cDelayTime1 #define BKQD_MotorDelay cDelayTime2 #define BKQD_XiaQieDelay cDelayTime3 #define BKQD_KaDaiDelay cDelayTime4 #define BKQD_CSDelay cDelayTime5 #define BKQD_TBDelay cDelayTime6 #define BKQD_TFKDelay cDelayTime7 #define BKQD_TLDelay cDelayTime8 #define BKQD_TuiDaiDelay cDelayTime9 #define BKQD_AlarmDelay cDelayTime10 #define BKQD_SJDelay cDelayTime11 #define BKQD_TableDelay cDelayTime12 #define BKQD_StopCodeDelay cDelayTime13 #define BKQD_ChuiQiDelay cDelayTime14 #define BKQD_AutoStep cStepMByte #define BKQD_MotorStep cStepMByte1 #define BKQD_XiaQieStep cStepMByte2 #define BKQD_YuanDianStep cStepMByte3 #define BKQD_TuiLianStep cStepMByte4 #define BKQD_CheckLengthStep cStepMByte5 #define BKQD_BinLianStep cStepMByte6 #define BKQD_TuiDaiStep cStepMByte7 #define BKQD_StopStep cStepMByte8 #define BKQD_CHUIQIStep cStepMByte9 //8位变量 #define BK_cCheckLianFlg cCharBuff1 #define BK_cCheckLianFlgEN cCharBuff2 #define BK_cGoLimitEn cCharBuff3 #define BK_cTABLETOTAL cCharBuff4 #define BK_cTABLETIME cCharBuff5 #define BK_cDLJ_ATUO cCharBuff6 #define BK_cSTOPONE cCharBuff7 #define BK_cStopMode cCharBuff8 #define BK_cZhouWanone cCharBuff9 #define BK_BKQD_RMONE cCharBuff10 #define BK_DCC_TIME_BL cCharBuff11 #define BK_cZipCnt cCharBuff12 #define BK_cTableCnt cCharBuff13 #define BK_cTuiFangKuaiCnt cCharBuff14 #define BK_cECQ_STOP cCharBuff15 #define BK_cDiErLaChu cCharBuff16 #define BK_cShuangDao cCharBuff17 #define BKQD_RMONE cCharBuff18 //32位无符号变量 #define BK_save_limit_pos cUDword32Buff1 #define BK_cRealPos cUDword32Buff2 #define BK_dwSaveLength cUDword32Buff3 //超声花边切输入输出 #define BKQD_START_IN M0384 #define BKQD_START_IN_UP (M0384 && !OLDM384) #define BKQD_STOP_IN M0385 #define BKQD_STOP_IN_UP (M0385 && !OLDM385) //#if BKQD_SK_MODE // 1 //1为双开 // #define BKQD_GOUZHEN_IN X04 //光电开关 //#else #define BKQD_GOUZHEN_IN M0388 #define BKQD_GOUZHEN_IN_UP (M0388 && !OLDM388) //#endif #define BKQD_QIAN_LIMIT_IN M0389 #define BKQD_QIAN_LIMIT_IN_UP (M0389 && !OLDM389) #define BKQD_QIAN_LIMIT_IN_DW (!M0389 && OLDM389) #define BKQD_QIAN_STOP_Auto M0410 #define BKQD_QIAN_START_Auto M0410 #define BKQD_ANQUANMEN_LIMIT_IN M0390//X06 //安全门 #define BKQD_ANQUANMEN_LIMIT_IN_UP (M0390 && !OLDM390)//X06 //安全门 #define BKQD_STOP_ANNIU_IN M0396//X14 //急停按钮 #define BKQD_STOP_ANNIU_IN_UP (M0396 && !OLDM396) #define BKQD_SAFE_IN 0 #if BKQD_KB_MODE //闭口 #define BKQD_GUO_LIAN_IN M0391 #define BKQD_GUO_LIAN_IN_UP (M0391 && !OLDM391) #define BKQD_GUO_LIAN_IN_DW (!M0391 && OLDM391) #define BKQD_PARAM_XM_ENABLE user_datas[35] //0下模动 1下模不动 #define BKQD_SHANG_MU_LIMIT_IN M0387 #define BKQD_SHANG_MU_ORIGIN_IN M0386 #define BKQD_XIA_MU_LIMIT_IN M0395 //X13 #define BKQD_CQ_VAVLE M0361 //Y11吹气 #define BKQD_JZ_DIR M0353 //电机方向 io_outputs[1].bits.b2 #define BKQD_SZ_OUT M0354 //电机使能 #define BKQD_GZ_VAVLE M0355 //勾针 #define BKQD_JD_VAVLE M0356 //夹子气缸 #define BKQD_SM_VAVLE M0357 //上模 #define BKQD_TL_VAVLE M0358 //送链 #define BKQD_TABLE_VAVLE M0359 //台面电机 #define BKQD_YD_VAVLE M0360 //压带 #define BKQD_BL_VAVLE M0361 //合链(并链) // #define BKQD_TL_VAVLE M0362 //推链就是送链 #define BKQD_XM_VAVLE M0362 #define BKQD_YY_OUT M0352 //液压 #define BKQD_CS_OUT M0365 //超声波 #define BKQD_WARMMING_LED M0364 //警告 //下面为程序编译用,空输出输入 #define BKQD_HL_VAVLE M0383 //护链 #define BKQD_YX_VAVLE M0383 //压带 #define BKQD_TFK_VAVLE M0383 // #define BKQD_DGLG_VAVLE M0383 #else //开口 #define BKQD_GUO_LIAN_IN M0386 #define BKQD_GUO_LIAN_IN_UP (M0386 && !OLDM386) #define BKQD_GUO_LIAN_IN_DW (!M0386 && OLDM386) #define BKQD_PARAM_XM_ENABLE user_datas[35] //0下模动 1下模不动 #define BKQD_SHANG_MU_ORIGIN_IN M0393 #define BKQD_SHANG_MU_LIMIT_IN M0394 #define BKQD_XIA_MU_LIMIT_IN M0395 #define BKQD_DGLG_VAVLE M0380 //顶过链杆 // #define BKQD_JZ_DIR M0353 //电机方向 #define BKQD_SZ_OUT M0354 //电机使能 #define BKQD_GZ_VAVLE M0355 //勾针 #define BKQD_TFK_VAVLE M0356 //推方块 #define BKQD_JD_VAVLE M0357 //夹子气缸 #define BKQD_SM_VAVLE M0358 //上模 #define BKQD_YD_VAVLE M0359 //压带 #define BKQD_TL_VAVLE M0360 //送链(和下模共用) #define BKQD_BL_VAVLE M0361 //合链(并链) #define BKQD_TABLE_VAVLE M0362 //台面电机 #define BKQD_XM_VAVLE M0360 // 下模 #define BKQD_CQ_VAVLE M0361 #define BKQD_CS_OUT M0365 //超声波 #define BKQD_WARMMING_LED M0364 //警告 //下面为程序编译用,空输出输入 #define BKQD_HL_VAVLE M0383 //护链 #define BKQD_YX_VAVLE M0383 //压带 #endif //M0~M4全局固定使用 /* #define bRunning M0000 #define bStart M0001 #define bStop M0002 #define bAlarmStop M0003 #define bClearTotal M0004 */ #define BKQD_bSM M0006 //上模 #define BKQD_bXM M0007 //下模 #define BKQD_bClearTotal M0008 //产量清零 #define BKQD_bXiaQie M0009 //下切 #define BKQD_bQianDianDW M0010 //前点定位 #define BKQD_bChaoSheng M0011 //超声 #define BKQD_bJiaDai M0012 //夹带 #define BKQD_bGoMotor M0013 //电机前进 #define BKQD_bBackMotor M0014 //电机后退 #define BKQD_bTL M0015 //推链(送链) #define BKQD_bYD M0016 //压带 #define BKQD_bGZ M0017 //勾针 #define BKQD_bJD M0018 //夹带 #define BKQD_bHL M0019 //护链 #define BKQD_bYuanDianDW M0020 //不用 #define BKQD_bTestCS M0021 //超声测试 #define BKQD_bSingle M0022 #define BKQD_bTFK M0023 //推方块 #define BKQD_bTB M0024 //台面 #define BKQD_bYBD M0025 #define BKQD_bClearNowTotal M0026 //产量清零 #define BKQD_bTS M0027 #define BKQD_bBL M0028 //并链(合链) #define BKQD_bYX M0029 #define BKQD_bECQ M0030 //二次切手动 #endif #endif