#include "global.h" #include "Action.h" #if FJ_YING_XING_MACHINE == 1 //初始化动作 void YX_Mechine_InitAction(void) { switch(cMachineType) { case MXC_NILONG: //免修齿 MXC_InitAction(); break; case BK_QIE_DUAN_JI: BK_QueDuan_InitAction(); break; case KK_QIE_DUAN_JI: KK_QueDuan_InitAction(); break; default: break; } } void YX_Mechine_Action(void) { switch(cMachineType) { case CHUAN_TOU_QIE_DUAN_JI: //穿头切断机 // QDCT_Action(); break; case QIE_DUAN_NEWSTR: // QueDuan_NewStr_Action(); break; case JIN_SHU_DIN_CUN: // JSDC_Action(); break; case BK_QIE_DUAN_JI: BK_QueDuan_Action(); break; case MXC_NILONG: //免修齿 MXC_NiLongXiuCiJiAction(); break; case KK_QIE_DUAN_JI: KK_QueDuan_Action(); break; default: break; } } void YX_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=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=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 BK_QIE_DUAN_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=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 KK_QIE_DUAN_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=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; default: SET_PULSE_TYPE = XY_AXIS_PULSE; break; } } #endif