JHSKQueDuanJi.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. #if JIN_HONG_MACHINE==1
  2. extern void SK_QueDuan_Action(void);
  3. extern void SK_QueDuan_InitAction(void);
  4. extern void SK_QueDuanEx_ExtiActionX31(void);
  5. extern void NFastTimerAction(void);
  6. #define SKQD_DIR_P 1
  7. #define SKQD_DIR_N 0
  8. #define NPP_NoStop 1
  9. #define NPP_Stop 0
  10. #define SKQD_YDIR_P 1
  11. #define SKQD_YDIR_N 0
  12. #define SKQD_MOTOR_EN 1
  13. #define SKQD_MOTOR_DIS 0
  14. #define NCT_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. /*
  25. * 警告类型 警告编号
  26. */
  27. #define SKQD_NO_ALARM 0 /* 没警告*/
  28. #define SKQD_NO_ZIPPER_ALARM 1 /* 没拉链,自动停机*/
  29. #define SKQD_KA_DAI_ALARM 2 /* 卡带异常*/
  30. #define SKQD_SM_YUANWEI 3 /* 上模上限位*/ //
  31. #define SKQD_SM_DAOWEI 4 /* 上模到位异常(下限位)*/
  32. #define SKQD_XM_YUANWEI 5 /* 下模下限位*/
  33. #define SKQD_XM_DAOWEI 6 /* 下模到位异常(上限位)*/
  34. #define SKQD_BACK_ALARM 7
  35. #define SKQD_TOTAL_ALARM 8
  36. #define SKQD_YAGOUZHEN_ALARM 9 // 压钩针未到位
  37. #define SKQD_GZ_ALARM 10 //勾针
  38. #define SKQD_XYAGOUZHEN_ALARM 11 // 下模或者压钩针未退回原位
  39. #define SKQD_DEC_ALARM 12
  40. #define SKQD_QIAN_LIMIT_ALARM 13 //前限位出错
  41. #define SKQD_GUOCHANG_ALARM 17
  42. #define SKQD_SM_ALARM 18
  43. #define SKQD_LENGTH_LONG_ALARM 19
  44. #define SKQD_LENGTH_SHORT_ALARM 20
  45. #define SKQD_PARAM_RUN_LENGTH_ALARM 21 //超出轨道运行长度
  46. #define SKQD_PARAM_KWGZ_ALARM 22 //空位到勾针的距离过长
  47. #define VAVLE_ALARM_TIME 3000
  48. #define MOTOR_ALARM_TIME 5000
  49. #define SKQD_PARAM_FIRST_SPEED 5000
  50. #define SKQD_PARAM_GZ_DELAY (user_datas[0]*10)
  51. #define SKQD_PARAM_ZIPPER_LENGTH (user_datas[1] | (user_datas[2] >> 16))
  52. #define SKQD_PARAM_TL_DELAY 20//(user_datas[3]*10)
  53. #define SKQD_PARAM_YD_DELAY 0//(user_datas[4]*10)
  54. #define SKQD_PARAM_BACK_LOW_SPEED_LENGTH user_datas[6] //后拉慢速长度
  55. #define SKQD_PARAM_CUT_DELAY (user_datas[7]*10) //延时切断
  56. #define SKQD_PARAM_CUT_BACK_DELAY (user_datas[8]) //切断后延时后拉
  57. #define SKQD_PARAM_KAIBEE_SELECT user_datas[9] //开闭口选择(0 开口,1 闭口)
  58. #define SKQD_PARAM_CS_COLD_TIME (user_datas[10] * 10) //固化时间
  59. #define SKQD_PARAM_ZS_STOP_TIME (user_datas[11] * 10) //扎数到停止时间
  60. #define SKQD_PARAM_DELAY_BACK (user_datas[12]*10) //延时后拉
  61. #define SKQD_PARAM_CYCLE_DELAY (user_datas[14]*10) //延时下一条
  62. #define SKQD_PARAM_GO_HIGH_SPEED user_datas[15] //前进最高速
  63. #define SKQD_PARAM_GO_LOW_SPEED_LENGTH user_datas[16] //前进低速长度
  64. #define SKQD_PARAM_GO_LOW_SPEED user_datas[17] //前进最低速度
  65. #define SKQD_PARAM_BACK_SPEED user_datas[18] //后拉速度
  66. #define SKQD_PARAM_BACK_LENGTH user_datas[19] ////松夹子长度后走的长度
  67. #define SKQD_PARAM_DELAY_CS (user_datas[20] * 10) //延时超声
  68. #define SKQD_PARAM_CS_TIME (user_datas[21] * 10) //超声时间
  69. #define SKQD_PARAM_FZ_LENGTH user_datas[22] //闭口反转长度
  70. #define SKQD_PARAM_TB_TIME (user_datas[23]*10) //台面时间
  71. #define SKQD_PARAM_OFFSET_LENGTH user_datas[24] //修正长度
  72. #define SKQD_PARAM_CUT_BACK_SPEED user_datas[26] //切断后拉带速度
  73. #define SKQD_PARAM_SJZ_LENGTH user_datas[27] //松夹子长度
  74. #define SKQD_PARAM_MOTOR_SELECT user_datas[28] //电机选择 (0 步进 , 1 伺服)(主要是松轴使能不一样)
  75. #define SKQD_PARAM_BACK_MODE user_datas[30] //后退方式 1为记忆长度,0为感应方式(暂时不用)
  76. #define SKQD_PARAM_YD_FZ_DELAY (10* user_datas[31]) //压带后延时反转
  77. #define SKQD_PARAM_HL_ENABLE user_datas[33] //护链()
  78. #define SKQD_PARAM_XM_ENABLE user_datas[35] //0下模动 1下模不动
  79. #define SKQD_PARAM_CS_MODE user_datas[36] //0为气切1为超声切
  80. #define SKQD_PARAM_CYCLE_LENGTH user_datas[38] //电机周长
  81. #define SKQD_PARAM_CYCLE_PULSE user_datas[39] //电机细分
  82. #define SKQD_PARAM_TABLE_NUM user_datas[40] //台面动作条数
  83. #define SKQD_PARAM_MOTOR_DELAY_LENGTH ((unsigned long)user_datas[41] * user_datas[39]/user_datas[38]) //算出脉冲值
  84. #define SKQD_PARAM_TFK_DELAY (user_datas[44]*10) //延时推方块
  85. #define SKQD_PARAM_START_SPEED user_datas[45] //启动速度
  86. #define SKQD_PARAM_ACC user_datas[46] //加速度
  87. #define SKQD_PARAM_DCC user_datas[47] //减速度
  88. #define SKQD_PARAM_CHECK_BACK_HSPEED user_datas[48] //后拉走链最高速度
  89. #define SKQD_PARAM_CHECK_BACK_LSPEED user_datas[49] //后拉走链空位速度
  90. #define SKQD_PARAM_DELAY_CHECK 100//user_datas[50] //
  91. #define SKQD_PARAM_YALIAN_LENGTH user_datas[53] //提前压并链长度 (双开用)
  92. #define SKQD_PARAM_GOUZHEN_LENGTH user_datas[54] //提前上勾针长度
  93. #define SKQD_PARAM_TIAOSHI_MODE user_datas[55] //调试模式(暂不用)
  94. #define SKQD_PARAM_DELAY_HL_LENGTH user_datas[56] //合链动作长度
  95. #define SKQD_PARAM_BL_ENABLE user_datas[57] //并链就是合链
  96. #define SKQD_PARAM_DELAY_XM (user_datas[58]*10)
  97. #define SKQD_PARAM_DELAY_XM_LENGTH user_datas[59]
  98. #define SKQD_PARAM_BACK_LOW_SPEED user_datas[60]
  99. #define SKQD_PARAM_DEC_MODE 1//user_datas[61]//0为使用感应减速 1后退使用数控降速
  100. #define SKQD_PARAM_LT_ENABLE user_datas[62]
  101. #define SKQD_PARAM_NO_LT_DELAY_CHECK user_datas[63]
  102. #define SKQD_PARAM_ERROR_LENGTH user_datas[64] //长度允许误差
  103. #define SKQD_PARAM_DELAYBACK_SM (user_datas[65])
  104. //#define QD_PARAM_TC_LENGTH user_datas[67]
  105. //#define QD_PARAM_FIRST_GO_HIGHSPEED user_datas[69]
  106. #define SKQD_PARAM_LENGTH_MODE 1//user_datas[70] //实则不用
  107. //#define QD_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_TD_DELAY (user_datas[81]*10)
  111. #define SKQD_PARAM_TD_TIME (user_datas[82]*10)
  112. #define SKQD_PARAM_DELAY_CHECK_GZ (user_datas[83])
  113. #define SKQD_PARAM_NOW_CNT user_datas[84]
  114. #define SKQD_PARAM_ZHA_SHU user_datas[85]
  115. #define SKQD_PARAM_TDGZ_DELAY (user_datas[86]*10) //合链延时退
  116. #define SKQD_PARAM_RUN_LENGTH (user_datas[87]) //轨道运行长度
  117. #define SKQD_CNC_BACK_SPEED user_datas[88] // 数控后拉慢速度
  118. #define SKQD_PARAM_DGZ_DELAY (user_datas[89]*10) //延时顶钩针
  119. #define SKQD_PARAM_XIAMU_DELAY (user_datas[90]*10) //延时下模
  120. #define SKQD_PARAM_XIAMU_LENGTH user_datas[91] //提前多少长度下模
  121. #define SKQD_PARAM_GOUZHEN_DELAY (user_datas[92]) //延时下钩针
  122. #define SKQD_PARAM_HL_DELAY_BACK user_datas[93] //提前退合链长度
  123. #define SKQD_PARAM_BL_DELAY_BACK (user_datas[94]*10) //数控延时退合链
  124. #define SKQD_PARAM_LLGC_LENTH user_datas[95] //空位允许长度
  125. #define SKQD_PARAM_XIAMO_LENTH user_datas[96] //提前上下模
  126. #define SKQD_PARAM_KWGZBJ_LENTH user_datas[97] //空位到勾针的长度
  127. #define SKQD_PARAM_KWGZBJ_ERROR_LENTH user_datas[98] //空位到勾针的长度误差
  128. //#define SKQD_PARAM_KWCD_LENTH user_datas[99] //数控模式空位长度
  129. #define SKQD_PARAM_XIAMO_DELAY user_datas[99]//感应延时下模时间
  130. #define SKQD_PARAM_GO_DW_LENGTH user_datas[109] //前进定位位置(感应到原点为再走的长度,不用调整感应器)
  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_XiamuDelay cDelayTime7
  140. #define SKQD_ErrorDelay cDelayTime8
  141. #define SKQD_TuiDaiDelay cDelayTime9
  142. #define SKQD_AlarmDelay cDelayTime10
  143. #define SKQD_SJDelay cDelayTime11
  144. #define SKQD_STOPINDelay cDelayTime12
  145. #define SKQD_BLDelay cDelayTime13
  146. #define SKQD_XMDelay cDelayTime14
  147. #define SKQD_StopCodeDelay cDelayTime15
  148. #define SKQD_AutoStep cStepMByte
  149. #define SKQD_MotorStep cStepMByte1
  150. #define SKQD_XiaQieStep cStepMByte2
  151. #define SKQD_YuanDianStep cStepMByte3
  152. #define SKQD_XiamuStep cStepMByte4
  153. #define SKQD_CheckLengthStep cStepMByte5
  154. #define SKQD_BinLianStep cStepMByte6
  155. #define SKQD_StopStep cStepMByte7
  156. //32位变量
  157. #define SK_cZipCnt cUDword32Buff1
  158. #define SK_cTableCnt cUDword32Buff2
  159. #define SK_cTuiFangKuaiCnt cUDword32Buff3
  160. #define SK_save_limit_pos cUDword32Buff4
  161. #define SK_cRealPos cUDword32Buff5
  162. #define SK_NdwSaveLength cUDword32Buff6
  163. //8位变量
  164. #define SK_NcCheckLianFlg cCharBuff1
  165. #define SK_cCheckLianFlgEN cCharBuff2
  166. #define SK_NcGoLimitEn cCharBuff3
  167. #define SK_SingOneFlg cCharBuff7
  168. #define SK_XiaQueOver cCharBuff5
  169. #define SK_DCC_TIME_BL cCharBuff4
  170. //超声花边切,开口,开闭口二合一输入输出
  171. #define SKQD_START_IN M0384 //X00 启动
  172. #define SKQD_START_IN_UP (M0384 && !OLDM384)
  173. #define SKQD_STOP_IN M0385 // X01 停止
  174. #define SKQD_STOP_IN_UP (M0385 && !OLDM385)
  175. #define SKQD_GUOLIAN_IN M0386 // X02 过链感应
  176. #define SKQD_GUOLIAN_IN_UP (M0386 && !OLDM386)
  177. #define SKQD_GUOLIAN_IN_DW (!M0386 && OLDM386)
  178. #define SKQD_YAGOUZHEN_IN M0387 // X03 压钩针到位
  179. #define SKQD_GOUZHEN_IN M0388 // X04 钩针到位 M0388 // X04 钩针到位
  180. #define SKQD_QIAN_LIMIT_IN M0389 // X05 前限位
  181. #define SKQD_XIAMO_ROIGIN_IN M0390 // X06 下模原位
  182. #define SKQD_XIAMO_IN M0391 // X07 下模到位
  183. #define SKQD_SHANGMO_ROIGIN_IN M0392 // X10 上模原位
  184. #define SKQD_SHANGMO_IN M0393 // X11 上模到位
  185. //输出
  186. #define SKQD_GZ_VAVLE M0352//Y00 //钩针
  187. #define SKQD_DGZ_VAVLE M0353//Y01 //顶钩针
  188. #define SKQD_YADAI_VAVLE M0354//Y02 //压带
  189. #define SKQD_SHANGMO_VAVLE M0355//Y03 //上模
  190. #define SKQD_XIAMO_VAVLE M0356//Y04 // 下模
  191. #define SKQD_JIAZI_VAVLE M0357//Y05 //夹子
  192. #define SKQD_TABLE_VAVLE M0358//Y06 // 台面电机
  193. #define SKQD_CSB_VAVLE M0359//Y07 //超声波
  194. #define SKQD_SZ_OUT M0360//Y10 //使能
  195. #define SKQD_DGUOLIAN_VAVLE M0361//Y11 //顶过链
  196. #define SKQD_BL_VAVLE M0362//Y12 //合链
  197. #define SKQD_SAFE_IN 0
  198. #define SKQD_bSM M0006 //上模
  199. #define SKQD_bXM M0007 //下模
  200. #define SKQD_bGZ M0008 //钩针
  201. #define SKQD_bDGZ M0009 //顶钩针
  202. #define SKQD_bQianDianDW M0010 //前点定位
  203. #define SKQD_bChaoSheng M0011 //超声
  204. #define SKQD_bTABLE M0012 //传送带
  205. #define SKQD_bGoMotor M0013 //电机前进
  206. #define SKQD_bBackMotor M0014 //电机后退
  207. #define SKQD_bJIAZI M0015 //夹子气缸
  208. #define SKQD_bYADAI M0016 //压带
  209. #define SKQD_bSingle M0017 // 单一自动
  210. #define SKQD_bXiaQie M0018 // 下切
  211. #define SKQD_bBinLian M0019 // 合链
  212. #endif