123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286 |
- #include "global.h"
- #include "Action.h"
- #if JU_XING_MACHINE == 1
- //初始化动作
- void JX_Mechine_InitAction(void)
- {
- switch(cMachineType)
- {
- case JIAO_YA_DIN_CUN:
- break;
- case CHU_CHI_JI:
- break;
- case JIAO_YA_CHU_CHI:
- break;
- case BK_QIE_DUAN_JI:
- BK_QueDuan_InitAction();
- 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 KK_QIE_DUAN_JI:
- KK_QueDuan_InitAction();
- break;
- case CS_CHUAN_TOU_JI:
- // CS_ChuanTou_InitAction();
- break;
- case SK_QIE_DUAN_JI:
- SK_QueDuan_InitAction();
- break;
-
- default:
- break;
- }
- }
- void JX_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 BK_QIE_DUAN_JI:
- BK_QueDuan_Action();
- break;
- case KK_QIE_DUAN_JI:
- KK_QueDuan_Action();
- break;
- case CS_CHUAN_TOU_JI:
- // CS_ChuanTou_Action();
- break;
- case TIE_BU_JI:
- TBJ_Action();
- break;
- case SK_QIE_DUAN_JI:
- SK_QueDuan_Action();
- break;
- default:
- break;
- }
- }
- void JX_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 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=2;
- FILTER_N=2;
- 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;
- case CS_CHUAN_TOU_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_ON;
- 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_DIR; //X轴脉冲,Y轴控制方向
- SET_XDIR_TYPE = PULSE_OUTPUT_TYPE; //Y轴控制方向,故不使用X方向通道
- SET_XDIR_CH = 99;//设置方向类型为“不使用”时,方向通道设置不起作用
- SET_YDIR_TYPE = NO_USE_TYPE; //无Y轴电机,故不使用Y轴方向通道
- SET_YDIR_CH = 99;//Y13作为方向
- break;
- case SK_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
|