JHAction.c 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. #include "global.h"
  2. #include "Action.h"
  3. #if JIN_HONG_MACHINE == 1
  4. //初始化动作
  5. void JH_Mechine_InitAction(void)
  6. {
  7. switch(cMachineType)
  8. {
  9. case JIAO_YA_DIN_CUN:
  10. JYDC_InitAction();
  11. break;
  12. case CHU_CHI_JI:
  13. break;
  14. case JIAO_YA_CHU_CHI:
  15. break;
  16. case QIE_DUAN_JI:
  17. break;
  18. case CHUAN_TOU_QIE_DUAN_JI:
  19. //GL_QDCT_InitAction();
  20. break;
  21. case MXC_NILONG:
  22. break;
  23. case JIN_SHU_DIN_CUN:
  24. JSDC_InitAction();
  25. break;
  26. case CHUAN_TOU_JI: //´©Í·»ú
  27. ChuanTou_InitAction();
  28. break;
  29. default:
  30. break;
  31. }
  32. }
  33. void JH_Mechine_Action(void)
  34. {
  35. switch(cMachineType)
  36. {
  37. case JIAO_YA_DIN_CUN:
  38. JYDC_Action();
  39. break;
  40. case CHUAN_TOU_QIE_DUAN_JI: //穿头切断机
  41. //GL_QDCT_Action();
  42. break;
  43. case CHUANTOU_HELIAN_JI: //穿头合链机
  44. //GL_CTHL_Action();
  45. break;
  46. case JIN_SHU_DIN_CUN:
  47. JSDC_Action();
  48. break;
  49. default:
  50. break;
  51. }
  52. }
  53. void JH_Mechine_Config(void)
  54. {
  55. switch(cMachineType)
  56. {
  57. case JIAO_YA_DIN_CUN:
  58. //外部中断相关配置
  59. USE_ENCODE=0;
  60. USE_X30_EXTI=1;
  61. USE_X31_EXTI=0;
  62. USE_X20_EXTI=1;
  63. USE_TIMER_X30_EXTI=0;
  64. USE_TIMER_X31_EXTI=0;
  65. EXTI_TIMER_FREQ=20000;
  66. FILTER_P=1;
  67. FILTER_N=1;
  68. X30EXTI_DIR=user_datas[34];
  69. X31EXTI_DIR=1;
  70. X20EXTI_DIR=user_datas[34];
  71. //是否使用扩展
  72. USE_EXTEND_INOUTPUT=0;
  73. USE_EXTEND_ALARM=0;
  74. //脉冲配置
  75. SET_PULSE_TYPE = X_AXIS_PULSE_Y_DIR;
  76. SET_XDIR_TYPE = PULSE_OUTPUT_TYPE;
  77. SET_XDIR_CH = 99;//设置方向类型为“不使用”和“脉冲输出”时,方向通道设置不起作用
  78. SET_YDIR_TYPE = NO_USE_TYPE;
  79. SET_YDIR_CH = 99;//Y13作为方向
  80. break;
  81. case JIN_SHU_DIN_CUN:
  82. //外部中断相关配置
  83. USE_ENCODE=1;
  84. USE_X30_EXTI=0;
  85. USE_X31_EXTI=0;
  86. USE_X20_EXTI=1;
  87. USE_TIMER_X30_EXTI=0;
  88. USE_TIMER_X31_EXTI=1;
  89. EXTI_TIMER_FREQ=40000;
  90. FILTER_P=10;
  91. FILTER_N=5;
  92. X30EXTI_DIR=0;
  93. X31EXTI_DIR=0;
  94. X20EXTI_DIR=0;
  95. //是否使用扩展
  96. USE_EXTEND_INOUTPUT=0;
  97. USE_EXTEND_ALARM=0;
  98. //脉冲配置
  99. SET_PULSE_TYPE = X_AXIS_PULSE_Y_ON;
  100. SET_XDIR_TYPE = PULSE_OUTPUT_TYPE;
  101. SET_XDIR_CH = 99;//设置方向类型为“不使用”时,方向通道设置不起作用
  102. SET_YDIR_TYPE = NO_USE_TYPE;
  103. SET_YDIR_CH = 99;
  104. break;
  105. case MXC_NILONG: //免修齿
  106. //外部中断相关配置
  107. USE_ENCODE=1;
  108. USE_X30_EXTI=0;
  109. USE_X31_EXTI=1;
  110. USE_X20_EXTI=0;
  111. USE_TIMER_X30_EXTI=0;
  112. USE_TIMER_X31_EXTI=0;
  113. EXTI_TIMER_FREQ=40000;
  114. FILTER_P=2;
  115. FILTER_N=2;
  116. X30EXTI_DIR=0;
  117. X31EXTI_DIR=0;
  118. X20EXTI_DIR=0;
  119. //是否使用扩展
  120. USE_EXTEND_INOUTPUT=0;
  121. USE_EXTEND_ALARM=0;
  122. //脉冲配置
  123. SET_PULSE_TYPE = XY_AXIS_PULSE;
  124. SET_XDIR_TYPE = NO_USE_TYPE;
  125. SET_XDIR_CH = 99;//设置方向类型为“不使用”时,方向通道设置不起作用
  126. SET_YDIR_TYPE = Y_OUTPUT_TYPE;
  127. SET_YDIR_CH = 13;//Y13作为方向
  128. break;
  129. case CHUANTOU_HELIAN_JI: //穿头合链机
  130. break;
  131. default:
  132. SET_PULSE_TYPE = XY_AXIS_PULSE;
  133. break;
  134. }
  135. }
  136. #endif