#ifndef FJQUEDUAN_CHUANTOU_H #define FJQUEDUAN_CHUANTOU_H #if FU_JIAN_MACHINE #define QDCT_TOTAL_ADDR 8 #define QDCT_NOWTOTAL_ADDR 10 #define QDCT_SETTOTAL_ADDR 12 #define QDCT_ALARM_ADDR 15 #define QDCT_PARAM_CYCLE_PULSE user_datas[0] #define QDCT_PARAM_CYCLE_LENGTH user_datas[1] #define QDCT_PARAM_SET_ZIPPER_LENGTH (user_datas[16] | user_datas[17] << 16) #define QDCT_PARAM_PUTIN_LENGTH user_datas[18] #define QDCT_PARAM_JJGO_SPEED user_datas[20] #define QDCT_PARAM_JJFZ_LENGTH user_datas[21] #define QDCT_PARAM_JJBACK_SPEED user_datas[22] #define QDCT_PARAM_PUTIN_SPEED user_datas[23] #define QDCT_PARAM_CUT_BACK_LENGTH user_datas[24] #define QDCT_PARAM_SJZ_LENGTH user_datas[25] #define QDCT_PARAM_CUT_DELAY (user_datas[26]*10) #define QDCT_PARAM_CUTBACK_DELAY (user_datas[27]*10) #define QDCT_PARAM_CUTBACK_SPEED user_datas[28] #define QDCT_PARAM_KL_TIME_SPEED (user_datas[30]*10) #define QDCT_PARAM_FZ_DELAY (user_datas[34]*10) #define QDCT_PARAM_ZD_WORKNUM user_datas[36] #define QDCT_PARAM_ZD_WORK_TIME (user_datas[37]*10) #define QDCT_PARAM_JD_DELAY (user_datas[41]*10) #define QDCT_PARAM_CYCLE_DELAY (user_datas[43]*10) #define QDCT_PARAM_FIRST_SPEED user_datas[44] #define QDCT_PARAM_GO_LOWSPEED_LENGTH user_datas[45] #define QDCT_PARAM_CZ_CHECK_DELAY (user_datas[46]*10) #define QDCT_PARAM_LOCK_TIME (user_datas[47]*10) #define QDCT_PARAM_ON_BACK_LENGTH user_datas[50] #define QDCT_PARAM_KL_DELAY user_datas[52] #define QDCT_ZD_MODE user_datas[42] #define QDCT_ZFC_MODE user_datas[51] typedef __packed struct { unsigned short XCyclePulse; //0 转一圈脉冲数 unsigned short XCycleDist; //1 转一圈拖带多长 unsigned short XStopSpeed; //2 停止速度 unsigned short XStartSpeed; //3 启动速度 unsigned short XMaxSpeed; //4 最大速度 unsigned short XMinSpeed; //5 最小速度 unsigned short XAccTime; //6 加速时间 unsigned short XDecTime; //7 减速时间 unsigned long Total; //8 unsigned long NowTotal; //10 unsigned long SetTotal; //12 unsigned short Speed; //14 unsigned short AlarmCode; //15 unsigned long ZipperLength;//16 拉链长度 unsigned short PutInLength;//18 穿拉头低速长度 unsigned short FZSpeed; //19 反转速度 unsigned short JJGoSpeed; //20夹具前进速度 unsigned short FZLength; //21 反转长度 unsigned short LDBackSpeed; //22拉带后退速度 unsigned short LDBackLowSpeed; //23穿拉头低速 unsigned short CutBackLength; //24切断后退总长度 unsigned short SJZdist; //25 松夹子的位置 unsigned short CutDelay; //26 unsigned short CutBackDelay; //27切断持续时间 unsigned short CutBackSpeed; //28切断之后后拉的速度 unsigned short DelayReBack; //29 unsigned short KaiLianTime; //30开链持续时间 unsigned short BackLowSpeedLength; //31 后拉低速长度 unsigned short StopTime; //32 unsigned short HighSpeedLength;//33 穿入前高速长度 unsigned short FZDelay; //34 延时反转 unsigned short TableMotorWorkTime;//35 unsigned short ZDWorkNum; //36振动盘启动个数 unsigned short ZDWorkDelay; //37振动盘工作时间 long XRealPos; //38 unsigned short DecLength; //40 前进减速长度 unsigned short DelayJD; //41 延时夹带 unsigned short ZhenDongMode; //42 振动盘工作模式 unsigned short CycleDelay; //43循环工作时间间隔 unsigned short LowSpeed; //44前进慢速 unsigned short LowSpeedLength;//45前进慢速长度 unsigned short CZDelayCheck;//46延时检测触针信号 unsigned short LockZipperTime;//47锁拉头所需时间 unsigned short UnLockDist; //48提前解锁拉头位置 unsigned short SecondMoveLength;//49二次前进长度 unsigned short FirstBackLength;//50压感应后退长度 unsigned short MachineMode; //51正穿反穿模式选择 unsigned short DelayKL; //52延时开链 } SystemParam_str; typedef __packed struct { long DispLay[10]; } TestData_str; #define START_IN X00 #define START_IN_UP (X00 && !OLDX00) #define STOP_IN X01 #define STOP_IN_UP (X01 && !OLDX01) #define QDCT_NO_ZIPPER_CHECK_IN X02 #define QDCT_JLT_IN X03 #define QDCT_KA_DAI_IN X04 #define QDCT_GO_LIMIT_IN X05 #define QDCT_GO_DEC_IN X06 #define QDCT_BACK_LIMIT_IN X07 #define QDCT_LTCZ_IN X10 #define QDCT_GL_LIMIT_IN X12 #define GL_ORIGIN_IN X11 #define SL_ARRIVE_IN X13 #define SQ_ORIGIN_IN X15 #define XQ_ARRIVE_IN X17 #define XQ_ORIGIN_IN X20 #define SM_ARRIVE_IN X21 #define SM_ORIGIN_IN X22 #define LATOU_IN X23 #define JZ_LEFT_IN X24 #define JZ_RIGHT_IN X25 #define SQ_OUT Y00 #define XQ_OUT Y01 #define SM_OUT Y02 #define JZ_OUT Y03 #define SL_OUT Y04 #define JLT_OUT Y05 #define GL_OUT Y06 #define KL_OUT Y07 #define ZDP_OUT Y13 #define SLT_OUT Y17 #define bStart M00 #define bRunning M01 #define bOnceStart M02 #define bAlarmStop M03 #define bClearTotal M04 #define bClerNowTotal M05 #define bQianDianDW M06 #define bGeiLT M07 #define bZhuangLiao M08 #define bQieDuan M09 #define bNext M11 #define bStop M12 #define bTuiLT M13 #define bZuangLT M14 #define bHeMo M15 #define bChuanLT M16 #define bSaveWorkState M17 #define bWorkMode !M18 #define XIA_QIE_ERROR_TIME 3000 #define SONG_LIAO_ERROR_TIME 3000 #define XIA_MO_DW_ERROR_TIME 3000 #define SUO_JIN_ERROR_TIME 3000 #define JIA_DAI_ERROR_TIME 3000 #define ZLT_ERROR_TIME 3000 //M50开始为手动IO extern SystemParam_str *SystemParam; extern TestData_str *TestData; extern void DelayYJ(void); extern void InitActionYJ(void); extern void QueDuan_ChuanTou_ActionYJ(void); #endif #endif