YXAction.c 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. #include "global.h"
  2. #include "Action.h"
  3. #if FJ_YING_XING_MACHINE == 1
  4. //初始化动作
  5. void YX_Mechine_InitAction(void)
  6. {
  7. switch(cMachineType)
  8. {
  9. case MXC_NILONG: //免修齿
  10. MXC_InitAction();
  11. break;
  12. case BK_QIE_DUAN_JI:
  13. BK_QueDuan_InitAction();
  14. break;
  15. case KK_QIE_DUAN_JI:
  16. KK_QueDuan_InitAction();
  17. break;
  18. default:
  19. break;
  20. }
  21. }
  22. void YX_Mechine_Action(void)
  23. {
  24. switch(cMachineType)
  25. {
  26. case CHUAN_TOU_QIE_DUAN_JI: //穿头切断机
  27. // QDCT_Action();
  28. break;
  29. case QIE_DUAN_NEWSTR:
  30. // QueDuan_NewStr_Action();
  31. break;
  32. case JIN_SHU_DIN_CUN:
  33. // JSDC_Action();
  34. break;
  35. case BK_QIE_DUAN_JI:
  36. BK_QueDuan_Action();
  37. break;
  38. case MXC_NILONG: //免修齿
  39. MXC_NiLongXiuCiJiAction();
  40. break;
  41. case KK_QIE_DUAN_JI:
  42. KK_QueDuan_Action();
  43. break;
  44. default:
  45. break;
  46. }
  47. }
  48. void YX_Mechine_Config(void)
  49. {
  50. switch(cMachineType)
  51. {
  52. case CHUAN_TOU_QIE_DUAN_JI: //穿头切断机
  53. //外部中断相关配置
  54. USE_ENCODE=0;
  55. USE_X30_EXTI=0;
  56. USE_X31_EXTI=1;
  57. USE_X20_EXTI=0;
  58. USE_TIMER_X30_EXTI=0;
  59. USE_TIMER_X31_EXTI=0;
  60. EXTI_TIMER_FREQ=40000;
  61. FILTER_P=2;
  62. FILTER_N=2;
  63. X30EXTI_DIR=0;
  64. X31EXTI_DIR=0;
  65. X20EXTI_DIR=0;
  66. //是否使用扩展
  67. USE_EXTEND_INOUTPUT=0;
  68. USE_EXTEND_ALARM=0;
  69. //脉冲配置
  70. SET_PULSE_TYPE = X_AXIS_PULSE_Y_DIR;
  71. SET_XDIR_TYPE = PULSE_OUTPUT_TYPE;
  72. SET_XDIR_CH = 99;//设置方向类型为“不使用”时,方向通道设置不起作用
  73. SET_YDIR_TYPE = NO_USE_TYPE;
  74. SET_YDIR_CH = 99;
  75. break;
  76. case MXC_NILONG: //免修齿
  77. //外部中断相关配置
  78. USE_ENCODE = 0;
  79. USE_X30_EXTI = 0;
  80. USE_X31_EXTI = 1;
  81. USE_X20_EXTI = 0;
  82. USE_TIMER_X30_EXTI = 0;
  83. USE_TIMER_X31_EXTI = 0;
  84. EXTI_TIMER_FREQ = 40000;
  85. FILTER_P = 10;
  86. FILTER_N = 5;
  87. X30EXTI_DIR = 0;
  88. X31EXTI_DIR = 0;
  89. X20EXTI_DIR = 0;
  90. //是否使用扩展
  91. USE_EXTEND_INOUTPUT = 0;
  92. USE_EXTEND_ALARM = 0;
  93. //脉冲配置
  94. SET_PULSE_TYPE = XY_AXIS_PULSE;
  95. SET_XDIR_TYPE = NO_USE_TYPE;
  96. SET_XDIR_CH = 99; //设置方向类型为“不使用”时,方向通道设置不起作用
  97. SET_YDIR_TYPE = Y_OUTPUT_TYPE;
  98. SET_YDIR_CH = 13; //Y13作为方向
  99. break;
  100. case QIE_DUAN_NEWSTR: //切断机开闭一体
  101. USE_ENCODE=0;
  102. USE_X30_EXTI=0;
  103. USE_X31_EXTI=0;
  104. USE_X20_EXTI=0;
  105. USE_TIMER_X30_EXTI=0;
  106. USE_TIMER_X31_EXTI=0;
  107. EXTI_TIMER_FREQ=40000;
  108. FILTER_P=2;
  109. FILTER_N=2;
  110. X30EXTI_DIR=0;
  111. X31EXTI_DIR=0;
  112. X20EXTI_DIR=0;
  113. USE_EXTEND_INOUTPUT=0;
  114. USE_EXTEND_ALARM=0;
  115. SET_PULSE_TYPE = X_AXIS_PULSE_Y_DIR;
  116. SET_XDIR_TYPE = PULSE_OUTPUT_TYPE;
  117. SET_XDIR_CH = 99;//设置方向类型为“不使用”时,方向通道设置不起作用
  118. SET_YDIR_TYPE = NO_USE_TYPE;
  119. SET_YDIR_CH = 99;
  120. break;
  121. case BK_QIE_DUAN_JI:
  122. USE_ENCODE=0;
  123. USE_X30_EXTI=0;
  124. USE_X31_EXTI=0;
  125. USE_X20_EXTI=0;
  126. USE_TIMER_X30_EXTI=0;
  127. USE_TIMER_X31_EXTI=0;
  128. EXTI_TIMER_FREQ=40000;
  129. FILTER_P=2;
  130. FILTER_N=2;
  131. X30EXTI_DIR=0;
  132. X31EXTI_DIR=0;
  133. X20EXTI_DIR=0;
  134. USE_EXTEND_INOUTPUT=0;
  135. USE_EXTEND_ALARM=0;
  136. SET_PULSE_TYPE = X_AXIS_PULSE_Y_DIR;
  137. SET_XDIR_TYPE = PULSE_OUTPUT_TYPE;
  138. SET_XDIR_CH = 99;//设置方向类型为“不使用”时,方向通道设置不起作用
  139. SET_YDIR_TYPE = NO_USE_TYPE;
  140. SET_YDIR_CH = 99;
  141. break;
  142. case KK_QIE_DUAN_JI:
  143. USE_ENCODE=0;
  144. USE_X30_EXTI=0;
  145. USE_X31_EXTI=0;
  146. USE_X20_EXTI=0;
  147. USE_TIMER_X30_EXTI=0;
  148. USE_TIMER_X31_EXTI=0;
  149. EXTI_TIMER_FREQ=40000;
  150. FILTER_P=2;
  151. FILTER_N=2;
  152. X30EXTI_DIR=0;
  153. X31EXTI_DIR=0;
  154. X20EXTI_DIR=0;
  155. USE_EXTEND_INOUTPUT=0;
  156. USE_EXTEND_ALARM=0;
  157. SET_PULSE_TYPE = X_AXIS_PULSE_Y_DIR;
  158. SET_XDIR_TYPE = PULSE_OUTPUT_TYPE;
  159. SET_XDIR_CH = 99;//设置方向类型为“不使用”时,方向通道设置不起作用
  160. SET_YDIR_TYPE = NO_USE_TYPE;
  161. SET_YDIR_CH = 99;
  162. break;
  163. default:
  164. SET_PULSE_TYPE = XY_AXIS_PULSE;
  165. break;
  166. }
  167. }
  168. #endif