GLQueduan_newstr_CSNew.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387
  1. #ifndef GLQUEDUAN_NEWSTR_CSNEW_H
  2. #define GLQUEDUAN_NEWSTR_CSNEW_H
  3. #if (CHANG_SHENG_GEI_LI_MACHINE==1)
  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 QDN_DIR_P 1
  9. #define QDN_DIR_N 0
  10. #define PP_NoStop 1
  11. #define PP_Stop 0
  12. #define QDN_YDIR_P 1
  13. #define QDN_YDIR_N 0
  14. #define QDN_MOTOR_EN 1
  15. #define QDN_MOTOR_DIS 0
  16. #define CT_WORKTOTAL_ADDR 102
  17. #define QDN_TOTAL_ADDR 76
  18. #define QDN_ALARM_ADDR 100
  19. #define QDN_PROSPEED_ADDR 78
  20. #define QDN_PARAM_ZIPPER_LENGTH_ADDR 1
  21. #define QDN_BACK_INDUCTION_MODE 0 //后退纯感应方式
  22. #define QDN_BACK_MEMORY_MODE 1 //后退记忆长度方式
  23. #define QDN_BACK_INPUT_LENGTH_MODE 2 //后退手动输入长度方式
  24. #define QDN_BACK_NOMAL_DEC_MODE 0 //后退感应减速方式
  25. #define QDN_BACK_DIGITAL_MODE 1 //后退数控减速方式
  26. #define QDN_SK_MODE 0 //1为双开
  27. #define QDN_KB_MODE 0 //1为闭口 ,0开口(一字切)
  28. /*
  29. * 警告类型 警告编号
  30. */
  31. #define QDN_NO_ALARM 0 /* 没警告*/
  32. #define QDN_NO_ZIPPER_ALARM 1 /* 没拉链,自动停机*/
  33. #define QDN_KA_DAI_ALARM 2 /* 卡带异常*/
  34. #define QDN_SM_YUANWEI 3 /* 上模上限位*/ //
  35. #define QDN_SM_DAOWEI 4 /* 上模到位异常(下限位)*/
  36. #define QDN_XM_YUANWEI 5 /* 下模下限位*/
  37. #define QDN_XM_DAOWEI 6 /* 下模到位异常(上限位)*/
  38. #define QDN_BACK_ALARM 7
  39. #define QDN_TOTAL_ALARM 8
  40. #define QDN_TL_ALARM 9
  41. #define QDN_GZ_ALARM 10 //勾针
  42. #define QDN_JD_ORIGIN_ALARM 11
  43. #define QDN_DEC_ALARM 12
  44. #define QDN_QIAN_LIMIT_ALARM 13 //前限位出错
  45. #define QDN_BL_ALARM 17
  46. #define QDN_SM_ALARM 18
  47. #define QDN_LENGTH_LONG_ALARM 19
  48. #define QDN_LENGTH_SHORT_ALARM 20
  49. #define QDN_PARAM_RUN_LENGTH_ALARM 21 //超出轨道运行长度
  50. #define QDN_PARAM_ANQUANMEN_ALARM 22 //安全门未关闭
  51. #define VAVLE_ALARM_TIME 3000
  52. #define MOTOR_ALARM_TIME 5000
  53. #define QDN_PARAM_FIRST_SPEED 5000
  54. #define QDN_PARAM_GZ_DELAY (user_datas[0]*10)
  55. #define QDN_PARAM_ZIPPER_LENGTH (user_datas[1] | (user_datas[2] >> 16))
  56. #define QDN_PARAM_TL_DELAY 20//(user_datas[3]*10)
  57. #define QDN_PARAM_YD_DELAY 0//(user_datas[4]*10)
  58. #define QDN_PARAM_BACK_LOW_SPEED_LENGTH user_datas[6] //后拉慢速长度
  59. #define QDN_PARAM_CUT_DELAY (user_datas[7]*10) //延时切断
  60. #define QDN_PARAM_CUT_BACK_DELAY (user_datas[8]) //切断后延时后拉
  61. #define QDN_PARAM_KAIBEE_SELECT user_datas[9] //开闭口选择(0 开口,1 闭口)
  62. #define QDN_PARAM_CS_COLD_TIME (user_datas[10] * 10) //固化时间
  63. #define QDN_PARAM_ZS_STOP_TIME (user_datas[11] * 10) //扎数到停止时间
  64. #define QDN_PARAM_DELAY_BACK (user_datas[12]*10) //延时后拉
  65. #define QDN_PARAM_CYCLE_DELAY (user_datas[14]*10) //延时下一条
  66. #define QDN_PARAM_GO_HIGH_SPEED user_datas[15] //前进最高速
  67. #define QDN_PARAM_GO_LOW_SPEED_LENGTH user_datas[16] //前进低速长度
  68. #define QDN_PARAM_GO_LOW_SPEED user_datas[17] //前进最低速度
  69. #define QDN_PARAM_BACK_SPEED user_datas[18] //后拉速度
  70. #define QDN_PARAM_BACK_LENGTH user_datas[19] ////松夹子长度后走的长度
  71. #define QDN_PARAM_DELAY_CS (user_datas[20] * 10) //延时超声
  72. #define QDN_PARAM_CS_TIME (user_datas[21] * 10) //超声时间
  73. #define QDN_PARAM_FZ_LENGTH user_datas[22] //闭口反转长度
  74. #define QDN_PARAM_TB_TIME (user_datas[23]*10) //台面时间
  75. #define QDN_PARAM_OFFSET_LENGTH user_datas[24] //修正长度
  76. #define QDN_PARAM_CUT_BACK_SPEED user_datas[26] //切断后拉带速度
  77. #define QDN_PARAM_SJZ_LENGTH user_datas[27] //松夹子长度
  78. #define QDN_PARAM_MOTOR_SELECT user_datas[28] //电机选择 (0 步进 , 1 伺服)(主要是松轴使能不一样)
  79. #define QDN_PARAM_BACK_MODE user_datas[30] //后退方式 1为记忆长度,0为感应方式(暂时不用)
  80. #define QDN_PARAM_HL_ENABLE user_datas[33] //护链()
  81. #define QDN_PARAM_XM_ENABLE user_datas[35] //0下模动 1下模不动
  82. #define QDN_PARAM_CS_MODE user_datas[36] //0为气切1为超声切
  83. #define QDN_PARAM_CYCLE_LENGTH user_datas[38] //电机周长
  84. #define QDN_PARAM_CYCLE_PULSE user_datas[39] //电机细分
  85. #define QDN_PARAM_TABLE_NUM user_datas[40] //台面动作条数
  86. #define QDN_PARAM_MOTOR_DELAY_LENGTH user_datas[41] //((unsigned long)user_datas[41] * user_datas[39]/user_datas[38]) //算出脉冲值
  87. #define QDN_PARAM_TFK_DELAY (user_datas[44]*10) //延时推方块
  88. #define QDN_PARAM_START_SPEED user_datas[45] //启动速度
  89. #define QDN_PARAM_ACC user_datas[46] //加速度
  90. #define QDN_PARAM_DCC user_datas[47] //减速度
  91. #define QDN_PARAM_CHECK_BACK_HSPEED user_datas[48] //后拉走链最高速度
  92. #define QDN_PARAM_CHECK_BACK_LSPEED user_datas[49] //后拉走链空位速度
  93. #define QDN_PARAM_DELAY_CHECK 100//user_datas[50] //
  94. #define QDN_PARAM_YALIAN_LENGTH user_datas[53] //提前压并链长度 (双开用)
  95. #define QDN_PARAM_GOUZHEN_LENGTH user_datas[54] //提前上勾针长度
  96. #define QDN_PARAM_TIAOSHI_MODE user_datas[55] //调试模式(暂不用)
  97. #define QDN_PARAM_DELAY_HL_LENGTH user_datas[56] //合链动作长度
  98. #define QDN_PARAM_BL_ENABLE user_datas[57] //并链就是合链
  99. #define QDN_PARAM_DELAY_XM (user_datas[58]*10)
  100. #define QDN_PARAM_DELAY_XM_LENGTH user_datas[59]
  101. #define QDN_PARAM_BACK_LOW_SPEED user_datas[60]
  102. #define QDN_PARAM_DEC_MODE 1//user_datas[61]//0为使用感应减速 1后退使用数控降速
  103. #define QDN_PARAM_LT_ENABLE user_datas[62]
  104. #define QDN_PARAM_NO_LT_DELAY_CHECK user_datas[63]
  105. #define QDN_PARAM_ERROR_LENGTH user_datas[64] //长度允许误差
  106. #define QDN_PARAM_DELAYBACK_SM (user_datas[65])
  107. //#define QDN_PARAM_TC_LENGTH user_datas[67]
  108. //#define QDN_PARAM_FIRST_GO_HIGHSPEED user_datas[69]
  109. #define QDN_PARAM_LENGTH_MODE 1//user_datas[70] //实则不用
  110. //#define QDN_PARAM_FIRST_BACK_LOWSPEED user_datas[71] //不用
  111. #define QDN_PARAM_SET_TOTAL 0//(user_datas[74] | (user_datas[75] >> 16))
  112. #define QDN_PARAM_CS_ENABLE 1//user_datas[80]
  113. #define QDN_PARAM_TD_DELAY (user_datas[81]*10)
  114. #define QDN_PARAM_TD_TIME (user_datas[82]*10)
  115. #define QDN_PARAM_DELAY_CHECK_GZ (user_datas[83])
  116. #define QDN_PARAM_NOW_CNT user_datas[84]
  117. #define QDN_PARAM_ZHA_SHU user_datas[85]
  118. #define QDN_PARAM_HL_DELAY_BACK user_datas[86] //合链延时退
  119. #define QDN_PARAM_RUN_LENGTH (user_datas[87]) //轨道运行长度
  120. #define QDN_PARAM_TFK_NUMBER user_datas[88] // 推方块次数
  121. #define QDN_PARAM_BKGZ_NUMBER user_datas[89] // 闭口有无钩针模式
  122. #define QDN_PARAM_BKGY_LENGTH user_datas[90] // 闭口感应后再走长度
  123. #define QDN_PARAM_SecondDAO_LENGTH user_datas[91] // 第二刀拖带长度
  124. #define QDN_PARAM_Secondleave_LENGTH user_datas[92] // 第二刀松夹子后再走长度
  125. #define QDN_PARAM_KKQIANDIAN_LENGTH user_datas[93] // 开口前点感应再走长度
  126. #define QDN_PARAM_BKQIANDIAN_LENGTH user_datas[94] // 闭口前点感应再走长度
  127. #define QDN_PARAM_FEEL_GZ_DELAY user_datas[95] //感应延时上钩针
  128. #define QDN_PARAM_YD_FZ_DELAY (user_datas[96]*10) //压带后延时反转
  129. #define QDN_PARAM_TFK_SELECT user_datas[97] //切断后推方块选择(0 退,1 不退)
  130. #define QDN_PARAM_TL_MODE 0
  131. #define QDN_PARAM_ON_BACK_LENGTH 3000
  132. #define QDN_AutoDelay cDelayTime1
  133. #define QDN_MotorDelay cDelayTime2
  134. #define QDN_XiaQieDelay cDelayTime3
  135. #define QDN_KaDaiDelay cDelayTime4
  136. #define QDN_CSDelay cDelayTime5
  137. #define QDN_TBDelay cDelayTime6
  138. #define QDN_TFKDelay cDelayTime7
  139. #define QDN_TLDelay cDelayTime8
  140. #define QDN_TuiDaiDelay cDelayTime9
  141. #define QDN_AlarmDelay cDelayTime10
  142. #define QDN_SJDelay cDelayTime11
  143. #define QDN_SecondXQDelay cDelayTime12
  144. #define QDN_BingLianDelay cDelayTime13
  145. #define QDN_AutoStep cStepMByte
  146. #define QDN_MotorStep cStepMByte1
  147. #define QDN_XiaQieStep cStepMByte2
  148. #define QDN_YuanDianStep cStepMByte3
  149. #define QDN_TuiLianStep cStepMByte4
  150. #define QDN_CheckLengthStep cStepMByte5
  151. #define QDN_BinLianStep cStepMByte6
  152. #define QDN_TuiDaiStep cStepMByte7
  153. #define QDN_SecondXiaQueStep cStepMByte8
  154. //超声花边切,开口,开闭口二合一输入输出
  155. #define QDN_START_IN M0384//X00 启动
  156. #define QDN_START_IN_UP (M0384 && !OLDM384)
  157. #define QDN_STOP_IN M0385//X01 停止
  158. #define QDN_STOP_IN_UP (M0385 && !OLDM385)
  159. #define QDN_GUO_LIAN_IN M0386//X02 过链感应
  160. #define QDN_GUO_LIAN_IN_UP (M0386 && !OLDM386)
  161. #define QDN_GUO_LIAN_IN_DW (!M0386 && OLDM386)
  162. #define QDN_GOUZHEN_HOU_IN M0387//X03 钩针后点信号
  163. #define QDN_GOUZHEN_QIAN_IN M0388//X04 钩针到位
  164. #define QDN_QIAN_LIMIT_IN M0389//X05 前进限位
  165. #define Q2 M0390//X06 前进减速感应
  166. #define QDN_BACK_LIMIT_IN M0391//X07 后退限位
  167. #define Q3 M0392//X10 夹带前限位
  168. #define QDN_SHANG_MU_ORIGIN M0393//X11 上模上限位
  169. #define QDN_SHANG_MU_LIMIT_IN M0394//X12 上模下限位
  170. #define Q4 M0395//X13 送链前到位
  171. #define QDN_MAN_GOUZHEN_IN M0396//X14 手动钩针
  172. #define QDN_MAN_GOUZHEN_IN_UP (M0396 && !OLDM396)
  173. #define QDN_MAN_TUIDAI_IN M0397//X15 手动推带
  174. #define QDN_MAN_TUIDAI_IN_UP (M0397 && !OLDM397)
  175. #define QDN_MAN_QIEDUAN_IN M0398//X16 手动切断
  176. #define QDN_MAN_QIEDUAN_IN_UP (M0398 && !OLDM398)
  177. #define QDN_KAIKUO_XIAMO_LIMIT_IN M0399//X17 下模上到位
  178. #define QDN_XIA_MU_LIMIT_IN M0399//X17 闭口下模到位
  179. #define Q8 M0400//X20 储带结束
  180. #define QDN_ANQUANMEN_LIMIT_IN M0401//X21 计数到信号输入(有屏时接安全门信号)
  181. //输出
  182. #define QDN_GZ_VAVLE M0352//Y00 钩针电磁阀
  183. #define QDN_YD_VAVLE M0353//Y01 压带
  184. #define QDN_JD_VAVLE M0354//Y02 夹子气缸
  185. #define QDN_TFK_VAVLE M0355//Y03 推方块
  186. #define QDN_SM_VAVLE M0356//Y04 上模
  187. #define QDN_XM_VAVLE M0357//Y05 闭口下模
  188. #define QDN_XM_KAIKOU_VAVLE M0358//Y06 开口下模
  189. #define QDN_TABLE_VAVLE M0359//Y07 台面电机
  190. #define QDN_CS_OUT M0360//Y10 超声波
  191. #define QDN_GZDW_OUT M0361//Y11 闭口钩针定位块
  192. #define QDN_BL_VAVLE M0362//Y12 并链
  193. #define Q21 M0363//Y13
  194. #define Q41 M0364//Y14
  195. #define QDN_SZ_OUT M0365//Y15 锁轴
  196. #define Q61 M0379
  197. #define Q31 M0380
  198. #define QDN_ALARE_OUT M0381
  199. #define QDN_DGLG_VAVLE M0382 //顶过链杆
  200. #define QDN_TL_VAVLE M0383
  201. #if QDN_KB_MODE //闭口
  202. #if 0
  203. // #define QDN_PARAM_XM_ENABLE 1//user_datas[35] //0下模动 1下模不动
  204. //#define QDN_QIAN_DEC_IN 0
  205. //#define QDN_QIAN_DEC_IN_UP 0
  206. //#define QDN_BACK_LIMIT_IN X07
  207. //#define QDN_BACK_LIMIT_IN_UP (X07 && !OLDX07)
  208. //#define QDN_JD_ORIGIN_IN X10
  209. //#define QDN_SHANG_MU_ORIGIN_IN X11
  210. // #define QDN_JZ_DIR Y01 //电机方向 io_outputs[1].bits.b2
  211. // #define QDN_SL_VAVLE Y06 //送链
  212. #define QDN_YY_OUT Y00 //液压
  213. #define QDN_WARMMING_LED Y14 //警告
  214. //下面为程序编译用,空输出输入
  215. #define QDN_XIA_MU_LIMIT_IN 1 //X13
  216. // #define QDN_XM_VAVLE Y30
  217. #define QDN_HL_VAVLE Y31 //护链
  218. #define QDN_YX_VAVLE Y32 //压带
  219. #define QDN_TFK_VAVLE Y33 //
  220. #endif
  221. #else //开口
  222. #if 0
  223. // #define QDN_JZ_DIR Y01 //电机方向
  224. #define QDN_SZ_OUT Y02 //电机使能
  225. // #define QDN_JD_VAVLE Y05 //夹子气缸
  226. // #define QDN_SM_VAVLE Y06 //上模
  227. // #define QDN_YD_VAVLE Y07 //压带
  228. #define QDN_TL_VAVLE Y10 //送链(和下模共用)
  229. // #define QDN_BL_VAVLE Y11 //合链(并链)
  230. #define QDN_TABLE_VAVLE Y12 //台面电机
  231. #define QDN_CS_OUT Y15 //超声波
  232. #define QDN_WARMMING_LED Y14 //警告
  233. //下面为程序编译用,空输出输入
  234. #define QDN_HL_VAVLE Y31 //护链
  235. #define QDN_YX_VAVLE Y32 //压带
  236. #endif
  237. #endif
  238. /*
  239. //双开
  240. #define QDN_GZ_UP_IN X16 //勾针上到位
  241. #define QDN_HL_VAVLE Y12 //护链
  242. #define QDN_YX_VAVLE Y14 //压布带
  243. //推方块气切新增输入输出
  244. //没有下模以及下模上限X17 Y06
  245. //没有超声输出Y10 没有压带Y01
  246. //
  247. #define QDN_TFK_VAVEL Y03
  248. #define QDN_TL_VAVLE Y05
  249. #define QDN_YBD_VAVLE Y14
  250. #define QDN_JZ_DIR Y12
  251. #define QDN_BL_VAVLE Y11 //并链
  252. */
  253. //M0~M4全局固定使用
  254. /*
  255. #define bRunning M0000
  256. #define bStart M0001
  257. #define bStop M0002
  258. #define bAlarmStop M0003
  259. #define bClearTotal M0004
  260. */
  261. #define QDN_bSM M0006 //上模
  262. #define QDN_bXM M0007 //下模
  263. #define QDN_bClearTotal M0008 //产量清零
  264. #define QDN_bXiaQie M0009 //下切
  265. #define QDN_bQianDianDW M0010 //前点定位
  266. #define QDN_bChaoSheng M0011 //超声
  267. #define QDN_bJiaDai M0012 //夹带
  268. #define QDN_bGoMotor M0013 //电机前进
  269. #define QDN_bBackMotor M0014 //电机后退
  270. #define QDN_bTL M0015 //推链(送链)
  271. #define QDN_bYD M0016 //压带
  272. #define QDN_bGZ M0017 //勾针
  273. #define QDN_bJD M0018 //夹带
  274. #define QDN_bHL M0019 //护链
  275. #define QDN_bYuanDianDW M0020 //不用
  276. #define QDN_bTestCS M0021 //超声测试
  277. #define QDN_bSingle M0022
  278. #define QDN_bTFK M0023 //推方块
  279. #define QDN_bTB M0024 //台面
  280. #define QDN_bYBD M0025
  281. #define QDN_bClearNowTotal M0026 //产量清零
  282. #define QDN_bTS M0027
  283. #define QDN_bBL M0028 //并链(合链)
  284. #define QDN_bYX M0029
  285. #define QDN_bTiaoShiStep M0041
  286. #define QDN_bTiaoShiMode M0040
  287. #define QDN_SAFE_IN M0042
  288. #endif
  289. #endif