JHChuanTouJi.h 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. #ifndef __JHCHUAN_TOU_JI_H__
  2. #define __JHCHUAN_TOU_JI_H__
  3. #if JIN_HONG_MACHINE
  4. extern void ChuanTou_Action(void);
  5. extern void ChuanTou_InitAction(void);
  6. #define CT_DIR_P 1
  7. #define CT_DIR_N 0
  8. #define CT_Y_DIR_P 1
  9. #define CT_Y_DIR_N 0
  10. #define CT_MOTOR_DISEN 1
  11. #define CT_MOTOR_EN 0
  12. #define CT_MOTOR_Y_DISEN 1
  13. #define CT_MOTOR_Y_EN 0
  14. /*
  15. * 警告类型 警告编号
  16. */
  17. #define CT_NO_ALARM 0 /* 没警告*/
  18. #define CT_NO_ZIPPER_ALARM 1 /* 没拉链,自动停机*/
  19. #define CT_KA_DAI_ALARM 2 /* 卡带异常*/
  20. #define CT_SL_LIMIT_ALARM 3
  21. #define CT_SL_ORIGIN_ALARM 4
  22. #define CT_HSL_LIMIT_ALARM 5
  23. #define CT_XM_ORIGIN_ALARM 6 /* 下模下限位*/
  24. #define CT_HSL_ORIGIN_ALARM 7
  25. #define CT_TOTAL_ALARM 8
  26. #define CT_TL_ALARM 9
  27. #define CT_DZ_ALARM 10
  28. #define CT_JD_ORIGIN_ALARM 11
  29. #define CT_DEC_ALARM 12
  30. #define CT_BL_ALARM 17
  31. #define CT_SM_ALARM 18
  32. #define CT_LENGTH_LONG_ALARM 19
  33. #define CT_LENGTH_SHORT_ALARM 20
  34. #define CT_CR_ORIGIN_ALARM 21
  35. #define CT_FD_IN_ALARM 22
  36. #define CT_CR_LIMIT_ALARM 23
  37. #define CT_OUT_ALARM 24
  38. #define VAVLE_ALARM_TIME 3000
  39. #define MOTOR_ALARM_TIME 5000
  40. #define CT_TOTAL_ADDR 76
  41. #define CT_ALARM_ADDR 100
  42. #define CT_PROSPEED_ADDR 78
  43. #define CT_PARAM_ZIPPER_LENGTH (user_datas[1] | (user_datas[2] >> 16))
  44. #define CT_PARAM_SET_TOTAL (user_datas[74] | (user_datas[75] >> 16))
  45. #define CT_PARAM_SL_DELAY_BACK (user_datas[3] * 10)
  46. #define CT_PARAM_LOCK_TIME (user_datas[4] * 10)
  47. #define CT_PARAM_GJ_TIME (user_datas[5] * 10)
  48. #define CT_PARAM_HSPEED (user_datas[6])
  49. #define CT_PARAM_LSPEED (user_datas[7])
  50. #define CT_PARAM_STOP_LENGTH (user_datas[8])
  51. #define CT_PARAM_MOTOR_ALARM_TIME (user_datas[9] * 10)
  52. #define CT_PARAM_CYCLE_LENGTH user_datas[10]
  53. #define CT_PARAM_CYCLE_PULSE user_datas[11]
  54. #define CT_PARAM_CYCLE_DELAY (user_datas[12] * 10)
  55. #define CT_PARAM_FD_DELAY (user_datas[13] * 10)
  56. #define CT_PARAM_XM_BACK_DELAY user_datas[14]
  57. #define CT_PARAM_CR_BACK_DELAY (user_datas[15] * 10)
  58. #define CT_PARAM_XM_DELAY (user_datas[16] * 10)
  59. #define CT_PARAM_MAX_LENGTH (user_datas[17] * 100)
  60. #define CT_PARAM_ZDP_TIME (user_datas[18] * 10)
  61. #define CT_PARAM_CR_SPEED user_datas[19]
  62. #define CT_PARAM_CR_DELAY user_datas[20]
  63. #define CT_PARAM_HL_ENABLE user_datas[30]
  64. #define CT_PARAM_START_SWITCH_MODE user_datas[31]
  65. #define CT_PARAM_SL_MODE user_datas[32]
  66. #define CT_PARAM_GZ_MODE user_datas[33]
  67. #define CT_PARAM_ZDP_MODE user_datas[34]
  68. #define CT_PARAM_CR_MODE user_datas[35] // 0为气缸模式 1为电机模式
  69. #define CT_AutoDelay cDelayTime1
  70. #define CT_MotorDelay cDelayTime2
  71. #define CT_HeMuDelay cDelayTime3
  72. #define CT_SL_Delay cDelayTime4
  73. #define CT_HSL_Delay cDelayTime5
  74. #define CT_ZL_Delay cDelayTime6
  75. #define CT_XM_BACK_Delay cDelayTime7
  76. #define CT_CLT_Delay cDelayTime8
  77. #define CT_ZDP_Delay cDelayTime9
  78. #define CT_AlarmDelay cDelayTime10
  79. #define CT_AutoStep cStepMByte
  80. #define CT_MotorStep cStepMByte1
  81. #define CT_HeMuStep cStepMByte2
  82. #define CT_SL_Step cStepMByte3
  83. #define CT_HSL_Step cStepMByte4
  84. #define CT_ZL_Step cStepMByte5
  85. #define CT_CLT_Step cStepMByte6
  86. #define CT_ZD_Step cStepMByte7
  87. #define CT_START_IN X00
  88. #define CT_START_IN_UP (X00 && !OLDX00)
  89. #define CT_STOP_IN X01
  90. #define CT_STOP_IN_UP (X01 && !OLDX01)
  91. #define CT_MANUAL_FD_IN X02
  92. #define CT_MANUAL_FD_IN_UP (X02 && !OLDX02)
  93. #define CT_MANUAL_CR_IN X03
  94. #define CT_MANUAL_CR_IN_UP (X03 && !OLDX03)
  95. #define CT_ALARM_IN X04
  96. #define CT_FD_IN X05
  97. #define CT_FD_IN_DW (!X05 && OLDX05)
  98. #define CT_DZ_IN X06
  99. #define CT_XM_ORIGIN_IN X07
  100. #define CT_SL_ORIGIN_IN X10
  101. #define CT_SL_LIMIT_IN X11
  102. #define CT_CR_ORIGIN_IN X12
  103. #define CT_CR_ORIGIN_IN_DW (!X12 && OLDX12)
  104. #define CT_CR_LIMIT_IN X13
  105. #define CT_ZDP_IN X14
  106. #define CT_ZDP_IN_UP (X14 && !OLDX14)
  107. #define CT_ZDP_IN_DW (!X14 && OLDX14)
  108. #define CT_MANUAL_TL_IN X15
  109. #define CT_MANUAL_TL_IN_UP (X15 && !OLDX15)
  110. #define CT_GUO_LIAN_IN X17
  111. #define CT_GUO_LIAN_IN_UP (X17 && !OLDX17)
  112. #define CT_GUO_LIAN_IN_DW (!X17 && OLDX17)
  113. #define CT_HSL_LIMIT_IN X14
  114. #define CT_HSL_ORIGIN_IN X15
  115. #define CT_FD_VAVLE Y00
  116. #define CT_XM_VAVLE Y01
  117. #define CT_SL_VAVEL Y02
  118. #define CT_QYD_VAVLE Y03
  119. #define CT_HL_VAVLE Y04
  120. #define CT_HYD_VAVLE Y05
  121. #define CT_CR_VAVLE Y07
  122. #define CT_ZDP_OUT Y10
  123. #define CT_HSL_VAVLE Y12
  124. #define CT_SZ_OUT Y13
  125. #define CT_CRDR_OUT Y14
  126. //M0~M4全局固定使用
  127. /*
  128. #define bRunning M0000
  129. #define bStart M0001
  130. #define bStop M0002
  131. #define bAlarmStop M0003
  132. #define bClearTotal M0004
  133. */
  134. #define CT_bFD M0006
  135. #define CT_bXM M0007
  136. #define CT_bQYD M0008
  137. #define CT_bHYD M0009
  138. #define CT_bSL M0010
  139. #define CT_bZL M0011
  140. #define CT_bCR M0012
  141. #define CT_bHL M0013
  142. #define CT_bCT_XM M0014
  143. #define CT_bDW M0015
  144. #define CT_bAuto_ZL M0016
  145. #define CT_bHM M0017
  146. #define CT_bSingle M0018
  147. #define CT_bHSL M0019
  148. #define CT_bMotor M0020
  149. #define CT_bCLT M0021
  150. #define CT_bZDP M0022
  151. #endif
  152. #endif