GLChuanTouJi.h 6.1 KB

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