JHQueduanChuantou.h 16 KB

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