YXMXC_NiLong_StepJi.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. #ifndef __GLMXC_NILONG_STEP_JI_H__
  2. #define __GLMXC_NILONG_STEP_JI_H__
  3. #if FJ_YING_XING_MACHINE==1
  4. extern void MXC_InitAction(void);
  5. extern void MXC_NiLongXiuCiJiAction(void);
  6. extern void MXC_ExtiActionX31(void);
  7. extern void MXC_ExtiActionX20(void);
  8. #define MXC_ALARM_ADDR 100
  9. #define MXC_ZIPPER_LENGTH_ADDR 17
  10. #define MXC_TOTAL_ADDR 76
  11. #define MXC_PROSPEED_ADDR 78
  12. #define MXC_SERVER_EN 1
  13. #define MXC_SERVER_DISEN 0
  14. #define MXC_SC_EN 1
  15. #define MXC_SC_DISEN 0
  16. #define MXC_XC_SERVER_EN 0
  17. #define MXC_XC_SERVER_DISEN 1
  18. #define MXC_DIR_P 1
  19. #define MXC_DIR_N 0
  20. #define MXC_GZ_DIR_P 1
  21. #define MXC_GZ_DIR_N 0
  22. #define MXC_NO_ALARM 0
  23. #define MXC_TOTAL_ALARM 1
  24. #define MXC_XIA_CHONG_ALARM 2
  25. #define MXC_KA_DAI_ALARM 3
  26. #define MXC_DAO_JU_ALARM 4
  27. #define MXC_XC_ALARM 5
  28. #define MXC_FEN_ZHEN_ALARM 6
  29. #define MXC_NO_ZIPPER_ALARM 7
  30. #define MXC_SEBIAO_LENGTH_ALARM 8
  31. #define MXC_NO_GOUZHEN_ALARM 9
  32. #define MXC_START_LFZ_ORIGIN_ALARM 10
  33. #define MXC_START_RFZ_ORIGIN_ALARM 11
  34. #define MXC_START_NO_ZIPPER_ALARM 12
  35. #define MXC_LONG_TIME_NO_ZIPPER_ALARM 13
  36. #define MXC_NO_SEBIAO_ALARM 14
  37. #define MXC_SEBIAO_ZIPPER_LENGTH_ALARM 15
  38. #define MXC_GOUZHEN_MORE_ALARM 16 //勾针定位超限
  39. #define MXC_GOUZHEN_MIN_LENGTH_ALARM 17
  40. #define MXC_MOTOR_ALALRM_TIME 20000
  41. #define FenZhengErrorTime 1000
  42. #define ERRORTIME 2000 //出错时间
  43. #define MXC_USE_GZ_SERVO 1 //0为不使用伺服钩针
  44. #define MXC_PARAM_XIAZHI_TIME (user_datas[0]*10)
  45. #define MXC_PARAM_CHUIQI_TIME (user_datas[1]*10)
  46. #define MXC_PARAM_CHAOSHENG_TIME (user_datas[2]*10)
  47. #define MXC_PARAM_SC_DELAY (user_datas[3])
  48. #define MXC_PARAM_XC_DELAY (user_datas[5]*10)
  49. #define MXC_PARAM_SET_SPEED user_datas[8]
  50. #define MXC_PARAM_LOW_SPEED user_datas[9]
  51. #define MXC_PARAM_LOWSPEED_LENGTH user_datas[10] //慢速长度
  52. #define MXC_XiaMode 0//user_datas[11] //0 普通下止 1 超声下止
  53. #define MXC_GuoLianMode user_datas[12]
  54. #define MXC_FenZSelect 1//user_datas[34]
  55. #define MXC_PARAM_DAOKOU_LENGTH user_datas[13]
  56. #define MXC_PARAM_DAILUN_LENGTH user_datas[14]
  57. #define MXC_SET_ZIPPER_LENGTH (user_datas[15] | (user_datas[16] << 16))
  58. #define MXC_SET_ZIPPER_LENGTH_ADDR 15
  59. #define MXC_SET_REVISE_ZIPPER_LENGTH user_datas[17]//修正长度
  60. #define MXC_DC_MODE user_datas[19] //0勾针 1步进/伺服 2色标
  61. #define MXC_XIA_ZHI_ENABLE user_datas[20] //0定寸不使用下止 1使用定寸+下止 2单独下止
  62. #define MXC_DEC_MODE user_datas[21] //0为感应减速模式,1为数控减速模式
  63. #define MXC_SET_TOTAL (user_datas[22] | (user_datas[23] << 16))
  64. #define MXC_GOU_ZHEN_MODE 0//user_datas[24] // 0为普通勾针 1为活动勾针
  65. #define MXC_GuoLianCheckMode user_datas[25] // 超声下止模式下,过链感应有效电平配置1为翻转电平
  66. #define MXC_PARAM_XIAZHI_DELAY_TIME user_datas[26]
  67. #define MXC_XiaChongMotorMode user_datas[27] //0为交流1为步进/伺服
  68. #define MXC_XiaChongSpeed user_datas[29]
  69. #define MXC_XiaChongLowSpeed 10
  70. #define MXC_MOTOR_MODE user_datas[30] //0步进松轴电平1伺服松轴电平
  71. #define MXC_PARAM_DELAY_CHUIQI_TIME (user_datas[31]*10)
  72. #define MXC_PARAM_FIRST_SPEED user_datas[32]
  73. #define MXC_PARAM_GZ_RESET_MODE user_datas[33] //勾针复位方式 0为自动1为数控
  74. #define MXC_PARAM_SEBIAO_TQ_LENGTH user_datas[46] //色标提前检测长度
  75. #define MXC_PARAM_SEBIAO_DW_LENGTH user_datas[47]
  76. #define MXC_PARAM_GZ_LENGTH user_datas[48]
  77. #define MXC_PARAM_GZ_DELAY (user_datas[49]*10)
  78. #define MXC_PARAM_MOTOR_ALARM_TIME (user_datas[50]*10)
  79. #define MXC_PARAM_R_FZ_DELAY (user_datas[51]*10)
  80. #define MXC_PARAM_L_FZ_DELAY (user_datas[52]*10)
  81. #define MXC_PARAM_MOTOR_DELAY (user_datas[53]*10)
  82. #define MXC_PARAM_SC_MODE user_datas[54]
  83. #define MXC_PARAM_AUTO_CHECK_MODE user_datas[55]//1为自动测长0为手动输入长度
  84. #define MXC_PARAM_DELAY_XC (user_datas[56]*10)
  85. #define MXC_PARAM_SB_HIGH_SPEED user_datas[57]
  86. #define MXC_PARAM_SB_LOW_SPEED user_datas[58]
  87. #define MXC_PARAM_SB_OFFSET_SPEED user_datas[59]
  88. #define MXC_ERROR_LENGTH user_datas[60]
  89. #define MXC_PARAM_START_SPEED user_datas[61]
  90. #define MXC_PARAM_ACC_SPEED user_datas[62]
  91. #define MXC_PARAM_DEC_SPEED user_datas[63]
  92. #define MXC_PARAM_DELAY_GOUZHEN_BACK (user_datas[88]*10)
  93. //2022.6.24加
  94. #define MXC_GouzhenSpeed_Hand_SPEED user_datas[64] //手动勾针速度
  95. #define MXC_GouzhenSpeed_Auto_SPEED user_datas[65] //自动勾针速度
  96. #define MXC_PARAM_GouZhenLun_LENGTH user_datas[66] //勾针轮周长
  97. #define MXC_Gouzhencurrent_L user_datas[67] //勾针当前位置
  98. #define MXC_GouzhenMin_Length_JiaChang user_datas[85]
  99. #define MXC_GouzhenMin_Length (user_datas[68]+user_datas[85]) //勾针最小位置即偏移加上加长杆长度
  100. //2023.11.22加上
  101. #define MXC_DAO_JU_ALARM_EN user_datas[86]
  102. //订单功能参数
  103. #define MXC_DingDanJianGe_Length user_datas[69] //订单间隔长度
  104. #define MXC_DingDan_NowNum user_datas[70] //当前订单加工序号
  105. #define MXC_DingDanJianGe_State user_datas[75] //订单间隔状态,1 未完成
  106. #define MXC_ScanMa_LENGTH (user_datas[71] | (user_datas[72] << 16)) //扫码的拉链长度
  107. #define MXC_ScanMa_Production (user_datas[73] | (user_datas[74] << 16)) //扫码的生产数量
  108. #define MXC_ProSpeed user_datas[78] //生产速度
  109. #define MXC_DingDanWorkMode user_datas[79] //订单工作模式 0,不走订单组,独立外面设置, 1 按订单组工作
  110. #define MXC_N_LIMIT_LENGTH_ADDR 82 //勾针电机软后限
  111. #define MXC_PARAM_SHIFU_LOWSPEED_LENGTH user_datas[89]//步进定寸慢速长度
  112. #define MXC_PARAM_SHIFU_LOW_SPEED user_datas[90]//步进定寸慢速度
  113. #define MXC_PARAM_SEBIAO_LOWSPEED_LENGTH user_datas[91]//色标慢速长度
  114. #define MXC_PARAM_XIAZHI_EN user_datas[92] //机器配置:0不带下止功能 ,1带下止功能
  115. #define MXC_DDBH_Time (user_datas[93]*10) //顶刀保护输出时间
  116. #define MXC_Length_Change_flag user_datas[94] //运动过程订单组拉链长度改变标志位
  117. //D76,D77 产量
  118. //D78 生产总量
  119. #define MXC_TIAOSHI_MODE user_datas[195]//调试模式,1为开启
  120. #define MXC_DingDanNum 5 //订单组数
  121. #define MXC_DingDanAddr 130 //D130开始为订单数据 D130 D131 为拉链长度, D132 D133 为当前拉链条数 D134 D135 为当前订单需要完成拉链条数 每组以此按顺序排放
  122. #define MXC_DingDanOffsetAddr 160 // 订单长度修正地址
  123. #define MXC_MultLengthOffsetAddr 170 // 多段补偿长度地址
  124. #define MXC_MultOffsetAddr 175 // 多段补偿值地址
  125. //8位
  126. #define bGongFen_Stop cCharBuff1
  127. #define cDW_data_Num cCharBuff2
  128. #define DISPLAY_DATA0 user_datas[121]
  129. #define DISPLAY_DATA1 user_datas[122]
  130. #define DISPLAY_DATA2 user_datas[123]
  131. #define DISPLAY_DATA3 user_datas[124]
  132. #define DISPLAY_DATA4 user_datas[125]
  133. #define DISPLAY_DATA5 user_datas[126]
  134. #define DISPLAY_DATA6 user_datas[127]
  135. #define DISPLAY_DATA7 user_datas[128]
  136. #define MXC_bStart M0000
  137. #define MXC_bClear M0001
  138. #define MXC_bXiaZhi M0002 //不用
  139. #define MXC_bXiaChong M0003
  140. #define MXC_bStop M0004
  141. #define MXC_bLeftFenZhen M0005
  142. #define MXC_bRightFenZhen M0006
  143. #define MXC_bDotXiaChong M0007
  144. #define MXC_bDotXiaChongDisplay M0008
  145. #define MXC_bGouZhen M0009
  146. #define MXC_bAddLength M0010
  147. #define MXC_bDecLength M0011
  148. #define MXC_bSetDCMode M0012
  149. #define MXC_bChuiQi M0013
  150. #define MXC_bChangeLength M0014
  151. #define MXC_bClearAlarm M0015
  152. #define MXC_bChangeGouZhenMode M0016
  153. #define MXC_bChangeXiaZhiMode M0017
  154. #define MXC_bChuDai M0018
  155. #define MXC_bDingWei M0019
  156. #define MXC_bNext M0020
  157. #define MXC_bJiaoDao M0021
  158. #define MXC_bSaveWorkData M0022
  159. #define MXC_bAlarmStop M0023
  160. #define MXC_bRunning M0024
  161. #define MXC_bTestMotor M0025
  162. #define MXC_GouZhenforward M0026 //勾针前移
  163. #define MXC_GouZhenback M0027 //勾针后移
  164. #define MXC_GouZhenlocation M0028 //勾针定位
  165. #define MXC_StartFirst M0029 //上电第一次
  166. #define MXC_ShaChe M0030 //刹车控制
  167. #define MXC_Scan_Ma M0031 //扫码通知
  168. #define MXC_DingDanJianGe M0032 //订单间隔隔工作
  169. #define MXC_DingDanSet130 M0033 //订单组设定1通知
  170. #define MXC_DingDanSet136 M0034 //订单组设定2通知
  171. #define MXC_DingDanSet142 M0035 //订单组设定3通知
  172. #define MXC_DingDanSet148 M0036 //订单组设定4通知
  173. #define MXC_DingDanSet154 M0037 //订单组设定5通知
  174. #define MXC_SET_GOUZHEN_LENGTH M0038 //勾针模式设置拉链长度
  175. #define MXC_SET_XIACHONG_DISEN M0039 //
  176. #define MXC_bDingDao_Baohu M0040 //顶刀保护
  177. #define MXC_bDJTD_P M0041 //电机拖带正转
  178. #define MXC_bDJTD_N M0042 //电机拖带反转
  179. #define MXC_cAutoStep cStepMByte
  180. #define MXC_cMotorStep cStepMByte1
  181. #define MXC_cXiaChongStep cStepMByte2
  182. #define MXC_cLeftFenZhenStep cStepMByte3
  183. #define MXC_cRightFenZhenStep cStepMByte4
  184. #define MXC_cJiaoDaoStep cStepMByte5
  185. #define MXC_cChuiQiStep cStepMByte6
  186. #define MXC_cDCPStep cStepMByte7
  187. #define MXC_cGouZhenDWStep cStepMByte8
  188. #define MXC_cAutoDelay cDelayTime1
  189. #define MXC_cChuiQiDelay cDelayTime2
  190. #define MXC_cXiaZhiDelay cDelayTime3
  191. #define MXC_cGouZhenTime cDelayTime4
  192. #define MXC_cBudaiCheckDelay cDelayTime5
  193. #define MXC_cFenZhenLeftDelay cDelayTime6
  194. #define MXC_cFenZhenRightDelay cDelayTime7
  195. #define MXC_cKaDaiDelay cDelayTime8
  196. #define MXC_cXiaChongDelay cDelayTime9
  197. #define MXC_cDaoJuCheckDelay cDelayTime10
  198. #define MXC_cMotorDelay cDelayTime11
  199. #define MXC_cGouZhenDWDelay cDelayTime12
  200. #define MXC_cGouZhenMotorDelay cDelayTime13
  201. #define MXC_cAutoRunDelay cDelayTime14
  202. #define MXC_cDDBHDelay cDelayTime15
  203. #define MXC_STOP_IN M0384//X00 停止
  204. #define MXC_STOP_IN_UP (M0384 && !OLDM384)//(X01 && !OLDX01)
  205. #define MXC_GouZhen_IN M0386 // X02钩针到位
  206. #define MXC_GouZhen_IN_UP (M0386 && !OLDM386)//(X02 && !OLDX02)
  207. #define MXC_ManXiaChong_UP (M0387 && !OLDM387)// (X03 && !OLDX03)手动下冲
  208. #define MXC_START_IN M0388//X04 启动
  209. #define MXC_START_IN_UP (M0388 && !OLDM388)//(X00 && !OLDX00)
  210. #define MXC_XiaChong_IN M0389//X05 下冲原位
  211. #define MXC_XiaChong_IN_UP (M0389 && !OLDM389)//(X10 && !OLDX10)
  212. #define MXC_Zipper_IN M0390//X06 有链信号
  213. #define MXC_RighttFenZhen_IN M0391//X07 右分针到位
  214. #define MXC_LeftFenZhen_IN M0392 //X10 左分针到位
  215. #define MXC_RightFenZhen_Origin_IN M0393//X11 右分针原位
  216. #define MXC_LeftFenZhen_Origin_IN M0394//X12 左分针原位
  217. #define MXC_KaDai_IN M0395//X13 卡带信号
  218. #define MXC_KaDai_IN_UP (M0395 && !OLDM395)//(X13 && !OLDX13)
  219. #define MXC_DDBH_Origin_IN M0396//X13 顶刀保护原位
  220. #define MXC_SeBiao_IN M0399//X17 色标信号
  221. #define MXC_SeBiao_IN_UP (M0399 && !OLDM399)//(X17 && !OLDX17)
  222. #define MXC_SeBiao_IN_DW (!M0399 && OLDM399)//(!X17 && OLD17)
  223. //空置
  224. #define MXC_Dec_IN M0400//X04 减速信号
  225. #define MXC_Dec_IN_DW (M0400 && !OLDM400)//(!X04 && OLDX04)
  226. #define MXC_DingChuPian_IN M0400 //X13 顶出片检测
  227. #define MXC_DingChuPian_IN_DW (!M0400 && OLDM400)//(!X13 && OLDX13)
  228. #define MXC_GouZhenforward_IN M0400// X15 //勾针前限位
  229. #define MXC_GouZhenforward_UP (M0400 && !OLDM400)//(X15 && !OLDX15)
  230. #define MXC_GouZhenforward_DW (!M0400 && OLDM400)//(!X15 && OLDX15)
  231. #define MXC_GouZhenback_IN M0400//X16 //勾针后限位
  232. #define MXC_GouZhenback_IN_UP (M0400 && !OLDM400)//(X16 && !OLDX16)
  233. #define MXC_GouZhenback_IN_DW (!M0400 && OLDM400)//(!X16 && OLDX16)
  234. //输出IO
  235. #define MXC_TuoDaiSongZhou M0353//Y01 拖带松轴
  236. #define MXC_LeftFenZhen_VAVLE M0354//Y02 左分针阀
  237. #define MXC_RightFenZhen_VAVLE M0355//Y03 右分针阀
  238. #define MXC_ChuiQi_VAVLE M0356//Y04 吹气
  239. #define MXC_GouZhen_VAVLE M0357//Y05 钩针阀
  240. #define MXC_XiaChong_MOTOR M0358//Y06 下冲电机
  241. #define MXC_SeBiao_QieHuan_VAVLE M0359//Y07(保留)切换色标颜色线(0为黑色线,1为粉色线)
  242. #define MXC_DingDao_BaoHu_VAVLE M0365//Y15 顶刀保护
  243. //空置
  244. #define MXC_LIHE_VAVLE M0370//Y00
  245. #define MXC_XC_SongZhou M0370//Y01 下冲电机松轴
  246. #define MXC_XC_ShaChe M0370//Y01
  247. #define MXC_XiaZhi_VAVLE M0370//Y03 下止
  248. #define MXC_GouzhenShaChe M0370//Y10 //勾针刹车
  249. #define MXC_JiaoDao_OUT M0370//Y11 教导输出
  250. #define MXC_XiaZhi_MOTOR M0370//Y12 下止电机
  251. #define MXC_GouzhenMotor_DR M0370//Y13 //勾针伺服电机方向
  252. #define MXC_GuDingGouZhen M0370//Y15
  253. #define MXC_ChaoSheng M0370//Y15
  254. #define MXC_ChuDai_VAVLE M0370//Y15
  255. #endif
  256. #endif