JXAction.c 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. #include "global.h"
  2. #include "Action.h"
  3. #if JU_XING_MACHINE == 1
  4. //初始化动作
  5. void JX_Mechine_InitAction(void)
  6. {
  7. switch(cMachineType)
  8. {
  9. case JIAO_YA_DIN_CUN:
  10. break;
  11. case CHU_CHI_JI:
  12. break;
  13. case JIAO_YA_CHU_CHI:
  14. break;
  15. case BK_QIE_DUAN_JI:
  16. BK_QueDuan_InitAction();
  17. break;
  18. case CHUAN_TOU_QIE_DUAN_JI://切断穿头
  19. // QDCT_InitAction();
  20. break;
  21. case MXC_NILONG: //免修齿
  22. // MXC_InitAction();
  23. break;
  24. case JIN_SHU_DIN_CUN:
  25. break;
  26. case CHUAN_TOU_JI:
  27. break;
  28. case JIN_SHU_KLSZ_JI:
  29. break;
  30. case HE_LIAN_JI:
  31. break;
  32. case TIE_BU_JI:
  33. TBJ_InitAction();
  34. break;
  35. case FANG_KUAI_CHA_XIAO_JI:
  36. break;
  37. case GONG_ZHI_MA:
  38. break;
  39. case QIE_DUAN_NEWSTR:
  40. // QueDuan_NewStr_InitAction();
  41. break;
  42. case KK_QIE_DUAN_JI:
  43. KK_QueDuan_InitAction();
  44. break;
  45. case CS_CHUAN_TOU_JI:
  46. // CS_ChuanTou_InitAction();
  47. break;
  48. case SK_QIE_DUAN_JI:
  49. SK_QueDuan_InitAction();
  50. break;
  51. default:
  52. break;
  53. }
  54. }
  55. void JX_Mechine_Action(void)
  56. {
  57. switch(cMachineType)
  58. {
  59. case CHUAN_TOU_QIE_DUAN_JI: //穿头切断机
  60. // QDCT_Action();
  61. break;
  62. case MXC_NILONG: //免修齿
  63. // MXC_NiLongXiuCiJiAction();
  64. break;
  65. case QIE_DUAN_NEWSTR:
  66. // QueDuan_NewStr_Action();
  67. break;
  68. case BK_QIE_DUAN_JI:
  69. BK_QueDuan_Action();
  70. break;
  71. case KK_QIE_DUAN_JI:
  72. KK_QueDuan_Action();
  73. break;
  74. case CS_CHUAN_TOU_JI:
  75. // CS_ChuanTou_Action();
  76. break;
  77. case TIE_BU_JI:
  78. TBJ_Action();
  79. break;
  80. case SK_QIE_DUAN_JI:
  81. SK_QueDuan_Action();
  82. break;
  83. default:
  84. break;
  85. }
  86. }
  87. void JX_Mechine_Config(void)
  88. {
  89. switch(cMachineType)
  90. {
  91. case CHUAN_TOU_QIE_DUAN_JI: //穿头切断机
  92. //外部中断相关配置
  93. USE_ENCODE=0;
  94. USE_X30_EXTI=0;
  95. USE_X31_EXTI=1;
  96. USE_X20_EXTI=0;
  97. USE_TIMER_X30_EXTI=0;
  98. USE_TIMER_X31_EXTI=0;
  99. EXTI_TIMER_FREQ=40000;
  100. FILTER_P=2;
  101. FILTER_N=2;
  102. X30EXTI_DIR=0;
  103. X31EXTI_DIR=0;
  104. X20EXTI_DIR=0;
  105. //是否使用扩展
  106. USE_EXTEND_INOUTPUT=1;
  107. USE_EXTEND_ALARM=0;
  108. //脉冲配置
  109. SET_PULSE_TYPE = X_AXIS_PULSE_Y_DIR;
  110. SET_XDIR_TYPE = PULSE_OUTPUT_TYPE;
  111. SET_XDIR_CH = 99;//设置方向类型为“不使用”时,方向通道设置不起作用
  112. SET_YDIR_TYPE = NO_USE_TYPE;
  113. SET_YDIR_CH = 99;
  114. break;
  115. case MXC_NILONG: //免修齿
  116. //外部中断相关配置
  117. USE_ENCODE=0;
  118. USE_X30_EXTI=0;
  119. USE_X31_EXTI=1;
  120. USE_X20_EXTI=0;
  121. USE_TIMER_X30_EXTI=0;
  122. USE_TIMER_X31_EXTI=0;
  123. EXTI_TIMER_FREQ=40000;
  124. FILTER_P=2;
  125. FILTER_N=2;
  126. X30EXTI_DIR=0;
  127. X31EXTI_DIR=0;
  128. X20EXTI_DIR=0;
  129. //是否使用扩展
  130. USE_EXTEND_INOUTPUT=0;
  131. USE_EXTEND_ALARM=0;
  132. //脉冲配置
  133. SET_PULSE_TYPE = XY_AXIS_PULSE;
  134. SET_XDIR_TYPE = NO_USE_TYPE;
  135. SET_XDIR_CH = 99;//设置方向类型为“不使用”时,方向通道设置不起作用
  136. SET_YDIR_TYPE = Y_OUTPUT_TYPE;
  137. SET_YDIR_CH = 13;//Y13作为方向
  138. break;
  139. case QIE_DUAN_NEWSTR: //切断机开闭一体
  140. USE_ENCODE=0;
  141. USE_X30_EXTI=0;
  142. USE_X31_EXTI=0;
  143. USE_X20_EXTI=0;
  144. USE_TIMER_X30_EXTI=0;
  145. USE_TIMER_X31_EXTI=0;
  146. EXTI_TIMER_FREQ=40000;
  147. FILTER_P=2;
  148. FILTER_N=2;
  149. X30EXTI_DIR=0;
  150. X31EXTI_DIR=0;
  151. X20EXTI_DIR=0;
  152. USE_EXTEND_INOUTPUT=0;
  153. USE_EXTEND_ALARM=0;
  154. SET_PULSE_TYPE = X_AXIS_PULSE_Y_DIR;
  155. SET_XDIR_TYPE = PULSE_OUTPUT_TYPE;
  156. SET_XDIR_CH = 99;//设置方向类型为“不使用”时,方向通道设置不起作用
  157. SET_YDIR_TYPE = NO_USE_TYPE;
  158. SET_YDIR_CH = 99;
  159. break;
  160. case BK_QIE_DUAN_JI:
  161. USE_ENCODE=0;
  162. USE_X30_EXTI=0;
  163. USE_X31_EXTI=0;
  164. USE_X20_EXTI=0;
  165. USE_TIMER_X30_EXTI=0;
  166. USE_TIMER_X31_EXTI=0;
  167. EXTI_TIMER_FREQ=40000;
  168. FILTER_P=2;
  169. FILTER_N=2;
  170. X30EXTI_DIR=0;
  171. X31EXTI_DIR=0;
  172. X20EXTI_DIR=0;
  173. USE_EXTEND_INOUTPUT=0;
  174. USE_EXTEND_ALARM=0;
  175. SET_PULSE_TYPE = X_AXIS_PULSE_Y_DIR;
  176. SET_XDIR_TYPE = PULSE_OUTPUT_TYPE;
  177. SET_XDIR_CH = 99;//设置方向类型为“不使用”时,方向通道设置不起作用
  178. SET_YDIR_TYPE = NO_USE_TYPE;
  179. SET_YDIR_CH = 99;
  180. break;
  181. case KK_QIE_DUAN_JI:
  182. USE_ENCODE=0;
  183. USE_X30_EXTI=0;
  184. USE_X31_EXTI=0;
  185. USE_X20_EXTI=0;
  186. USE_TIMER_X30_EXTI=0;
  187. USE_TIMER_X31_EXTI=0;
  188. EXTI_TIMER_FREQ=40000;
  189. FILTER_P=2;
  190. FILTER_N=2;
  191. X30EXTI_DIR=0;
  192. X31EXTI_DIR=0;
  193. X20EXTI_DIR=0;
  194. USE_EXTEND_INOUTPUT=0;
  195. USE_EXTEND_ALARM=0;
  196. SET_PULSE_TYPE = X_AXIS_PULSE_Y_DIR;
  197. SET_XDIR_TYPE = PULSE_OUTPUT_TYPE;
  198. SET_XDIR_CH = 99;//设置方向类型为“不使用”时,方向通道设置不起作用
  199. SET_YDIR_TYPE = NO_USE_TYPE;
  200. SET_YDIR_CH = 99;
  201. break;
  202. case CS_CHUAN_TOU_JI:
  203. USE_ENCODE=0;
  204. USE_X30_EXTI=0;
  205. USE_X31_EXTI=0;
  206. USE_X20_EXTI=0;
  207. USE_TIMER_X30_EXTI=0;
  208. USE_TIMER_X31_EXTI=0;
  209. EXTI_TIMER_FREQ=40000;
  210. FILTER_P=2;
  211. FILTER_N=2;
  212. X30EXTI_DIR=0;
  213. X31EXTI_DIR=0;
  214. X20EXTI_DIR=0;
  215. USE_EXTEND_INOUTPUT=0;
  216. USE_EXTEND_ALARM=0;
  217. SET_PULSE_TYPE = X_AXIS_PULSE_Y_ON;
  218. SET_XDIR_TYPE = PULSE_OUTPUT_TYPE;
  219. SET_XDIR_CH = 99;//设置方向类型为“不使用”时,方向通道设置不起作用
  220. SET_YDIR_TYPE = NO_USE_TYPE;
  221. SET_YDIR_CH = 99;
  222. break;
  223. case TIE_BU_JI: //贴布机
  224. //外部中断相关配置
  225. USE_ENCODE=0;
  226. USE_X30_EXTI=0;
  227. USE_X31_EXTI=0;
  228. USE_X20_EXTI =0;
  229. USE_TIMER_X30_EXTI=0;
  230. USE_TIMER_X31_EXTI=0;
  231. EXTI_TIMER_FREQ=40000;
  232. FILTER_P=10;
  233. FILTER_N=5;
  234. X30EXTI_DIR=0;
  235. X31EXTI_DIR=0;
  236. X20EXTI_DIR=0;
  237. //是否使用扩展
  238. USE_EXTEND_INOUTPUT=0;
  239. USE_EXTEND_ALARM=0;
  240. //脉冲配置
  241. SET_PULSE_TYPE = X_AXIS_PULSE_Y_DIR; //X轴脉冲,Y轴控制方向
  242. SET_XDIR_TYPE = PULSE_OUTPUT_TYPE; //Y轴控制方向,故不使用X方向通道
  243. SET_XDIR_CH = 99;//设置方向类型为“不使用”时,方向通道设置不起作用
  244. SET_YDIR_TYPE = NO_USE_TYPE; //无Y轴电机,故不使用Y轴方向通道
  245. SET_YDIR_CH = 99;//Y13作为方向
  246. break;
  247. case SK_QIE_DUAN_JI:
  248. USE_ENCODE=0;
  249. USE_X30_EXTI=0;
  250. USE_X31_EXTI=0;
  251. USE_X20_EXTI=0;
  252. USE_TIMER_X30_EXTI=0;
  253. USE_TIMER_X31_EXTI=0;
  254. EXTI_TIMER_FREQ=40000;
  255. FILTER_P=2;
  256. FILTER_N=2;
  257. X30EXTI_DIR=0;
  258. X31EXTI_DIR=0;
  259. X20EXTI_DIR=0;
  260. USE_EXTEND_INOUTPUT=0;
  261. USE_EXTEND_ALARM=0;
  262. SET_PULSE_TYPE = X_AXIS_PULSE_Y_DIR;
  263. SET_XDIR_TYPE = PULSE_OUTPUT_TYPE;
  264. SET_XDIR_CH = 99;//设置方向类型为“不使用”时,方向通道设置不起作用
  265. SET_YDIR_TYPE = NO_USE_TYPE;
  266. SET_YDIR_CH = 99;
  267. break;
  268. default:
  269. SET_PULSE_TYPE = XY_AXIS_PULSE;
  270. break;
  271. }
  272. }
  273. #endif