#if JIN_HONG_MACHINE==1 extern void MXC_InitAction(void); extern void MXC_Action(void); extern void MXC_ExtiAcitionX20(void); extern void MXC_SBCHECK_PROC(void); #define MXC_ALARM_ADDR 100 #define MXC_ZIPPER_LENGTH_ADDR 17 #define MXC_DC_TOTAL_ADDR 76 #define MXC_DC_PROSPEED_ADDR 78 #define MXC_XC_TOTAL_ADDR 106 #define MXC_XC_PROSPEED_ADDR 108 #define MXC_XC_ZIPPER_LENGTH_ADDR 34 #define XC_MOTOR_EN 1 #define XC_MOTOR_DISEN 0 #define DC_Motor_EN 0 #define DC_Motor_DISEN 1 #define XZ_Motor_EN 0 #define XZ_Motor_DISEN 1 #define MXC_DC_Reverse_EN 0 #define MXC_XC_DIR_P 1 #define MXC_DC_DIR_P 1 #define MXC_DC_DIR_N 0 #define MXC_DC_GZ_MODE 0 #define MXC_DC_SF_MODE 1 #define MXC_DC_SB_MODE 2 #define MXC_DC_MOTOR_BMQ_MODE 1 #define MXC_DC_MOTOR_SF_MODE 2 #define MXC_NO_ALARM 0 #define MXC_TOTAL_ALARM 1 //定寸生产到达预设数量 #define MXC_XIA_CHONG_ALARM 2 // 下冲异常 #define MXC_KA_DAI_ALARM 3 //卡带感应异常 #define MXC_XC_ALARM 4 //下冲感应异常 #define MXC_NO_ZIPPER_ALARM 5 //无拉带 #define MXC_XUANCHI_IN_ALARM 6 #define MXC_NO_GOUZHEN_ALARM 7 //勾针 #define MXC_LFZ_ORIGIN_ALARM 8 #define MXC_LFZ_LIMIT_ALARM 9 #define MXC_RFZ_ORIGIN_ALARM 10 #define MXC_RFZ_LIMIT_ALARM 11 #define MXC_LONG_TIME_NO_ZIPPER_ALARM 12 //长时间没有感应到拉链 #define MXC_START_RFZ_ORIGIN_ALARM 13//右分针原位警告,无法启动 #define MXC_DC_SONGDAI_ALARM 14//送带过多异常,已关闭送带开关,请重新打开 #define MXC_NO_SEBIAO_ALARM 15//长时间检测不到色标 #define MXC_ZIPPER_LENGTH_ALARM 16//拉链长度设置小于钩针最短距离 #define MXC_ZIPPER_SB_LENGTH_ALARM 17//拉链长度设置小于色标定位位置 #define MXC_MOTOR_ALALRM_TIME 20000 #define MXC_ERRORTIME 3000 //出错时间 #define MXC_XIACHONG_EEROR_TIME 3000 #define MXC_FENZHEN_EEROR_TIME 1000 #define MXC_MXC_PARAM_DAILUN_LENGTH user_datas[1] //定寸带轮转一圈周长 #define MXC_MXC_PARAM_CYCLE_PULSE user_datas[2] //定寸带轮转一圈脉冲 #define MXC_BM_LENGTH user_datas[3] //编码器转一圈周长 #define MXC_BM_CYCLE_PULSE user_datas[4] //编码器转一圈脉冲 #define MXC_PARAM_BUDAI_ALARM_TIME (user_datas[7]*10)//缺布带最大容错时间 #define MXC_DC_PARAM_MUL_SPEED user_datas[8] //定寸手动最高速度 #define MXC_DC_PARAM_SET_SPEED user_datas[9] //定寸最高速度 #define MXC_DC_PARAM_START_SPEED user_datas[10] //定寸开始速度 #define MXC_DC_PARAM_LOW_SPEED user_datas[11] //定寸慢速度 //#define MXC_DC_PARAM_ACC_SPEED user_datas[12] //定寸加速时间 //#define MXC_DC_PARAM_DEC_SPEED user_datas[13] //定寸减速时间 #define MXC_DC_PARAM_LOWSPEED_LENGTH user_datas[14] //定寸慢速长度 #define MXC_DC_PARAM_SB_OFFSET_SPEED user_datas[15] //色标慢速度 #define MXC_DC_PARAM_SEBIAO_DW_LENGTH user_datas[16] //色标定位长度 #define MXC_SET_REVISE_ZIPPER_LENGTH user_datas[17] //定寸拉链修正长度 #define MXC_DEC_MODE 1//user_datas[18] //钩针减速模式 #define MXC_PARAM_AUTO_CHECK_MODE user_datas[19] //测长模式 #define MXC_PARAM_FIRST_SPEED user_datas[20] //钩针第一条速度 #define MXC_PARAM_GZ_DELAY (user_datas[21]*10) //延时上钩针 #define MXC_PARAM_GZ_RESET_MODE user_datas[22] //钩针复位方式 0 自动 1数控 #define MXC_PARAM_GZ_LENGTH user_datas[23] //数控提前上钩针 #define MXC_DC_KongWei_Length user_datas[24] //定寸空位长度 #define MXC_PARAM_SB_HIGH_SPEED user_datas[25] //色标最高速度 #define MXC_PARAM_SEBIAO_TQ_LENGTH user_datas[26] //提前开启色标长度 #define MXC_PARAM_SEBIAO_ERROR_LENGTH user_datas[27] //色标容错长度 #define MXC_DC_MODE user_datas[28] //定寸模式 0钩针定寸 1伺服定寸 2色标 #define MXC_PARAM_SEBIAO_LOWSPEED_LENGTH user_datas[29] //色标慢速长度 #define MXC_PARAM_DELAY_CHUIQI_TIME (user_datas[31]*10) //延时吹气 #define MXC_PARAM_CHUIQI_TIME (user_datas[32]*10) //吹气时间 #define MXC_PARAM_DDBH_delay (user_datas[33]*10) //顶刀保护延时 #define MXC_SET_ZIPPER_LENGTH (user_datas[34] | user_datas[35] << 16) //定寸拉链长度 #define MXC_PARAM_DAOKOU_LENGTH user_datas[36] //定寸刀口长度 //#define MXC_PARAM_GOUZHEN_MIN_LEN user_datas[37] //钩针定寸最短长度 #define MXC_PARAM_DELAY_XC (user_datas[41]*10) #define MXC_XC_Stop_Delay (user_datas[42]*10) #define MXC_PARAM_ShaChe_Delay (user_datas[43]*10) #define MXC_PARAM_ShaChe_TIME (user_datas[44]*10) #define MXC_RightFZ_Delay (user_datas[45]*10) #define MXC_LeftFZ_Delay (user_datas[46]*10) #define MXC_SET_TOTAL (user_datas[47] | (user_datas[48] << 16)) #define MXC_DDBH_TIME (user_datas[49]*10) #define MXC_PARAM_SongDai_Delay (user_datas[50]*10) #define MXC_PARAM_SD_Pretect_TIME (user_datas[52]*10) #define MXC_DC_RightFZ_AGAIN_TIME (user_datas[56]*10) #define MXC_DC_LeftFZ_AGAIN_TIME (user_datas[57]*10) #define MXC_DC_XC_MOTOR_HIGH_SPEED user_datas[61] #define MXC_DC_XC_MOTOR_LOW_SPEED user_datas[62] #define MXC_DC_XC_MOTOR_GO_LENGTH user_datas[65]//感应再走距离(脉冲) #define MXC_DC_XC_MOTOR_LOW_LENGTH user_datas[66] #define MXC_DC_XC_MODE user_datas[67] #define MXC_DC_XC_MOTOR_LENTH user_datas[68] //下冲电机一圈长度 #define MXC_DC_XC_MOTOR_CYCLE_PULSE user_datas[69] //下冲电机一圈脉冲 #define MXC_DC_XC_CHUIQI_PULSE user_datas[70]//转至多少脉冲时吹气 #define MXC_DC_XC_DINDAO_PULSE user_datas[71]//转至多少脉冲时顶刀 //#define MXC_PARAM_SBDW_LOW_SPEED user_datas[72] //感应模式定寸最高速度 //#define MXC_PARAM_SBDW_LOW_LENGTH user_datas[73] //感应模式定寸慢速度 #define MXC_PARAM_SB_LOW_SPEED user_datas[74] //色标慢速度 #define MXC_PARAM_CYCLE_TIME user_datas[80] //色标慢速度 #define MXC_PARAM_LENGTH_CMP 0;//user_datas[81] //长度修正补偿 #define MXC_PARAM_First_CMP user_datas[82] //第一条修正补偿 #define MXC_PARAM_SK_HIGH_SPEED user_datas[83] //数控高速 #define MXC_PARAM_SK_SLOW_SPEED user_datas[84] //数控低速 #define MXC_PARAM_SK_SLOW_LENGTH user_datas[85] //数控低速长度 #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_DC_cAutoStep cStepMByte #define MXC_DC_cMotorStep cStepMByte2 #define MXC_cXiaChongStep cStepMByte4 #define MXC_cRightFZStep cStepMByte5 #define MXC_cLeftFZStep cStepMByte6 #define MXC_cChuiQiStep cStepMByte7 #define MXC_cShaCheStep cStepMByte8 #define MXC_cDDBH_Step cStepMByte10 #define MXC_cBUJIN_XC_Step cStepMByte11 #define MXC_cJiaoDaoStep cStepMByte12 #define MXC_DC_cAutoDelay cDelayTime1 #define MXC_cChuiQiDelay cDelayTime2 #define MXC_cBudaiCheckDelay cDelayTime3 #define MXC_cFenZhenLeftDelay cDelayTime4 #define MXC_cKaDaiDelay cDelayTime5 #define MXC_cXiaChongDelay cDelayTime6 #define MXC_DC_cMotorDelay cDelayTime7 #define MXC_cShaCheDelay cDelayTime8 #define MXC_cRightFZ_Delay cDelayTime9 #define MXC_cLeftFZ_Delay cDelayTime10 #define MXC_cDDBHDelay cDelayTime11 #define MXC_cSongDaiDelay cDelayTime12 #define MXC_SongDai_LongTime cDelayTime13 #define MXC_BUJIN_XC_Delay cDelayTime14 #define MXC_cGouZhenTime cDelayTime15 #define MXC_cJiaoDaoDelay cDelayTime16 //参数定义 //8位变量 #define MXC_DC_SingOneFlag cCharBuff1 #define MXC_XZ_SingOneFlag cCharBuff2 #define MXC_STOP_IN_FLAG cCharBuff3 #define MXC_STOP_IN_FLAG_OLD cCharBuff4 #define MXC_STOP_FILTER cCharBuff5 #define MXC_cLFengTimer cCharBuff6 #define MXC_cRFengTimer cCharBuff7 #define MXC_DC_Single_Stop cCharBuff8 //周期停止按钮置一,做完该条停止 #define MXC_XZ_Single_Stop cCharBuff9 #define MXC_Zipper_cnt cCharBuff10 #define cCheckLengthOk cCharBuff11 #define cSeBiaoOk cCharBuff12 #define cSeBiaoEn cCharBuff13 //16位变量 #define MXC_DC_SongDai_Delay cUShort16Buff1 #define MXC_MOTOR_DATA_Num cUShort16Buff2 #define MXC_ENCODE_DATA_Num cUShort16Buff3 #define MXC_ENCODE_FENZHEN_Lenth cUShort16Buff4 #define MXC_DC_cycle_time cUShort16Buff5 #define MXC_XZ_cycle_time cUShort16Buff6 #define MXC_DC_Encode_fz_change cUShort16Buff7 //32位无符号变量 #define MXC_CRUKONGWEILENGTH cUDword32Buff1 #define MXC_SaveLength cUDword32Buff2 #define MXC_ENcode_Cul cUDword32Buff3 #define MXC_DC_Encode_fz_cal cUDword32Buff4 #define zipper_length_buff cUDword32Buff5 #define MXC_SB_SaveLength cUDword32Buff6 #define MXC_SB_ENCODE_MIN cUDword32Buff7 #define MCX_SB_ENCODE_END cUDword32Buff8 //32位有符号变量 #define dwEnRealPos cDword32Buff1 #define MCX_XPOS_BUFF cDword32Buff2 #define MCX_SB_EN_LENGTH1 cDword32Buff3 #define MCX_SB_EN_LENGTH2 cDword32Buff4 //输入 #define MXC_START_IN M0384//X01 启动 #define MXC_START_IN_UP (M0384 && !OLDM384) #define MXC_STOP_IN M0385//X02 停止 #define MXC_STOP_IN_UP (M0385 && !OLDM385) #define MXC_ManXiaChong_UP (M0386 && !OLDM386)// (X02 && !OLDX02)手动下冲 #define MXC_GouZhen_IN M0387//X03 钩针到位感应 #define MXC_GouZhen_IN_UP (M0387 && !OLDM387) #define MXC_JianSu_IN M0388//X04 减速信号 #define MXC_JianSu_IN_DW (!M0388 && OLDM388) #define MXC_KaDai_IN M0389//X05 卡带信号 #define MXC_KaDai_IN_UP (M0389 && !OLDM389) #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)//(X5 && !OLDX5) #define MXC_XiaChong_IN_DW (!M0392 && OLDM392)//(X5 && !OLDX5) #define MXC_RightFenZhen_Origin_IN M0393//X11 右分针原位 #define MXC_RighttFenZhen_IN M0394//X12 右分针到位 #define MXC_SongDai_IN M0395//X13 送带到位感应 #define MXC_Zipper_IN M0396//X14 有链信号 #define MXC_SeBiao_IN M0400//X20 //输出IO #define MXC_GouZhen_VAVLE M0304//Y00 钩针 #define MXC_XiaChong_MOTOR M0305//Y01 下冲电机 #define MXC_DingDao_BaoHu_VAVLE M0306//Y02 顶刀保护 #define MXC_ChuiQi_VAVLE M0307//Y03 定寸吹气 #define MXC_LeftFenZhen_VAVLE M0308//Y04 左分针阀 #define MXC_ALARM_OUT M0309//Y05 报警 #define MXC_SongDai_MOTOR M0310//Y06 送带 #define MXC_RightFenZhen_VAVLE M0311//Y07 右分针 #define MXC_XC_ShaChe M0312//Y10 下冲电机刹车 #define MXC_SeBiao_JiaoDao M0313//Y11 色标教导 #define MXC_Clear_Servo_Pos M0314//Y12 伺服位置偏差 #define MXC_DC_bStart M0001 #define MXC_bClear M0003 #define MXC_bStop M0002 #define MXC_DC_bStart_Single M0005 //单次 #define MXC_bDingDao_Baohu M0006 //顶刀保护 #define MXC_bChuiQi M0007 //吹气 #define MXC_bDCTD_P M0008 //定寸拖带电机正转 #define MXC_bLeftFenZhen M0009 //左分针 #define MXC_bRightFenZhen M0010 //右分针 #define MXC_bChangeLength M0011 //长度改变 #define MXC_bDotXiaChong M0012 //点动下冲 #define MXC_bAddLength M0013 //加尺寸 #define MXC_bDecLength M0014 //减尺寸 #define MXC_DC_bAlarmStop M0015 //警告停止 #define MXC_DC_bRunning M0016 //运行标志位 #define MXC_bSongDai M0017 //送带 #define MXC_PARAM_SongDai_Switch M0018 //送带开关 #define MXC_bLowLenChange M0019 //慢速长度变化 #define MXC_DATA_Clean M0020 //定寸数据清空 #define MXC_bSetDCMode M0021 //设置定寸模式 #define MXC_bSeBiaoJiaoDao M0022 //色标教导 #define MXC_bXiaChong M0023 //下冲 #define MXC_bGouZhen M0024 //钩针 #define MXC_bXCDJ_P M0025 //下冲电机正转(调整) #define MXC_bSeBiao_Check M0026 //第一条色标确认窗口 #define MXC_bSeBiao_CheckOK M0027 //第一条色标确认正常 #define MXC_bSeBiao_CheckStop M0028 //第一条色标确认不正常 #endif