GLQueduanChuantou.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363
  1. #ifndef GLQUEDUAN_CHUANTOU_H
  2. #define GLQUEDUAN_CHUANTOU_H
  3. #if CHANG_SHENG_GEI_LI_MACHINE == 1
  4. extern void QDCT_InitAction(void);
  5. extern void QDCT_Action(void);
  6. extern void QDCT_ExtiActionX31(void);
  7. extern void QDCT_SetAlarmCode(unsigned alarm_code);
  8. #define QDCT_LATOU user_datas[132] // 0为双拉头 1为单拉头
  9. #define QDCT_LONG_LENGTH_USE user_datas[133] //0为普通长度 1为无限长
  10. #define QDCT_PARAM_QLT_ON (user_datas[31]) //前拉头开
  11. #define QDCT_PARAM_HLT_ON (user_datas[32]) //后拉头开
  12. #define QDCT_PARAM_MODE (user_datas[86]) // 0为正穿 1为反穿
  13. #define QDCT_SEBIAO_MODE (user_datas[59])
  14. #define QDCT_SEBIAO_USE user_datas[134] //色标配置选择:0无色标 ,1有色标,该变量只在屏幕上使用
  15. #define QDCT_DLP_USE user_datas[135] //挡拉片配置选择:0无挡拉片 ,1有挡拉片,该变量只在屏幕上使用
  16. #define QDCT_DIR_P 1
  17. #define QDCT_DIR_N 0
  18. #define QDCT_JJ_DIR_P 1
  19. #define QDCT_JJ_DIR_N 0
  20. #define QDCT_YL_DIR_P 0
  21. #define QDCT_YL_DIR_N 1
  22. #define QDCT_MOTOR_EN 1
  23. #define QDCT_MOTOR_DISEN 0
  24. #define QDCT_VAVLE_ERROR_TIME 3000
  25. #define QDCT_MOTOR_ALARM_TIME 5000
  26. //故障代码列表
  27. #define QDCT_NO_ALARM 0
  28. #define QDCT_NO_ZIPPER_ALARM 1
  29. #define QDCT_LT_ALARM 2
  30. #define QDCT_XQ_ORIGIN_ALARM 3
  31. #define QDCT_XQ_LIMIT_ALARM 4
  32. #define QDCT_JD_ALARM 5
  33. #define QDCT_DEC_ALARM 6
  34. #define QDCT_GO_LIMIT_ALARM 7
  35. #define QDCT_BACK_LIMIT_ALARM 8
  36. #define QDCT_LTCZ_ALARM 9
  37. #define QDCT_ZHA_ALARM 10 //扎数到
  38. #define QDCT_XM_LIMIT_ALARM 13
  39. #define QDCT_XQ_ALARM 14
  40. #define QDCT_TOTAL_ALARM 16
  41. #define QDCT_XM_ORIGIN_ALARM 17
  42. #define QDCT_SL_ORIGIN_ALARM 18
  43. #define QDCT_SQ_ORIGIN_ALARM 19
  44. #define QDCT_SL_ALARM 20
  45. #define QDCT_HSL_LIMIT_ALARM 22
  46. #define QDCT_HSL_ORIGIN_ALARM 23
  47. #define QDCT_JD_LEFT_ALARM 24
  48. #define QDCT_JD_RIGHT_ALARM 25
  49. #define QDCT_JLT_ALARM 26
  50. #define QDCT_ZLT_ALARM 27
  51. #define QDCT_START_NO_ZIPPER_ALARM 30
  52. #define QDCT_START_JLT_ALARM 31
  53. #define QDCT_START_LTCZ_ALARM 32
  54. #define QDCT_START_GL_ORIGIN_ALARM 33
  55. #define QDCT_START_SL_LIMIT_ALARM 34
  56. #define QDCT_START_SQ_ORIGIN_ALARM 35
  57. #define QDCT_START_XQ_ORIGIN_ALARM 36
  58. #define QDCT_START_SM_ORIGIN_ALARM 37
  59. #define QDCT_YL_LIMIT_ALARM 38
  60. #define QDCT_EX_ALARM 40
  61. #define QDCT_SQ_LIMIT_ALARM 41
  62. #define QDCT_KD_ALARM 42
  63. #define QDCT_SE_BIAO_ALARM 43
  64. #define QDCT_ZIPPER_LENGTH_ALARM 44
  65. #define QDCT_HHSL_LIMIT_ALARM 45
  66. #define QDCT_HHSL_ORIGIN_ALARM 46
  67. #define QDCT_HJLT_ALARM 47
  68. #define QDCT_HZLT_ALARM 48
  69. #define QDCT_CLOK_ALARM 49 //穿链检测警告
  70. #define QDCT_AutoStep cStepMByte
  71. #define QDCT_QZhuangLiaoStep cStepMByte1
  72. #define QDCT_HZhuangLiaoStep cStepMByte2
  73. #define QDCT_MotorStep cStepMByte3
  74. #define QDCT_JiaLianStep cStepMByte4
  75. #define QDCT_XiaQieStep cStepMByte5
  76. #define QDCT_ZhenDongStep cStepMByte6
  77. #define QDCT_QTLTStep cStepMByte7
  78. #define QDCT_HTLTStep cStepMByte8
  79. #define QDCT_QZDPStep cStepMByte9
  80. #define QDCT_HZDPStep cStepMByte10
  81. #define QDCT_TLPStep cStepMByte11
  82. #define QDCT_TuiLianStep cStepMByte12
  83. #define QDCT_HeMoStep cStepMByte13 //合模动作
  84. #define QDCT_MotorStepSave cStepMByte14
  85. #define QDCT_MotorStepY cStepMByte15
  86. #define QDCT_XiaQieDelay cDelayTime1
  87. #define QDCT_QZhuangLiaoDelay cDelayTime2
  88. #define QDCT_HTLT_Delay cDelayTime3
  89. #define QDCT_MotorDelay cDelayTime4
  90. #define QDCT_AutoDelay cDelayTime5
  91. #define QDCT_TableDelay cDelayTime6
  92. #define QDCT_QZhenDongDelay cDelayTime7
  93. #define QDCT_HZhuangLiaoDelay cDelayTime8
  94. #define QDCT_JD_Delay cDelayTime9
  95. #define QDCT_QTLT_Delay cDelayTime10
  96. #define QDCT_HZhenDongDelay cDelayTime11
  97. #define QDCT_CQDelay cDelayTime12
  98. #define QDCT_TLPDelay cDelayTime13
  99. #define QDCT_TLDelay cDelayTime14
  100. #define QDCT_HeMoDelay cDelayTime15
  101. #define QDCT_TestMotorDelay cDelayTime16
  102. #define QDCT_MotorBackLimitDelay cDelayTime17
  103. #define QDCT_MotorYDelay cDelayTime18
  104. #define QZDPAutoDisable cCharBuff1 //振动盘自动功能关闭
  105. #define HZDPAutoDisable cCharBuff2 //振动盘自动功能关闭
  106. #define QDCT_TOTAL_ADDR 8
  107. #define QDCT_NOWTOTAL_ADDR 10
  108. #define QDCT_SETTOTAL_ADDR 12
  109. #define QDCT_SPEED_ADDR 14
  110. #define QDCT_ALARM_ADDR 100
  111. #define QDCT_PARAM_CYCLE_PULSE user_datas[0]//0 转一圈脉冲数
  112. #define QDCT_PARAM_CYCLE_LENGTH user_datas[1]//1 转一圈拖带多长
  113. #define QDCT_PARAM_TABLE_TIME (user_datas[2]*10)//台面电机工作时间
  114. #define QDCT_PARAM_GO_LOWSPEED user_datas[3] //夹带前进低速
  115. #define QDCT_PARAM_TABLE_NUM user_datas[4]
  116. #define QDCT_PARAM_HSL_DELAY_BACK (user_datas[5]*10)
  117. #define QDCT_PARAM_XQ_UP_LENGTH user_datas[6] //提前输出下切刀长度
  118. #define QDCT_PARAM_HSL_DELAY (user_datas[7]*10)
  119. #define QDCT_PARAM_SET_ZIPPER_LENGTH (user_datas[16] | user_datas[17] << 16)//拉链长度
  120. #define QDCT_PARAM_PUTIN_LENGTH user_datas[18] //穿入长度
  121. #define QDCT_PARAM_JJGO_SPEED user_datas[20] //前进高速
  122. #define QDCT_PARAM_JJFZ_LENGTH user_datas[21] //后退反转速度
  123. #define QDCT_PARAM_JJBACK_SPEED user_datas[22] //后退速度
  124. #define QDCT_PARAM_JJDINGWEI_LENGTH user_datas[23] //前进定位长度
  125. #define QDCT_PARAM_CUT_BACK_LENGTH user_datas[24] //剩余多长松夹子
  126. #define QDCT_PARAM_SJZ_LENGTH user_datas[25] //切断后后退长度
  127. #define QDCT_PARAM_CUT_DELAY (user_datas[26]*10) //延迟下切
  128. #define QDCT_PARAM_CUTBACK_DELAY (user_datas[27]*10) //切断后延时后退
  129. #define QDCT_PARAM_CUTBACK_SPEED user_datas[28] //切断后后退速度
  130. //#define QDCT_PARAM_KL_TIME (user_datas[30]*10) //开链时间
  131. #define QDCT_PARAM_DLP_TIME (user_datas[33]*10) //挡拉片时间
  132. #define QDCT_PARAM_FZ_DELAY (user_datas[34]*10) //延时反转
  133. #define QDCT_PARAM_ZD_WORKNUM user_datas[36]
  134. #define QDCT_PARAM_ZD_WORK_TIME (user_datas[37]*10) //振动盘工作时间
  135. #define QDCT_PARAM_ZD_DELAY_WORK (user_datas[38]*10) //振动盘延时启动
  136. #define QDCT_PARAM_KL_DELAY (user_datas[40]*10)
  137. #define QDCT_PARAM_JD_DELAY (user_datas[41]*10) //延时夹带
  138. #define QDCT_PARAM_ZD_MODE user_datas[42] //振动盘工作模式 0为连续1为间歇工作
  139. #define QDCT_PARAM_CYCLE_DELAY (user_datas[43]*10) //延时启动下一周期
  140. #define QDCT_PARAM_FIRST_SPEED user_datas[44] //第一条慢速度
  141. #define QDCT_PARAM_GO_LOWSPEED_LENGTH user_datas[45] //前进慢速长度
  142. #define QDCT_PARAM_CZ_CHECK_DELAY (user_datas[46]*10) //延时检测拉头触针
  143. #define QDCT_PARAM_LOCK_TIME 0// (user_datas[47]*10) //锁拉头时间
  144. #define QDCT_PARAM_Mold_Distance user_datas[50] //拉链与穿入模间距
  145. #define QDCT_BACK_LOWSPEED_LENGTH user_datas[53] //后退慢速长度后退钩针模式才用
  146. #define QDCT_ZFC_MODE user_datas[51] //正反穿模式
  147. #define QDCT_TL_LENGTH user_datas[54] //推链长度
  148. #define QDCT_ZHA_NO user_datas[55] //扎数
  149. #define QDCT_ZHA_STOP_TIME (user_datas[56]*10) //扎数到停止时间
  150. #define QDCT_BACK_LOWSPEED user_datas[58]
  151. #define QDCT_SEBIAO_LENGTH user_datas[60]
  152. #define QDCT_REMAIN_CHECK_LENGTH user_datas[61]
  153. #define QDCT_PARAM_MAX_BACK_LENGTH user_datas[62]
  154. #define QDCT_PARAM_OFFSET_LENGTH user_datas[63] //修正长度
  155. #define QDCT_PARAM_PUTIN_SPEED_LENGTH user_datas[64]
  156. #define QDCT_PARAN_SJ_TIME user_datas[65]
  157. #define QDCT_PARAM_PUTIN_START_LENGTH user_datas[66]
  158. #define QDCT_PARAM_SL_BACKDELAY (user_datas[67]*10)
  159. #define QDCT_PARAM_FZ_LENGTH user_datas[68]
  160. #define QDCT_PARAM_DELAY_BACK (user_datas[69]*10)
  161. #define QDCT_PARAM_XM_START_TIME user_datas[70] //夹拉头开后延时退下模
  162. #define QDCT_PARAM_FIRSTSPEED user_datas[71]
  163. #define QDCT_PARAM_CHANGE_LT user_datas[72]
  164. #define QDCT_PARAM_PUTIN_LOW_SPEED user_datas[73]
  165. #define QDCT_PARAM_PUTIN_LOW_SPEED_LENGTH user_datas[74] //穿入的慢速长度
  166. #define QDCT_PARAM_DELAY_JLT (user_datas[75]*10)
  167. #define QDCT_PARAM_START_SPEED user_datas[76]
  168. #define QDCT_PARAM_ACC_PULSE user_datas[77]
  169. #define QDCT_PARAM_DEC_PULSE user_datas[78]
  170. #define QDCT_PARAM_LOWSPEED_LENGTH user_datas[79]
  171. #define QDCT_PARAM_CNT_ENABLE_LENGTH user_datas[80]
  172. #define QDCT_PARAM_CQ_TIME (user_datas[81]*10)
  173. #define QDCT_PARAM_TLP_ENABLE user_datas[82]
  174. #define QDCT_PARAM_TLP_TIME (user_datas[83]*10)
  175. #define QDCT_PARAM_TABLE_TIME2 (user_datas[84]*10)//台面电机工作时间
  176. #define QDCT_PARAM_TABLE_NUM2 user_datas[85]
  177. #define QDCT_PARAM_DELAY_SL (user_datas[94]*10)//延时送链
  178. #define QDCT_PARAM_XM_MODE user_datas[95] // 0为下模动 1为下模不动
  179. #define QDCT_PARAM_CS_CONTROL user_datas[96]
  180. #define QDCT_PARAM_CS_ENABLE user_datas[97] //
  181. #define QDCT_PARAM_CS_DELAY (user_datas[98]*10)
  182. #define QDCT_PARAM_CS_TIME (user_datas[99]*10)
  183. #define QDCT_PARAM_CS_COLD_TIME (user_datas[101]*10)
  184. #define QDCT_PARAM_DELAY_KL (user_datas[102]*10)
  185. #define QDCT_PARAM_KL_TIME (user_datas[103]*10)//开链时间
  186. #define QDCT_SEBIAO_TQ_CHECK_LENGTH user_datas[104]
  187. #define QDCT_SEBIAO_HIGH_SPEED user_datas[105]
  188. #define QDCT_SEBIAO_LOW_SPEED user_datas[106]
  189. #define QDCT_SEBIAO_ERROR_LENGHT user_datas[107]
  190. #define QDCT_SEBIAO_BACK_LSPEED_LENGTH user_datas[108]
  191. #define QDCT_SEBIAO_BACK_DW_SPEED user_datas[109]
  192. #define QDCT_PARAM_YLCYCLE_PULSE user_datas[110]//0 转一圈脉冲数
  193. #define QDCT_PARAM_YLCYCLE_LENGTH user_datas[111]//1 转一圈拖带多长
  194. #define QDCT_PARAM_TRANS_LENGTH user_datas[112]
  195. #define QDCT_PARAM_YL_SPEED user_datas[113]
  196. #define QDCT_PARAM_YL_SL_LENGTH user_datas[114]
  197. #define QDCT_PARAM_YL_SL_SPEED user_datas[115]
  198. #define QDCT_PARAM_WAIT_LENGTH user_datas[116]
  199. #define QDCT_PARAM_YL_DELAY (user_datas[117]*10)
  200. #define QDCT_PARAM_YL_SL_DELAY (user_datas[118]*10)
  201. #define QDCT_PARAM_YL_BACK_DELAY (user_datas[119]*10)
  202. #define QDCT_PARAM_YL_FZ_DELAY (user_datas[120]*10)
  203. #define QDCT_PARAM_BACK_DELAY (user_datas[87]*10) //反穿延时后退
  204. #define QDCT_PARAM_TRY_TIMES 2//user_datas[88]
  205. #define QDCT_PARAM_KL_QC_SELECT (user_datas[130]) //开链吹气选择
  206. #define QDCT_CHUAN_LIAN_CHECK_SELECT (user_datas[131])
  207. #define QDCT_PARAM_TB_CNT1 user_datas[200]
  208. #define QDCT_PARAM_TB_CNT2 user_datas[201]
  209. #define QDCT_PARAM_BACK_ALARM_MODE 1 //后退为感应后限
  210. #define QDCT_PARAM_TL_ENABLE 0
  211. //输入定义
  212. #define QDCT_START_IN M0384
  213. #define QDCT_START_IN_UP (M0384 && !OLDM384)
  214. #define QDCT_STOP_IN M0385
  215. #define QDCT_STOP_IN_UP (M0385 && !OLDM385)
  216. #define QDCT_STOP_IN_DW (!M0385 && OLDM385)
  217. #define QDCT_QJLT_IN M0386
  218. #define QDCT_XQ_LIMIT_IN M0387
  219. #define QDCT_SQ_LIMIT_IN M0388
  220. #define QDCT_SL_ORIGIN_IN M0389
  221. #define QDCT_GO_LIMIT_IN M0390
  222. #define QDCT_GO_LIMIT_IN_UP (M0390 && !OLDM390)
  223. #define QDCT_BACK_LIMIT_IN M0391
  224. #define QDCT_BACK_LIMIT_IN_UP (M0391 && !OLDM391)
  225. #define QDCT_QHSL_ORIGIN_IN M0392
  226. #define QDCT_QHSL_LIMIT_IN M0393
  227. #define QDCT_QHSL_LIMIT_IN_DW (!M0393 && OLDM393)
  228. #define QDCT_QLTCZ_IN M0394
  229. #define QDCT_XM_LIMIT_IN M0395
  230. #define QDCT_XM_ORIGIN_IN M0396
  231. #define QDCT_XM_ORIGIN_IN_UP (M0396 && !OLDM396)
  232. #define QDCT_KA_DAI_IN !M0397
  233. #define QDCT_KA_DAI_IN_DW (!M0397 && OLDM397)
  234. #define QDCT_CHUAN_LIAN_OK M0398//X20 //检测拉链是否穿入成功
  235. #define QDCT_CHUAN_LIAN_OK_UP (M0398 && !OLDM398)//(X20 && !OLDX20)
  236. #define QDCT_SEBIAO_IN M0399 //X21 //空信号
  237. #define QDCT_SEBIAO_IN_UP (M0399 && !OLDM399) //(X21 && !OLDX21)
  238. #define QDCT_SEBIAO_IN_DW (!M0399 && OLDM399) //(!X21 && OLDX21)
  239. #define QDCT_NO_ZIPPER_CHECK_IN M0400
  240. #define QDCT_QZDP_IN M0401
  241. #define QDCT_QTLT_LIMIT_IN M0402
  242. #define QDCT_HJLT_IN M0403
  243. #define QDCT_HHSL_ORIGIN_IN M0404
  244. #define QDCT_HHSL_LIMIT_IN M0405
  245. #define QDCT_HHSL_LIMIT_IN_DW (!M0405 && OLDM405)
  246. #define QDCT_HLTCZ_IN M0406
  247. #define QDCT_HZDP_IN M0407
  248. #define QDCT_HTLT_LIMIT_IN M0408
  249. #define QDCT_YL_LIMIT_IN M0409
  250. #define QDCT_XQ_ORIGIN_IN M0410
  251. //输出定义
  252. #define QDCT_QHSL_OUT M0352 //Y00 前横送拉头
  253. #define QDCT_QJLT_OUT M0353 //Y01 前夹拉头
  254. #define QDCT_JD_OUT M0354 //Y04 夹带
  255. #define QDCT_XM_OUT M0355 //Y05 下模
  256. #define QDCT_SZ_OUT M0356 //Y06 夹带电机松轴
  257. #define QDCT_XQ_OUT M0357 //Y07 下切刀
  258. #define QDCT_SL_OUT M0358 //Y07 送链
  259. #define QDCT_SQ_OUT M0359 //Y10 上切刀
  260. #define QDCT_KL_OUT M0360 //Y11 破链
  261. #define QDCT_TB_OUT M0361 //Y12 台面电机
  262. #define QDCT_YD_OUT M0362 //Y13 压带
  263. #define QDCT_CQ_OUT M0363 //Y14 吹气
  264. #define QDCT_CS_OUT M0364 //Y15A/B 超声/增压
  265. #define QDCT_QTLT_OUT M0365 //EY00 前推拉头
  266. #define QDCT_QZDP_OUT M0366 //EY02 前振动盘
  267. #define QDCT_TLP_OUT M0367 //EY04 推拉片
  268. #define QDCT_QDLP_OUT M0368 //EY05 前挡拉头
  269. #define QDCT_STATE_RUN M0369 //运行灯
  270. #define QDCT_STATE_ERROR M0370 //警告灯
  271. #define QDCT_HHSL_OUT M0371 //Y02 后横送拉头
  272. #define QDCT_HJLT_OUT M0372 //Y03 后夹拉头
  273. #define QDCT_HTLT_OUT M0373 //EY01 后推拉头
  274. #define QDCT_HZDP_OUT M0374 //EY03 后振动盘
  275. #define QDCT_HDLP_OUT M0375 //EY06 后挡拉头
  276. #define QDCT_YL_OUT M0376
  277. //#define QDCT_JJ_DIR M0328
  278. //#define QDCT_YL_DIR M0329
  279. //M0~M4全局固定使用
  280. /*
  281. #define bRunning M0000
  282. #define bStart M0001
  283. #define bStop M0002
  284. #define bAlarmStop M0003
  285. #define bClearTotal M0004
  286. */
  287. #define QDCT_bClerNowTotal M0005
  288. #define QDCT_bQianDianDW M0006
  289. #define QDCT_bGeiLT M0007
  290. #define QDCT_bTestMode M0008
  291. #define QDCT_bQieDuan M0009
  292. #define QDCT_bOnceStart M0010
  293. #define QDCT_bQZuangLT M0013
  294. #define QDCT_bHZuangLT M0014
  295. #define QDCT_bHeMo M0015
  296. #define QDCT_bChuanLT M0016
  297. #define QDCT_bSaveWorkState M0017
  298. #define QDCT_bWorkMode M0018
  299. #define QDCT_bAlarmStop M0019
  300. #define QDCT_bTable M0020
  301. #define QDCT_bCheckDinWei M0021
  302. #define QDCT_bManXQ M0051 //控制下切刀
  303. #define QDCT_bManXM M0052
  304. #define QDCT_bMotorGo M0053
  305. #define QDCT_bMotorBack M0054
  306. #define QDCT_bManSQ M0055 //控制上切刀
  307. #define QDCT_bManJD M0056
  308. #define QDCT_bManQHSL M0057
  309. #define QDCT_bManHHSL M0058
  310. #define QDCT_bManQZD M0059
  311. #define QDCT_bManHZD M0060
  312. #define QDCT_bManQJLT M0061
  313. #define QDCT_bManHJLT M0062
  314. #define QDCT_bManSZ M0063
  315. #define QDCT_bManQTLT M0064
  316. #define QDCT_bManHTLT M0065
  317. #define QDCT_bManYD M0066
  318. #define QDCT_bManCQ M0067
  319. #define QDCT_bManDLP M0068
  320. #define QDCT_bYLGO M0069
  321. #define QDCT_bYLBACK M0070
  322. #define QDCT_bYL M0071
  323. #define QDCT_bManKL M0072
  324. #define QDCT_bManCS M0073
  325. #define QDCT_bReset_Origin M0074
  326. #define QDCT_bTest M0075
  327. #endif
  328. #endif