123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185 |
- #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
|