JXSKQueDuanJi.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  1. #ifndef __SKQUE_DUAN_JI_H__
  2. #define __SKQUE_DUAN_JI_H__
  3. #if JU_XING_MACHINE==1
  4. extern void SK_QueDuan_Action(void);
  5. extern void SK_QueDuan_InitAction(void);
  6. extern void SK_QueDuanEx_ExtiActionX31(void);
  7. extern void SK_FastTimerAction(void);
  8. #define SKQD_DIR_P 1
  9. #define SKQD_DIR_N 0
  10. #define PP_NoStop 1
  11. #define PP_Stop 0
  12. #define SKQD_YDIR_P 1
  13. #define SKQD_YDIR_N 0
  14. #define CT_WORKTOTAL_ADDR 102
  15. #define SKQD_TOTAL_ADDR 76
  16. #define SKQD_ALARM_ADDR 100
  17. #define SKQD_PROSPEED_ADDR 78
  18. #define SKQD_PARAM_ZIPPER_LENGTH_ADDR 1
  19. #define SKQD_BACK_INDUCTION_MODE 0 //后退纯感应方式
  20. #define SKQD_BACK_MEMORY_MODE 1 //后退记忆长度方式
  21. #define SKQD_BACK_INPUT_LENGTH_MODE 2 //后退手动输入长度方式
  22. #define SKQD_BACK_NOMAL_DEC_MODE 0 //后退感应减速方式
  23. #define SKQD_BACK_DIGITAL_MODE 1 //后退数控减速方式
  24. #define SKQD_SK_MODE 0 //1为双开
  25. #define SKQD_KB_MODE 1 //1为闭口 ,0开口(一字切)
  26. /*
  27. * 警告类型 警告编号
  28. */
  29. #define SKQD_NO_ALARM 0 /* 没警告*/
  30. #define SKQD_NO_ZIPPER_ALARM 1 /* 没拉链,自动停机*/
  31. #define SKQD_KA_DAI_ALARM 2 /* 卡带异常*/
  32. #define SKQD_SM_YUANWEI 3 /* 上模上限位*/ //
  33. #define SKQD_SM_DAOWEI 4 /* 上模下限位*/
  34. #define SKQD_XM_YUANWEI 5 /* 下模上限位*/
  35. #define SKQD_XM_DAOWEI 6 /* 下模下限位*/
  36. #define SKQD_BACK_ALARM 7
  37. #define SKQD_TOTAL_ALARM 8
  38. #define SKQD_TL_ALARM 9
  39. #define SKQD_GZ_ALARM 10 //勾针
  40. #define SKQD_JD_ORIGIN_ALARM 11
  41. #define SKQD_DEC_ALARM 12
  42. #define SKQD_QIAN_LIMIT_ALARM 13 //前限位出错
  43. #define SKQD_BL_ALARM 17
  44. #define SKQD_SM_ALARM 18
  45. #define SKQD_LENGTH_LONG_ALARM 19
  46. #define SKQD_LENGTH_SHORT_ALARM 20
  47. #define SKQD_PARAM_RUN_LENGTH_ALARM 21 //超出轨道运行长度
  48. #define SKQD_PARAM_ANQUANMEN_ALARM 22
  49. #define VAVLE_ALARM_TIME 3000
  50. #define MOTOR_ALARM_TIME 5000
  51. #define SKQD_PARAM_GZ_DELAY (user_datas[0]*10)
  52. #define SKQD_PARAM_ZIPPER_LENGTH (user_datas[1] | (user_datas[2] >> 16))
  53. #define SKQD_PARAM_TL_DELAY 20//(user_datas[3]*10)
  54. #define SKQD_PARAM_YD_DELAY 20//0//(user_datas[4]*10)
  55. #define SKQD_PARAM_BACK_LOW_SPEED_LENGTH user_datas[6] //后拉慢速长度
  56. #define SKQD_PARAM_CUT_DELAY (user_datas[7]*10)
  57. #define SKQD_PARAM_CUT_BACK_DELAY (user_datas[8])
  58. #define SKQD_PARAM_FIRST_SPEED user_datas[9]
  59. #define SKQD_PARAM_CS_COLD_TIME (user_datas[10] * 10) //固化时间
  60. #define SKQD_PARAM_ZS_STOP_TIME (user_datas[11] * 10)
  61. #define SKQD_PARAM_DELAY_BACK (user_datas[12]*10)
  62. #define SKQD_PARAM_CYCLE_DELAY (user_datas[14]*10)
  63. #define SKQD_PARAM_GO_HIGH_SPEED user_datas[15]
  64. #define SKQD_PARAM_GO_LOW_SPEED_LENGTH user_datas[16]
  65. #define SKQD_PARAM_GO_LOW_SPEED user_datas[17]
  66. #define SKQD_PARAM_BACK_SPEED user_datas[18] //后拉速度
  67. #define SKQD_PARAM_BACK_LENGTH user_datas[19] ////松夹子长度后走的长度
  68. #define SKQD_PARAM_DELAY_CS (user_datas[20] * 10) //延时超声
  69. #define SKQD_PARAM_CS_TIME (user_datas[21] * 10) //超声时间
  70. #define SKQD_PARAM_FZ_LENGTH user_datas[22] //反转长度
  71. #define SKQD_PARAM_TB_TIME (user_datas[23]*10)
  72. #define SKQD_PARAM_OFFSET_LENGTH user_datas[24] //修正长度
  73. #define SKQD_PARAM_CUT_BACK_SPEED user_datas[26] //切断后拉带速度
  74. #define SKQD_PARAM_SJZ_LENGTH user_datas[27] //松夹子长度
  75. #define SKQD_PARAM_BACK_MODE user_datas[30] //后退方式 1为记忆长度,0为感应方式
  76. #define SKQD_PARAM_HL_ENABLE user_datas[33] //护链()
  77. #define SKQD_PARAM_XM_ENABLE user_datas[35] //0下模动 1下模不动
  78. #define SKQD_PARAM_CS_MODE user_datas[36] //0为气切1为超声切
  79. #define SKQD_PARAM_CYCLE_LENGTH user_datas[38] //电机周长
  80. #define SKQD_PARAM_CYCLE_PULSE user_datas[39] //电机细分
  81. #define SKQD_PARAM_TABLE_NUM user_datas[40] //台面动作条数
  82. #define SKQD_PARAM_MOTOR_DELAY_LENGTH ((unsigned long)user_datas[41] * user_datas[39]/user_datas[38]) //算出脉冲值
  83. #define SKQD_PARAM_TFK_DELAY (user_datas[44]*10) //延时推方块
  84. #define SKQD_PARAM_START_SPEED user_datas[45]
  85. #define SKQD_PARAM_ACC user_datas[46]
  86. #define SKQD_PARAM_DCC user_datas[47]
  87. #define SKQD_PARAM_CHECK_BACK_HSPEED user_datas[48]
  88. #define SKQD_PARAM_CHECK_BACK_LSPEED user_datas[49]
  89. #define SKQD_PARAM_DELAY_CHECK 100//user_datas[50] //
  90. #define SKQD_PARAM_YALIAN_LENGTH user_datas[53] //提前压并链长度 (双开用)
  91. #define SKQD_PARAM_GOUZHEN_LENGTH user_datas[54] //提前上勾针长度
  92. #define SKQD_PARAM_TIAOSHI_MODE user_datas[55]
  93. #define SKQD_PARAM_DELAY_HL_LENGTH user_datas[56]
  94. #define SKQD_PARAM_BL_ENABLE user_datas[57] //并链就是合链
  95. #define SKQD_PARAM_DELAY_XM (user_datas[58]*10)
  96. #define SKQD_PARAM_DELAY_XM_LENGTH user_datas[59]
  97. #define SKQD_PARAM_BACK_LOW_SPEED user_datas[60] //后退最低速度
  98. #define SKQD_PARAM_DEC_MODE 1//user_datas[61]//0为使用感应减速 1后退使用数控降速
  99. #define SKQD_PARAM_LT_ENABLE user_datas[62]
  100. #define SKQD_PARAM_NO_LT_DELAY_CHECK user_datas[63]
  101. #define SKQD_PARAM_ERROR_LENGTH user_datas[64] //长度允许误差
  102. #define SKQD_PARAM_DELAYBACK_SM (user_datas[65])
  103. #define SKQD_PARAM_GouZhen_MODE user_datas[68] //提前退勾针模式
  104. //#define SKQD_PARAM_TC_LENGTH user_datas[67]
  105. //#define SKQD_PARAM_FIRST_GO_HIGHSPEED user_datas[69]
  106. #define SKQD_PARAM_LENGTH_MODE 1//user_datas[70] //实则不用
  107. //#define SKQD_PARAM_FIRST_BACK_LOWSPEED user_datas[71] //不用
  108. #define SKQD_PARAM_SET_TOTAL 0//(user_datas[74] | (user_datas[75] >> 16))
  109. #define SKQD_PARAM_CS_ENABLE 1//user_datas[80]
  110. #define SKQD_PARAM_YaDai_LENGTH user_datas[79] //数控提前压带
  111. #define SKQD_PARAM_HuLian_LENGTH user_datas[80] //数控提前护链
  112. #define SKQD_PARAM_TD_DELAY (user_datas[81]*10)
  113. #define SKQD_PARAM_TD_TIME (user_datas[82]*10)
  114. #define SKQD_PARAM_DELAY_CHECK_GZ (user_datas[83])
  115. #define SKQD_PARAM_NOW_CNT user_datas[84]
  116. #define SKQD_PARAM_ZHA_SHU user_datas[85]
  117. #define SKQD_PARAM_HL_DELAY_BACK user_datas[86] //合链延时退
  118. #define SKQD_PARAM_RUN_LENGTH (user_datas[87]) //轨道运行长度
  119. #define SKQD_PARAM_TFK_NUMBER user_datas[88] // 推方块次数
  120. #define SKQD_PARAM_STOP_TIME user_datas[89] //停机时间
  121. #define SKQD_PARAM_TDYS_DELAY user_datas[90]*10
  122. #define SKQD_PARAM_ChuiQi_TIME (user_datas[91]*10) //吹气时间
  123. #define SKQD_PARAM_TTFK_TIME (user_datas[92]*10) //退推方块时间
  124. #define SKQD_PARAM_QDW_LENGTH user_datas[93] //前点定位后再走长度
  125. //#define SKQD_PARAM_DK_LENGTH user_datas[94] //刀口长度
  126. #define SKQD_PARAM_WC_LENGTH user_datas[95] //拉链误差长度
  127. #define SKQD_PARAM_FD_TIME user_datas[96] //防抖时间
  128. #define SKQD_PARAM_GouZhen_Delay (user_datas[97]*10) //延时输出勾针
  129. #define SKQD_PARAM_YaDai_Delay (user_datas[98]*10) //延时输出压带
  130. #define SKQD_PARAM_HuLian_Delay (user_datas[99]*10) //延时输出护链
  131. #define SKQD_PARAM_TL_MODE 0
  132. #define SKQD_PARAM_ON_BACK_LENGTH 3000
  133. #define SKQD_AutoDelay cDelayTime1
  134. #define SKQD_MotorDelay cDelayTime2
  135. #define SKQD_XiaQieDelay cDelayTime3
  136. #define SKQD_KaDaiDelay cDelayTime4
  137. #define SKQD_CSDelay cDelayTime5
  138. #define SKQD_TBDelay cDelayTime6
  139. #define SKQD_TFKDelay cDelayTime7
  140. #define SKQD_TLDelay cDelayTime8
  141. #define SKQD_TuiDaiDelay cDelayTime9
  142. #define SKQD_AlarmDelay cDelayTime10
  143. #define SKQD_SJDelay cDelayTime11
  144. #define SKQD_TableDelay cDelayTime12
  145. #define SKQD_StopCodeDelay cDelayTime13
  146. #define SKQD_ChuiQiDelay cDelayTime14
  147. #define SKQD_GouZhenDelay cDelayTime15
  148. #define SKQD_YADaiDelay cDelayTime16
  149. #define SKQD_HuLianDelay cDelayTime17
  150. #define SKQD_AutoStep cStepMByte
  151. #define SKQD_MotorStep cStepMByte1
  152. #define SKQD_XiaQieStep cStepMByte2
  153. #define SKQD_YuanDianStep cStepMByte3
  154. #define SKQD_TuiLianStep cStepMByte4
  155. #define SKQD_CheckLengthStep cStepMByte5
  156. #define SKQD_BinLianStep cStepMByte6
  157. #define SKQD_TuiDaiStep cStepMByte7
  158. #define SKQD_StopStep cStepMByte8
  159. #define SKQD_CHUIQIStep cStepMByte9
  160. //8位变量
  161. #define cCheckLianFlg cCharBuff1
  162. #define cCheckLianFlgEN cCharBuff2
  163. #define cGoLimitEn cCharBuff3
  164. #define cTABLETOTAL cCharBuff4
  165. #define cTABLETIME cCharBuff5
  166. #define cDLJ_ATUO cCharBuff6
  167. #define cSTOPONE cCharBuff7
  168. #define cStopMode cCharBuff8
  169. #define cZhouWanone cCharBuff9
  170. #define SKQD_RMONE cCharBuff10
  171. #define DCC_TIME_BL cCharBuff11
  172. #define cZipCnt cCharBuff12
  173. #define cTableCnt cCharBuff13
  174. #define cTuiFangKuaiCnt cCharBuff14
  175. #define SK_cSTOPONE cCharBuff15
  176. #define cJiaDaione cCharBuff16
  177. //32位无符号变量
  178. #define save_limit_pos cUDword32Buff1
  179. #define SKQD_cRealPos cUDword32Buff2
  180. #define dwSaveLength cUDword32Buff3
  181. //IO输入点
  182. #define SKQD_START_IN M0384
  183. #define SKQD_START_IN_UP (M0384 && !OLDM384)
  184. #define SKQD_STOP_IN M0385
  185. #define SKQD_STOP_IN_UP (M0385 && !OLDM385)
  186. #define SKQD_GOUZHEN_IN M0388//拉带到位感应、勾针到位
  187. #define SKQD_GOUZHEN_IN_UP (M0388 && !OLDM388)
  188. #define SKQD_GOUZHEN_IN_DW (!M0388 && OLDM388)
  189. #define SKQD_QIAN_LIMIT_IN M0389//拉带前限位
  190. #define SKQD_HOUXIANWEI M0391//后限位
  191. #define SKQD_HOUXIANWEI_UP (M0391 && !OLDM391)//后限位
  192. #define SKQD_SHANG_MU_LIMIT_IN M0394
  193. #define SKQD_HU_LIAN_LIMIT_IN M0396 //护链到位
  194. #define SKQD_GOUZHEN_LIMIT_IN M0398 //勾针上到位
  195. #define SKQD_GUO_LIAN_IN M0399 //过链感应
  196. #define SKQD_GUO_LIAN_IN_UP (M0399 && !OLDM399)
  197. #define SKQD_GUO_LIAN_IN_DW (!M0399 && OLDM399)
  198. #define SKQD_XIA_MU_LIMIT_IN M0400 //下模上到位
  199. //屏蔽输入
  200. #define SKQD_SHANG_MU_ORIGIN_IN M0410
  201. #define SKQD_XIA_MU_ORIGIN_IN M0410
  202. #define SKQD_ANQUANMEN_LIMIT_IN M0410//X06 //安全门
  203. #define SKQD_ANQUANMEN_LIMIT_IN_UP (M0410 && !OLDM410)//X06 //安全门
  204. #define SKQD_DANXUNHUAN_LIMIT_IN_UP (M0410 && !OLDM410)//单循环
  205. #define SKQD_QIAN_STOP_Auto M0410
  206. #define SKQD_QIAN_START_Auto M0410
  207. #define SKQD_STOP_ANNIU_IN M0410//X14 //急停按钮
  208. #define SKQD_STOP_ANNIU_IN_UP (M0410 && !OLDM410)
  209. #define SKQD_SAFE_IN 0
  210. //IO输出点
  211. #define SKQD_GZ_VAVLE M0352 //勾针
  212. #define SKQD_YD_VAVLE M0353 //压带
  213. #define SKQD_JD_VAVLE M0354 //夹子气缸
  214. //Y03为空
  215. #define SKQD_SM_VAVLE M0356 //上模
  216. //Y05为空
  217. #define SKQD_XM_VAVLE M0358 // 下模
  218. #define SKQD_TABLE_VAVLE M0359 //台面电机
  219. #define SKQD_SZ_OUT M0360 //电机使能
  220. #define SKQD_BL_VAVLE M0361 //合链(并链)
  221. #define SKQD_HULIAN_VAVLE M0362 //护链
  222. #define SKQD_YD_ONE_VAVLE M0364 //压销
  223. #define SKQD_CS_OUT M0365 //超声波
  224. //空输出屏蔽
  225. #define SKQD_DGLG_VAVLE M0380 //
  226. #define SKQD_HL_VAVLE M0380 //
  227. #define SKQD_TL_VAVLE M0380 //送链
  228. #define SKQD_RUN_VAVLE M0380 //运行灯
  229. #define SKQD_BAOJIN_VAVLE M0380 //报警灯
  230. #define SKQD_FMQ_VAVLE M0380 //报警灯
  231. #define SKQD_CQ_VAVLE M0380
  232. #define SKQD_TFK_VAVLE M0380 //推方块
  233. #define SKQD_WARMMING_LED M0380 //警告
  234. #define SKQD_YX_VAVLE M0380 //压带
  235. #define SKQD_JZ_DIR M0380 //压带
  236. //M0~M4全局固定使用
  237. /*
  238. #define bRunning M0000
  239. #define bStart M0001
  240. #define bStop M0002
  241. #define bAlarmStop M0003
  242. #define bClearTotal M0004
  243. */
  244. #define SKQD_bSM M0006 //上模
  245. #define SKQD_bXM M0007 //下模
  246. #define SKQD_bClearTotal M0008 //产量清零
  247. #define SKQD_bXiaQie M0009 //下切
  248. #define SKQD_bQianDianDW M0010 //前点定位
  249. #define SKQD_bChaoSheng M0011 //超声
  250. #define SKQD_bJiaDai M0012 //夹带
  251. #define SKQD_bGoMotor M0013 //电机前进
  252. #define SKQD_bBackMotor M0014 //电机后退
  253. #define SKQD_bTL M0015 //推链(送链)
  254. #define SKQD_bYD M0016 //压带
  255. #define SKQD_bGZ M0017 //勾针
  256. #define SKQD_bJD M0018 //夹带
  257. #define SKQD_bHL M0019 //护链
  258. #define SKQD_bYuanDianDW M0020 //不用
  259. #define SKQD_bTestCS M0021 //超声测试
  260. #define SKQD_bSingle M0022
  261. #define SKQD_bTFK M0023 //推方块
  262. #define SKQD_bTB M0024 //台面
  263. #define SKQD_bYBD M0025
  264. #define SKQD_bClearNowTotal M0026 //产量清零
  265. #define SKQD_bTS M0027
  266. #define SKQD_bBL M0028 //并链(合链)
  267. #define SKQD_bYX M0029
  268. #define SKQD_bYD_ONE M0030
  269. #define SKQD_bHuLian M0031
  270. #define SKQD_bDanBuAuto M0032
  271. #endif
  272. #endif