123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240 |
- #include "global.h"
- #include "Action.h"
- #if CHANG_SHENG_GEI_LI_MACHINE == 1
- extern unsigned char AllRunFlg;
- //初始化动作
- void GL_Mechine_InitAction(void)
- {
- switch (cMachineType)
- {
- case JIAO_YA_DIN_CUN:
- break;
- case CHU_CHI_JI:
- break;
- case JIAO_YA_CHU_CHI:
- {
- JYDC_InitAction();
- CCJ_InitAction();
- }
- break;
- case QIE_DUAN_JI:
- break;
- case CHUAN_TOU_QIE_DUAN_JI: //双头切断穿头
- //QDCT_InitAction();
- break;
- case MXC_NILONG: //免修齿
- MXC_InitAction();
- break;
- case JIN_SHU_DIN_CUN:
- break;
- case CHUAN_TOU_JI:
- break;
- case JIN_SHU_KLSZ_JI:
- break;
- case HE_LIAN_JI:
- break;
- case TIE_BU_JI: //贴布机
- //TBJ_InitAction();
- break;
- case FANG_KUAI_CHA_XIAO_JI:
- break;
- case GONG_ZHI_MA:
- break;
- case QIE_DUAN_NEWSTR:
- //QueDuan_NewStr_InitAction();
- break;
- case CHUAN_TOU_QIE_DUAN_JI_DAN://单头切断机
- //QDCTD_InitAction();
- break;
- default:
- break;
- }
- }
- void GL_Mechine_Action(void)
- {
- switch (cMachineType)
- {
- case CHUAN_TOU_QIE_DUAN_JI: //穿头切断机
- QDCT_Action();
- break;
- case MXC_NILONG: //免修齿
- //MXC_NiLongXiuCiJiAction();
- break;
- case QIE_DUAN_NEWSTR:
- //QueDuan_NewStr_Action();
- break;
- case TIE_BU_JI: //贴布机
- //TBJ_Action();
- break;
- case JIAO_YA_CHU_CHI:
- {
- JYDC_Action();
- CCJ_Action();
- }
- break;
- case CHUAN_TOU_QIE_DUAN_JI_DAN://单头切断机
- //QDCTD_Action();
- break;
- default:
- break;
- }
- }
- void GL_Mechine_Config(void)
- {
- switch (cMachineType)
- {
- case CHUAN_TOU_QIE_DUAN_JI: //穿头切断机
- //外部中断相关配置
- USE_ENCODE = 0;
- USE_X30_EXTI = 0;
- USE_X31_EXTI = 1;
- USE_X20_EXTI = 0;
- USE_TIMER_X30_EXTI = 0;
- USE_TIMER_X31_EXTI = 0;
- EXTI_TIMER_FREQ = 40000;
- FILTER_P = 2;
- FILTER_N = 2;
- X30EXTI_DIR = 0;
- X31EXTI_DIR = 0;
- X20EXTI_DIR = 0;
- //是否使用扩展
- USE_EXTEND_INOUTPUT = 1;
- USE_EXTEND_ALARM = 0;
- //脉冲配置
- SET_PULSE_TYPE = X_AXIS_PULSE_Y_DIR;
- SET_XDIR_TYPE = PULSE_OUTPUT_TYPE;
- SET_XDIR_CH = 99; //设置方向类型为“不使用”时,方向通道设置不起作用
- SET_YDIR_TYPE = NO_USE_TYPE;
- SET_YDIR_CH = 99;
- break;
- case CHUAN_TOU_QIE_DUAN_JI_DAN:
- //外部中断相关配置
- USE_ENCODE = 0;
- USE_X30_EXTI = 0;
- USE_X31_EXTI = 1;
- USE_X20_EXTI = 0;
- USE_TIMER_X30_EXTI = 0;
- USE_TIMER_X31_EXTI = 0;
- EXTI_TIMER_FREQ = 40000;
- FILTER_P = 2;
- FILTER_N = 2;
- X30EXTI_DIR = 0;
- X31EXTI_DIR = 0;
- X20EXTI_DIR = 0;
- //是否使用扩展
- USE_EXTEND_INOUTPUT = 0;
- USE_EXTEND_ALARM = 0;
- //脉冲配置
- SET_PULSE_TYPE = X_AXIS_PULSE_Y_DIR;
- SET_XDIR_TYPE = PULSE_OUTPUT_TYPE;
- SET_XDIR_CH = 99; //设置方向类型为“不使用”时,方向通道设置不起作用
- SET_YDIR_TYPE = NO_USE_TYPE;
- SET_YDIR_CH = 99;
- break;
- case MXC_NILONG: //免修齿
- //外部中断相关配置
- USE_ENCODE = 0;
- USE_X30_EXTI = 0;
- USE_X31_EXTI = 1;
- USE_X20_EXTI = 0;
- USE_TIMER_X30_EXTI = 0;
- USE_TIMER_X31_EXTI = 0;
- EXTI_TIMER_FREQ = 40000;
- FILTER_P = 10;
- FILTER_N = 5;
- X30EXTI_DIR = 0;
- X31EXTI_DIR = 0;
- X20EXTI_DIR = 0;
- //是否使用扩展
- USE_EXTEND_INOUTPUT = 0;
- USE_EXTEND_ALARM = 0;
- //脉冲配置
- SET_PULSE_TYPE = XY_AXIS_PULSE;
- SET_XDIR_TYPE = NO_USE_TYPE;
- SET_XDIR_CH = 99; //设置方向类型为“不使用”时,方向通道设置不起作用
- SET_YDIR_TYPE = Y_OUTPUT_TYPE;
- SET_YDIR_CH = 13; //Y13作为方向
- break;
- case QIE_DUAN_NEWSTR: //切断机开闭一体
- USE_ENCODE = 0;
- USE_X30_EXTI = 0;
- USE_X31_EXTI = 0;
- USE_X20_EXTI = 0;
- USE_TIMER_X30_EXTI = 0;
- USE_TIMER_X31_EXTI = 0;
- EXTI_TIMER_FREQ = 40000;
- FILTER_P = 10;
- FILTER_N = 5;
- X30EXTI_DIR = 0;
- X31EXTI_DIR = 0;
- X20EXTI_DIR = 0;
- USE_EXTEND_INOUTPUT = 0;
- USE_EXTEND_ALARM = 0;
- SET_PULSE_TYPE = X_AXIS_PULSE_Y_DIR;
- SET_XDIR_TYPE = PULSE_OUTPUT_TYPE;
- SET_XDIR_CH = 99; //设置方向类型为“不使用”时,方向通道设置不起作用
- SET_YDIR_TYPE = NO_USE_TYPE;
- SET_YDIR_CH = 99;
- break;
- case TIE_BU_JI: //贴布机
- //外部中断相关配置
- USE_ENCODE = 0;
- USE_X30_EXTI = 0;
- USE_X31_EXTI = 0;
- USE_X20_EXTI = 0;
- USE_TIMER_X30_EXTI = 0;
- USE_TIMER_X31_EXTI = 0;
- EXTI_TIMER_FREQ = 40000;
- FILTER_P = 10;
- FILTER_N = 5;
- X30EXTI_DIR = 0;
- X31EXTI_DIR = 0;
- X20EXTI_DIR = 0;
- //是否使用扩展
- USE_EXTEND_INOUTPUT = 0;
- USE_EXTEND_ALARM = 0;
- //脉冲配置
- SET_PULSE_TYPE = X_AXIS_PULSE_Y_ON; //X轴脉冲,Y轴当使能
- SET_XDIR_TYPE = Y_OUTPUT_TYPE; //Y0当方向通道
- SET_XDIR_CH = 0; //Y0当方向通道
- SET_YDIR_TYPE = NO_USE_TYPE; //无Y轴电机,故不使用Y轴方向通道
- SET_YDIR_CH = 99; //Y13作为方向
- break;
- case JIAO_YA_CHU_CHI: //贴布机
- //外部中断相关配置
- USE_ENCODE = 0;
- USE_X30_EXTI = 1;
- USE_X31_EXTI = 0;
- USE_X20_EXTI = 1;
- USE_TIMER_X30_EXTI = 0;
- USE_TIMER_X31_EXTI = 0;
- EXTI_TIMER_FREQ = 40000;
- FILTER_P = 10;
- FILTER_N = 5;
- X30EXTI_DIR = 0;
- X31EXTI_DIR = 0;
- X20EXTI_DIR = 0;
- //是否使用扩展
- USE_EXTEND_INOUTPUT = 0;
- USE_EXTEND_ALARM = 0;
- //脉冲配置
- SET_PULSE_TYPE = XY_AXIS_PULSE; //X轴脉冲,Y轴当使能
- SET_XDIR_TYPE = NO_USE_TYPE; //Y0当方向通道
- SET_XDIR_CH = 99; //Y0当方向通道
- SET_YDIR_TYPE = NO_USE_TYPE; //无Y轴电机,故不使用Y轴方向通道
- SET_YDIR_CH = 99; //Y13作为方向
- break;
- default:
- SET_PULSE_TYPE = XY_AXIS_PULSE;
- break;
- }
- }
- #endif
|