JTChuanTouJi.h 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. #ifndef __JTCHUAN_TOU_JI_H__
  2. #define __JTCHUAN_TOU_JI_H__
  3. #if JUN_TENG_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] * 10)
  60. #define CT_PARAM_ZDP_TIME (user_datas[18] * 10)
  61. #define CT_PARAM_CR_SPEED user_datas[19]
  62. #define CT_PARAM_HL_ENABLE user_datas[30]
  63. #define CT_PARAM_START_SWITCH_MODE user_datas[31]
  64. #define CT_PARAM_SL_MODE user_datas[32]
  65. #define CT_PARAM_GZ_MODE user_datas[33]
  66. #define CT_PARAM_ZDP_MODE user_datas[34]
  67. #define CT_PARAM_CR_MODE user_datas[35] // 0为气缸模式 1为电机模式
  68. #define CT_AutoDelay cDelayTime1
  69. #define CT_MotorDelay cDelayTime2
  70. #define CT_HeMuDelay cDelayTime3
  71. #define CT_SL_Delay cDelayTime4
  72. #define CT_HSL_Delay cDelayTime5
  73. #define CT_ZL_Delay cDelayTime6
  74. #define CT_XM_BACK_Delay cDelayTime7
  75. #define CT_CLT_Delay cDelayTime8
  76. #define CT_ZDP_Delay cDelayTime9
  77. #define CT_AlarmDelay cDelayTime10
  78. #define CT_AutoStep cStepMByte
  79. #define CT_MotorStep cStepMByte1
  80. #define CT_HeMuStep cStepMByte2
  81. #define CT_SL_Step cStepMByte3
  82. #define CT_HSL_Step cStepMByte4
  83. #define CT_ZL_Step cStepMByte5
  84. #define CT_CLT_Step cStepMByte6
  85. #define CT_ZD_Step cStepMByte7
  86. #define CT_START_IN X00
  87. #define CT_START_IN_UP (X00 && !OLDX00)
  88. #define CT_STOP_IN X01
  89. #define CT_STOP_IN_UP (X01 && !OLDX01)
  90. #define CT_MANUAL_FD_IN X02
  91. #define CT_MANUAL_FD_IN_UP (X02 && !OLDX02)
  92. #define CT_MANUAL_CR_IN X03
  93. #define CT_MANUAL_CR_IN_UP (X03 && !OLDX03)
  94. #define CT_ALARM_IN X04
  95. #define CT_FD_IN X05
  96. #define CT_DZ_IN X06
  97. #define CT_XM_ORIGIN_IN X07
  98. #define CT_SL_ORIGIN_IN X10
  99. #define CT_SL_LIMIT_IN X11
  100. #define CT_CR_ORIGIN_IN X12
  101. #define CT_CR_LIMIT_IN X13
  102. #define CT_ZDP_IN X14
  103. #define CT_ZDP_IN_UP (X14 && !OLDX14)
  104. #define CT_ZDP_IN_DW (!X14 && OLDX14)
  105. #define CT_MANUAL_TL_IN X15
  106. #define CT_MANUAL_TL_IN_UP (X15 && !OLDX15)
  107. #define CT_GUO_LIAN_IN X17
  108. #define CT_GUO_LIAN_IN_UP (X17 && !OLDX17)
  109. #define CT_GUO_LIAN_IN_DW (!X17 && OLDX17)
  110. #define CT_HSL_LIMIT_IN X14
  111. #define CT_HSL_ORIGIN_IN X15
  112. #define CT_FD_VAVLE Y00
  113. #define CT_XM_VAVLE Y01
  114. #define CT_SL_VAVEL Y02
  115. #define CT_QYD_VAVLE Y03
  116. #define CT_HL_VAVLE Y04
  117. #define CT_HYD_VAVLE Y05
  118. #define CT_CR_VAVLE Y07
  119. #define CT_ZDP_OUT Y10
  120. #define CT_HSL_VAVLE Y12
  121. #define CT_SZ_OUT Y13
  122. #define CT_CRDR_OUT Y14
  123. //M0~M4全局固定使用
  124. /*
  125. #define bRunning M0000
  126. #define bStart M0001
  127. #define bStop M0002
  128. #define bAlarmStop M0003
  129. #define bClearTotal M0004
  130. */
  131. #define CT_bFD M0006
  132. #define CT_bXM M0007
  133. #define CT_bQYD M0008
  134. #define CT_bHYD M0009
  135. #define CT_bSL M0010
  136. #define CT_bZL M0011
  137. #define CT_bCR M0012
  138. #define CT_bHL M0013
  139. #define CT_bCT_XM M0014
  140. #define CT_bDW M0015
  141. #define CT_bAuto_ZL M0016
  142. #define CT_bHM M0017
  143. #define CT_bSingle M0018
  144. #define CT_bHSL M0019
  145. #define CT_bMotor M0020
  146. #define CT_bCLT M0021
  147. #define CT_bZDP M0022
  148. #endif
  149. #endif