XYQueduanChuantou.h 16 KB

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