#ifndef __GLMXC_NILONG_STEP_JI_H__ #define __GLMXC_NILONG_STEP_JI_H__ #if CHANG_SHENG_GEI_LI_MACHINE==1 extern void MXC_InitAction(void); extern void MXC_NiLongXiuCiJiAction(void); extern void MXC_ExtiActionX31(void); extern void MXC_ExtiActionX20(void); #define MXC_ALARM_ADDR 100 #define MXC_ZIPPER_LENGTH_ADDR 17 #define MXC_TOTAL_ADDR 76 #define MXC_PROSPEED_ADDR 78 #define MXC_SERVER_EN 0 #define MXC_SERVER_DISEN 1 #define MXC_SC_EN 1 #define MXC_SC_DISEN 0 #define MXC_XC_SERVER_EN 1 #define MXC_XC_SERVER_DISEN 0 #define MXC_DIR_P 1 #define MXC_DIR_N 0 #define MXC_GZ_DIR_P 1 #define MXC_GZ_DIR_N 0 #define MXC_NO_ALARM 0 #define MXC_TOTAL_ALARM 1 #define MXC_XIA_CHONG_ALARM 2 #define MXC_KA_DAI_ALARM 3 #define MXC_DAO_JU_ALARM 4 #define MXC_XC_ALARM 5 #define MXC_FEN_ZHEN_ALARM 6 #define MXC_NO_ZIPPER_ALARM 7 #define MXC_SEBIAO_LENGTH_ALARM 8 #define MXC_NO_GOUZHEN_ALARM 9 #define MXC_START_LFZ_ORIGIN_ALARM 10 #define MXC_START_RFZ_ORIGIN_ALARM 11 #define MXC_START_NO_ZIPPER_ALARM 12 #define MXC_LONG_TIME_NO_ZIPPER_ALARM 13 #define MXC_NO_SEBIAO_ALARM 14 #define MXC_SEBIAO_ZIPPER_LENGTH_ALARM 15 #define MXC_GOUZHEN_MORE_ALARM 16 //勾针定位超限 #define MXC_GOUZHEN_MIN_LENGTH_ALARM 17 #define MXC_MOTOR_ALALRM_TIME 20000 #define FenZhengErrorTime 500 #define ERRORTIME 2000 //出错时间 #define MXC_USE_GZ_SERVO 0 //0为不使用伺服钩针 #define MXC_PARAM_XIAZHI_TIME (user_datas[0]*10) #define MXC_PARAM_CHUIQI_TIME (user_datas[1]*10) #define MXC_PARAM_CHAOSHENG_TIME (user_datas[2]*10) #define MXC_PARAM_SC_DELAY (user_datas[3]) #define MXC_PARAM_XC_DELAY (user_datas[5]*10) #define MXC_PARAM_SET_SPEED user_datas[8] #define MXC_PARAM_LOW_SPEED user_datas[9] #define MXC_PARAM_LOWSPEED_LENGTH user_datas[10] #define MXC_XiaMode 0//user_datas[11] //0 普通下止 1 超声下止 #define MXC_GuoLianMode user_datas[12] #define MXC_FenZSelect 1//user_datas[34] #define MXC_PARAM_DAOKOU_LENGTH user_datas[13] #define MXC_PARAM_DAILUN_LENGTH user_datas[14] #define MXC_SET_ZIPPER_LENGTH (user_datas[15] | (user_datas[16] << 16)) #define MXC_SET_ZIPPER_LENGTH_ADDR 15 #define MXC_SET_REVISE_ZIPPER_LENGTH user_datas[17] #define MXC_DC_MODE user_datas[19] //0勾针 1步进/伺服 2色标 #define MXC_XIA_ZHI_ENABLE user_datas[20] //0不使用下止 1使用下止 #define MXC_DEC_MODE user_datas[21] //0为感应减速模式,1为数控减速模式 #define MXC_SET_TOTAL (user_datas[22] | (user_datas[23] << 16)) #define MXC_GOU_ZHEN_MODE 0//user_datas[24] // 0为普通勾针 1为活动勾针 #define MXC_GuoLianCheckMode user_datas[25] // 超声下止模式下,过链感应有效电平配置1为翻转电平 #define MXC_PARAM_XIAZHI_DELAY_TIME user_datas[26] #define MXC_XiaChongMotorMode user_datas[27] //0为交流1为步进/伺服 #define MXC_XiaChongSpeed user_datas[29] #define MXC_XiaChongLowSpeed 10 #define MXC_MOTOR_MODE user_datas[30] //0步进松轴电平1伺服松轴电平 #define MXC_PARAM_DELAY_CHUIQI_TIME (user_datas[31]*10) #define MXC_PARAM_FIRST_SPEED user_datas[32] #define MXC_PARAM_GZ_RESET_MODE user_datas[33] //勾针复位方式 0为自动1为数控 #define MXC_PARAM_SEBIAO_TQ_LENGTH user_datas[46] #define MXC_PARAM_SEBIAO_DW_LENGTH user_datas[47] #define MXC_PARAM_GZ_LENGTH user_datas[48] #define MXC_PARAM_GZ_DELAY (user_datas[49]*10) #define MXC_PARAM_MOTOR_ALARM_TIME (user_datas[50]*10) #define MXC_PARAM_R_FZ_DELAY (user_datas[51]*10) #define MXC_PARAM_L_FZ_DELAY (user_datas[52]*10) #define MXC_PARAM_MOTOR_DELAY (user_datas[53]*10) #define MXC_PARAM_SC_MODE user_datas[54] #define MXC_PARAM_AUTO_CHECK_MODE user_datas[55]//1为自动测长0为手动输入长度 #define MXC_PARAM_DELAY_XC (user_datas[56]*10) #define MXC_PARAM_SB_HIGH_SPEED user_datas[57] #define MXC_PARAM_SB_LOW_SPEED user_datas[58] #define MXC_PARAM_SB_OFFSET_SPEED user_datas[59] #define MXC_ERROR_LENGTH user_datas[60] #define MXC_PARAM_START_SPEED user_datas[61] #define MXC_PARAM_ACC_SPEED user_datas[62] #define MXC_PARAM_DEC_SPEED user_datas[63] #define MXC_PARAM_DELAY_GOUZHEN_BACK (user_datas[88]*10) //2022.6.24加 #define MXC_GouzhenSpeed_Hand_SPEED user_datas[64] //手动勾针速度 #define MXC_GouzhenSpeed_Auto_SPEED user_datas[65] //自动勾针速度 #define MXC_PARAM_GouZhenLun_LENGTH user_datas[66] //勾针轮周长 #define MXC_Gouzhencurrent_L user_datas[67] //勾针当前位置 #define MXC_GouzhenMin_Length_JiaChang user_datas[85] #define MXC_GouzhenMin_Length (user_datas[68]+user_datas[85]) //勾针最小位置即偏移加上加长杆长度 //2023.11.22加上 #define MXC_DAO_JU_ALARM_EN user_datas[86] //订单功能参数 #define MXC_DingDanJianGe_Length user_datas[69] //订单间隔长度 #define MXC_DingDan_NowNum user_datas[70] //当前订单加工序号 #define MXC_DingDanJianGe_State user_datas[75] //订单间隔状态,1 未完成 #define MXC_ScanMa_LENGTH (user_datas[71] | (user_datas[72] << 16)) //扫码的拉链长度 #define MXC_ScanMa_Production (user_datas[73] | (user_datas[74] << 16)) //扫码的生产数量 #define MXC_ProSpeed user_datas[78] //生产速度 #define MXC_DingDanWorkMode user_datas[79] //订单工作模式 0,不走订单组,独立外面设置, 1 按订单组工作 #define MXC_N_LIMIT_LENGTH_ADDR 82 //勾针电机软后限 #define MXC_PARAM_SHIFU_LOWSPEED_LENGTH user_datas[89]//步进定寸慢速长度 #define MXC_PARAM_SHIFU_LOW_SPEED user_datas[90]//步进定寸慢速度 #define MXC_PARAM_SEBIAO_LOWSPEED_LENGTH user_datas[91]//色标慢速长度 //D76,D77 产量 //D78 生产总量 #define MXC_DingDanNum 5 //订单组数 #define MXC_DingDanAddr 130 //D130开始为订单数据 D130 D131 为拉链长度, D132 D133 为当前拉链条数 D134 D135 为当前订单完成拉链条数 每组以此按顺序排放 #define MXC_DingDanOffsetAddr 160 // 订单长度修正地址 #define MXC_MultLengthOffsetAddr 170 // 多段补偿长度地址 #define MXC_MultOffsetAddr 175 // 多段补偿值地址 #define DISPLAY_DATA0 user_datas[121] #define DISPLAY_DATA1 user_datas[122] #define DISPLAY_DATA2 user_datas[123] #define DISPLAY_DATA3 user_datas[124] #define DISPLAY_DATA4 user_datas[125] #define DISPLAY_DATA5 user_datas[126] #define DISPLAY_DATA6 user_datas[127] #define DISPLAY_DATA7 user_datas[128] #define MXC_bStart M0000 #define MXC_bClear M0001 #define MXC_bXiaZhi M0002 //不用 #define MXC_bXiaChong M0003 #define MXC_bStop M0004 #define MXC_bLeftFenZhen M0005 #define MXC_bRightFenZhen M0006 #define MXC_bDotXiaChong M0007 #define MXC_bDotXiaChongDisplay M0008 #define MXC_bGouZhen M0009 #define MXC_bAddLength M0010 #define MXC_bDecLength M0011 #define MXC_bSetDCMode M0012 #define MXC_bChuiQi M0013 #define MXC_bChangeLength M0014 #define MXC_bClearAlarm M0015 #define MXC_bChangeGouZhenMode M0016 #define MXC_bChangeXiaZhiMode M0017 #define MXC_bChuDai M0018 #define MXC_bDingWei M0019 #define MXC_bNext M0020 #define MXC_bJiaoDao M0021 #define MXC_bSaveWorkData M0022 #define MXC_bAlarmStop M0023 #define MXC_bRunning M0024 #define MXC_bTestMotor M0025 #define MXC_GouZhenforward M0026 //勾针前移 #define MXC_GouZhenback M0027 //勾针后移 #define MXC_GouZhenlocation M0028 //勾针定位 #define MXC_StartFirst M0029 //上电第一次 #define MXC_ShaChe M0030 //刹车控制 #define MXC_Scan_Ma M0031 //扫码通知 #define MXC_DingDanJianGe M0032 //订单间隔隔工作 #define MXC_DingDanSet130 M0033 //订单组设定1通知 #define MXC_DingDanSet136 M0034 //订单组设定2通知 #define MXC_DingDanSet142 M0035 //订单组设定3通知 #define MXC_DingDanSet148 M0036 //订单组设定4通知 #define MXC_DingDanSet154 M0037 //订单组设定5通知 #define MXC_SET_GOUZHEN_LENGTH M0038 //勾针模式设置拉链长度 #define MXC_SET_XIACHONG_DISEN M0039 // #define MXC_cAutoStep cStepMByte #define MXC_cMotorStep cStepMByte1 #define MXC_cXiaChongStep cStepMByte2 #define MXC_cLeftFenZhenStep cStepMByte3 #define MXC_cRightFenZhenStep cStepMByte4 #define MXC_cJiaoDaoStep cStepMByte5 #define MXC_cChuiQiStep cStepMByte6 #define MXC_cDCPStep cStepMByte7 #define MXC_cGouZhenDWStep cStepMByte8 #define MXC_cAutoDelay cDelayTime1 #define MXC_cChuiQiDelay cDelayTime2 #define MXC_cXiaZhiDelay cDelayTime3 #define MXC_cGouZhenTime cDelayTime4 #define MXC_cBudaiCheckDelay cDelayTime5 #define MXC_cFenZhenLeftDelay cDelayTime6 #define MXC_cFenZhenRightDelay cDelayTime7 #define MXC_cKaDaiDelay cDelayTime8 #define MXC_cXiaChongDelay cDelayTime9 #define MXC_cDaoJuCheckDelay cDelayTime10 #define MXC_cMotorDelay cDelayTime11 #define MXC_cGouZhenDWDelay cDelayTime12 #define MXC_cGouZhenMotorDelay cDelayTime13 #define MXC_cAutoRunDelay cDelayTime14 #define MXC_START_IN M0384//X00 #define MXC_START_IN_UP (M0384 && !OLDM384)//(X00 && !OLDX00) #define MXC_STOP_IN M0385//X01 #define MXC_STOP_IN_UP (M0385 && !OLDM385)//(X01 && !OLDX01) #define MXC_ManXiaChong_UP 0// (X02 && !OLDX02) #define MXC_GouZhen_IN M0387 // X03 #define MXC_GouZhen_IN_UP (M0387 && !OLDM387)//(X03 && !OLDX03) #define MXC_Dec_IN M0388//X04 #define MXC_Dec_IN_DW (M0388 && !OLDM388)//(!X04 && OLDX04) #define MXC_KaDai_IN M0389//X05 #define MXC_KaDai_IN_UP (M0389 && !OLDM389)//(X05 && !OLDX05) #define MXC_LeftFenZhen_Origin_IN M0390//X06 #define MXC_LeftFenZhen_IN M0391//X07 #define MXC_XiaChong_IN M0392//X10 #define MXC_XiaChong_IN_UP (M0392 && !OLDM392)//(X10 && !OLDX10) #define MXC_RightFenZhen_Origin_IN M0393//X11 #define MXC_RighttFenZhen_IN M0394 //X12 #define MXC_DingChuPian_IN M0395 //X13 #define MXC_DingChuPian_IN_DW (!M0395 && OLDM395)//(!X13 && OLDX13) #define MXC_Zipper_IN M0396//X14 #define MXC_GouZhenforward_IN M0397// X15 //勾针前限位 #define MXC_GouZhenforward_UP (M0397 && !OLDM397)//(X15 && !OLDX15) #define MXC_GouZhenforward_DW (!M0397 && OLDM397)//(!X15 && OLDX15) #define MXC_GouZhenback_IN M0398//X16 //勾针后限位 #define MXC_GouZhenback_IN_UP (M0398 && !OLDM398)//(X16 && !OLDX16) #define MXC_GouZhenback_IN_DW (!M0398 && OLDM398)//(!X16 && OLDX16) #define MXC_SeBiao_IN M0399//X17 #define MXC_SeBiao_IN_UP (M0399 && !OLDM399)//(X17 && !OLDX17) #define MXC_SeBiao_IN_DW (!M0399 && OLDM399)//(!X17 && OLDX17) #define MXC_LIHE_VAVLE M0352//Y00 #define MXC_XC_SongZhou M0353//Y01 #define MXC_XC_ShaChe M0353//Y01 #define MXC_ChuiQi_VAVLE M0354//Y02 #define MXC_XiaZhi_VAVLE M0355//Y03 #define MXC_LeftFenZhen_VAVLE M0356//Y04 #define MXC_GouZhen_VAVLE M0357//Y05 #define MXC_RightFenZhen_VAVLE M0358//Y06 #define MXC_XiaChong_MOTOR M0359//Y07 #define MXC_GouzhenShaChe M0360//Y10 //勾针刹车 #define MXC_JiaoDao_OUT M0361//Y11 #define MXC_XiaZhi_MOTOR M0362//Y12 #define MXC_GouzhenMotor_DR M0363//Y13 //勾针伺服电机方向 #define MXC_TuoDaiSongZhou M0364//Y14 #define MXC_GuDingGouZhen M0365//Y15 #define MXC_ChaoSheng M0365//Y15 #define MXC_ChuDai_VAVLE M0345//Y15 #endif #endif