GLQueDuanJi.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. #ifndef __GLQUE_DUAN_JI_H__
  2. #define __GLQUE_DUAN_JI_H__
  3. #if CHANG_SHENG_GEI_LI_MACHINE
  4. extern void QueDuan_Action(void);
  5. extern void QueDuan_InitAction(void);
  6. extern void QueDuanEx_ExtiActionX31(void);
  7. extern void FastTimerAction(void);
  8. #define QD_DIR_P 1
  9. #define QD_DIR_N 0
  10. #define QD_YDIR_P 0
  11. #define QD_YDIR_N 1
  12. #define QD_YL_DIR_P 0
  13. #define QD_YL_DIR_N 1
  14. #define QD_TOTAL_ADDR 76
  15. #define QD_QIE_DUAN_TOTAL_ADDR 79
  16. #define QD_ALARM_ADDR 100
  17. #define QD_PROSPEED_ADDR 78
  18. /*
  19. * 警告类型 警告编号
  20. */
  21. #define QD_NO_ALARM 0 /* 没警告*/
  22. #define QD_NO_ZIPPER_ALARM 1 /* 没拉链,自动停机*/
  23. #define QD_KA_DAI_ALARM 2 /* 卡带异常*/
  24. #define QD_SM_YUANWEI 3 /* 上模上限位*/
  25. #define QD_SM_DAOWEI 4 /* 上模下限位*/
  26. #define QD_XM_YUANWEI 5 /* 下模上限位*/
  27. #define QD_XM_DAOWEI 6 /* 下模下限位*/
  28. #define QD_BACK_ALARM 7
  29. #define QD_TOTAL_ALARM 8
  30. #define QD_TL_ALARM 9
  31. #define QD_GZ_ALARM 10
  32. #define QD_JD_ORIGIN_ALARM 11
  33. #define QD_DEC_ALARM 12
  34. #define QD_BL_ALARM 17
  35. #define QD_SM_ALARM 18
  36. #define QD_LENGTH_LONG_ALARM 19
  37. #define QD_LENGTH_SHORT_ALARM 20
  38. #define QD_JD_IN_ALARM 21
  39. #define QD_YL_LIMIT_ALARM 22
  40. #define QD_STOP_IN_ALARM 23
  41. #define VAVLE_ALARM_TIME 3000
  42. #define MOTOR_ALARM_TIME 5000
  43. #define QD_PARAM_ZIPPER_LENGTH (user_datas[1] | (user_datas[2] >> 16))
  44. #define QD_PARAM_SET_TOTAL (user_datas[74] | (user_datas[75] >> 16))
  45. #define QD_PARAM_MAX_BACK_LENGTH (user_datas[42] | (user_datas[43] >> 16))
  46. #define QD_PARAM_ON_BACK_LENGTH user_datas[5]
  47. #define QD_PARAM_SJZ_LENGTH user_datas[19]
  48. #define QD_PARAM_FZ_LENGTH user_datas[22]
  49. #define QD_PARAM_Go_LOW_SPEED_LENGTH user_datas[16]
  50. #define QD_PARAM_Back_LOW_SPEED_LENGTH user_datas[6]
  51. #define QD_PARAM_BACK_LENGTH user_datas[27]
  52. #define QD_PARAM_GO_HIGH_SPEED user_datas[15]
  53. #define QD_PARAM_GO_LOW_SPEED user_datas[17]
  54. #define QD_PARAM_BACK_SPEED user_datas[18]
  55. #define QD_PARAM_CUT_BACK_SPEED user_datas[26]
  56. #define QD_PARAM_HL_LENGTH user_datas[29]
  57. #define QD_PARAM_TABLE_NUM user_datas[40]
  58. #define QD_PARAM_CYCLE_LENGTH user_datas[38]
  59. #define QD_PARAM_CYCLE_PULSE user_datas[39]
  60. #define QD_PARAM_FIRST_SPEED user_datas[9]
  61. #define QD_PARAM_ZHA_SHU user_datas[85]
  62. #define QD_PARAM_NOW_CNT user_datas[84]
  63. #define QD_PARAM_DELAY_CS (user_datas[20] * 10)
  64. #define QD_PARAM_CS_TIME (user_datas[21] * 10)
  65. #define QD_PARAM_CS_COLD_TIME (user_datas[10] * 10)
  66. #define QD_PARAM_ZS_STOP_TIME (user_datas[11] * 10)
  67. #define QD_PARAM_DELAY_BACK (user_datas[12]*10)
  68. #define QD_PARAM_DELAY_FZ (user_datas[13]*10)
  69. #define QD_PARAM_CYCLE_DELAY (user_datas[14]*10)
  70. #define QD_PARAM_TL_DELAY (user_datas[3]*10)
  71. #define QD_PARAM_YD_DELAY (user_datas[4]*10)
  72. #define QD_PARAM_GZ_DELAY (user_datas[0]*10)
  73. #define QD_PARAM_CUT_DELAY (user_datas[7]*10)
  74. #define QD_PARAM_CUT_BACK_DELAY (user_datas[8]*10)
  75. #define QD_PARAM_TB_TIME (user_datas[23]*10)
  76. #define QD_PARAM_MOTOR_DELAY_LENGTH user_datas[41]
  77. #define QD_PARAM_TFK_DELAY (user_datas[44]*10)
  78. #define QD_PARAM_TL_MODE 0//user_datas[45] //推链方式0为气缸1为步进
  79. #define QD_PARAM_TL_CYCLE_LENGTH user_datas[46]
  80. #define QD_PARAM_TL_CYCLE_PULSE user_datas[47]
  81. #define QD_PARAM_TL_SPEED user_datas[48]
  82. #define QD_PARAM_TL_LENGTH user_datas[49]
  83. #define QD_PARAM_DELAY_CHECK user_datas[50]
  84. #define QD_PARAM_DAO_MODE user_datas[51] //0为双刀1为单刀
  85. #define QD_PARAM_DANDAO_MODE_LENGTH user_datas[52]
  86. #define QD_PARAM_OFFSET_LENGTH user_datas[53]
  87. #define QD_PARAM_GOUZHEN_LENGTH user_datas[54]
  88. #define QD_PARAM_TIAOSHI_MODE user_datas[55]
  89. #define QD_PARAM_DELAY_HL_LENGTH user_datas[56]
  90. #define QD_PARAM_HL_ENABLE user_datas[33]
  91. #define QD_PARAM_CS_ENABLE user_datas[90]
  92. #define QD_PARAM_XM_ENABLE user_datas[35] //0为下模不动带推链 1为下模工作带锁模
  93. #define QD_PARAM_CS_MODE user_datas[36] //0为气切1为超声切
  94. #define QD_PARAM_DELAY_XM (user_datas[58]*10)
  95. #define QD_PARAM_DELAY_XM_LENGTH user_datas[59]
  96. #define QD_PARAM_BACK_LOW_SPEED user_datas[60]
  97. #define QD_PARAM_NO_LT_DELAY_CHECK user_datas[63]
  98. #define QD_PARAM_ERROR_LENGTH user_datas[64]
  99. #define QD_PARAM_DELAYBACK_SM (user_datas[65]*10)
  100. #define QD_PARAM_SL_LENGTH user_datas[66]
  101. #define QD_PARAM_TC_LENGTH user_datas[67]
  102. #define QD_PARAM_DELAY_SJ_TIME user_datas[68]
  103. #define QD_PARAM_XHG_LENGTH user_datas[69]
  104. #define QD_PARAM_DELAY_BL_BACK user_datas[70]
  105. #define QD_PARAM_MAX_ERROR_LENGTH user_datas[71]
  106. #define QD_PARAM_MIN_SPEED user_datas[72]
  107. #define QD_PARAM_RUN_STATE user_datas[250]
  108. #define QD_PARAM_YD_ENABLE 1
  109. #define QD_PARAM_DC_MODE 1//user_datas[31] //后退定寸模式,1为钩针,0为不用钩针
  110. #define QD_PARAM_DEC_MODE 2// user_datas[30] //后退方式 1为输入长度数控,0为前两条测长
  111. #define QD_PARAM_GO_MODE 1//1前进使用数控降速
  112. #define QD_PARAM_BACK_MODE user_datas[61]//1后退使用数控降速
  113. #define QD_PARAM_BACK_ALARM_MODE 1 //后退限位模式 0为数控,1为感应限位
  114. #define QD_PARAM_TFK_ENABLE 1
  115. #define QD_PARAM_LT_ENABLE user_datas[62]
  116. #define QD_SAVE_POS (user_datas[200] | (user_datas[201] >> 16))
  117. #define QD_PARAM_BL_ENABLE user_datas[57]
  118. #define QD_PARAM_YL_HIGH_SPEED user_datas[86]
  119. #define QD_PARAM_YL_LOW_SPEED user_datas[87]
  120. #define QD_PARAM_JD_DELAY (user_datas[88]*10)
  121. #define QD_PARAM_START_SPEED user_datas[89]
  122. #define QD_PARAM_ACC_SPEED user_datas[90]
  123. #define QD_PARAM_YL_TRANS_LENGTH user_datas[91]
  124. #define QD_PARAM_YL_SL_TIME (user_datas[92]*10)
  125. #define QD_PARAM_YL_SL_SPEED user_datas[93]
  126. #define QD_PARAM_YL_CYCLE_LENGTH user_datas[94]
  127. #define QD_PARAM_YL_CYCLE_PULSE user_datas[95]
  128. #define QD_PARAM_LONG_MODE user_datas[96]
  129. #define QD_PARAM_DELAY_YL (user_datas[97]*10)
  130. #define QD_PARAM_SJ_TIME (user_datas[98]*10)
  131. #define QD_PARAM_SJ_JZ_TIME (user_datas[99]*10)
  132. #define QD_PARAM_DELAY_GO (user_datas[101]*10)
  133. #define QD_PARAM_GO_LENGTH user_datas[102]
  134. #define QD_PARAM_SJ_ENABLE user_datas[103]
  135. #define QD_PARAM_CQ_TIME (user_datas[104]*10)
  136. #define QD_PARAM_GZ_BACK_DELAY_LENGTH user_datas[105]
  137. #define QD_PARAM_SPEED_MODE 0//user_datas[106]
  138. #define QD_PARAM_DELAY_YL_BACK user_datas[107]
  139. #define QD_PARAM_DELAY_LONG_GO (user_datas[108]*10)
  140. #define QD_AutoDelay cDelayTime1
  141. #define QD_MotorDelay cDelayTime2
  142. #define QD_XiaQieDelay cDelayTime3
  143. #define QD_KaDaiDelay cDelayTime4
  144. #define QD_CSDelay cDelayTime5
  145. #define QD_TBDelay cDelayTime6
  146. #define QD_TFKDelay cDelayTime7
  147. #define QD_TLDelay cDelayTime8
  148. #define QD_CheckDelay cDelayTime9
  149. #define QD_ShenJiangDelay cDelayTime10
  150. #define QD_YLBackDelay cDelayTime11
  151. #define QD_XMDelay cDelayTime12
  152. #define QD_GZDelay cDelayTime13
  153. #define QD_BLDelay cDelayTime14
  154. #define QD_CQDelay cDelayTime15
  155. #define QD_BUTTONDelay cDelayTime16
  156. #define QD_AutoStep cStepMByte
  157. #define QD_MotorStep cStepMByte1
  158. #define QD_XiaQieStep cStepMByte2
  159. #define QD_YuanDianStep cStepMByte3
  160. #define QD_TuiLianStep cStepMByte4
  161. #define QD_TuiFangKuaiStep cStepMByte5
  162. #define QD_BinLianStep cStepMByte6
  163. #define QD_ShenJiangStep cStepMByte7
  164. //超声花边切输入输出
  165. #define QD_GUO_LIAN_IN X02
  166. #define QD_GUO_LIAN_IN_UP (X02 && !OLDX02)
  167. #define QD_GUO_LIAN_IN_DW (!X02 && OLDX02)
  168. #define QD_GOUZHEN_IN X04
  169. #define QD_QIAN_LIMIT_IN X05
  170. #define QD_QIAN_LIMIT_IN_UP (X05 && !OLDX05)
  171. #define QD_QIAN_DEC_IN X06
  172. #define QD_QIAN_DEC_IN_UP (X06 && !OLDX06)
  173. #define QD_BACK_LIMIT_IN X07
  174. #define QD_BACK_LIMIT_IN_UP (X07 && !OLDX07)
  175. #define QD_JD_IN X10
  176. #define QD_SHANG_MU_ORIGIN_IN X11
  177. #define QD_SHANG_MU_LIMIT_IN X12
  178. #define QD_SHANG_MU_LIMIT_IN_DW (!X12 && OLDX12)
  179. #define QD_START_IN X13
  180. #define QD_START_IN_UP (X13 && !OLDX13)
  181. #define QD_STOP_IN X14
  182. #define QD_STOP_IN_UP (X14 && !OLDX14)
  183. #define QD_YL_ORIGIN_IN X15
  184. #define QD_SAFE_DOOR_IN X16
  185. #define QD_XIA_MU_LIMIT_IN X17
  186. #define QD_XIA_MU_LIMIT_IN_UP (X17 && !OLDX17)
  187. #define QD_JD_ORIGIN_IN X25
  188. #define QD_YL_DIR Y00
  189. #define QD_R_JD Y01
  190. #define QD_BL_VAVLE Y02
  191. #define QD_R_UP_VAVLE Y03
  192. #define QD_JD_VAVEL Y04
  193. #define QD_GZ_VAVLE Y05
  194. #define QD_SM_VAVLE Y06
  195. #define QD_YL_VAVLE Y07
  196. #define QD_JZ_DIR Y10
  197. #define QD_YD_VAVLE Y11
  198. #define QD_CQ_VAVLE Y12
  199. #define QD_L_UP_VAVLE Y13
  200. #define QD_SZ_OUT Y14
  201. #define QD_CS_OUT Y15
  202. #define QD_TFK_VAVEL Y11
  203. #define QD_XM_VAVLE Y12
  204. #define QD_TL_VAVLE Y13
  205. #define QD_TABLE_VAVLE Y23
  206. #define QD_YBD_VAVLE Y25
  207. //M0~M4全局固定使用
  208. /*
  209. #define bRunning M0000
  210. #define bStart M0001
  211. #define bStop M0002
  212. #define bAlarmStop M0003
  213. #define bClearTotal M0004
  214. */
  215. #define QD_bSM M0006
  216. #define QD_bXM M0007
  217. #define QD_bClearTotal M0008
  218. #define QD_bXiaQie M0009
  219. #define QD_bQianDianDW M0010
  220. #define QD_bChaoSheng M0011
  221. #define QD_bJiaDai M0012
  222. #define QD_bGoMotor M0013
  223. #define QD_bBackMotor M0014
  224. #define QD_bTL M0015
  225. #define QD_bYD M0016
  226. #define QD_bGZ M0017
  227. #define QD_bJD M0018
  228. #define QD_bHL M0019
  229. #define QD_bYuanDianDW M0020
  230. #define QD_bTestCS M0021
  231. #define QD_bSingle M0022
  232. #define QD_bTFK M0023
  233. #define QD_bTB M0024
  234. #define QD_bYBD M0025
  235. #define QD_bClearNowTotal M0026
  236. #define QD_bTS M0027
  237. #define QD_bBL M0028
  238. #define QD_bSetGZMode M0029
  239. #define QD_bYL M0030
  240. #define QD_bYLGO_MOTOR M0031
  241. #define QD_bYLBACK_MOTOR M0032
  242. #define QD_bR_UP M0033
  243. #define QD_bR_JD M0034
  244. #define QD_bCQ M0035
  245. #endif
  246. #endif