JHChuanTouJi.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. #ifndef __XDCHUAN_TOU_JI_H__
  2. #define __XDCHUAN_TOU_JI_H__
  3. #if JIN_HONG_MACHINE==1
  4. extern void ChuanTou_Action(void);
  5. extern void ChuanTou_InitAction(void);
  6. #define CT_DIR_P 1
  7. #define CT_DIR_N 0
  8. #define CT_Y_DIR_P 1
  9. #define CT_Y_DIR_N 0
  10. #define CT_MOTOR_DISEN 1
  11. #define CT_MOTOR_EN 0
  12. /*
  13. * 警告类型 警告编号
  14. */
  15. #define CT_NO_ALARM 0 /* 没警告*/
  16. #define CT_NO_ZIPPER_ALARM 1 /* 没拉链,自动停机*/
  17. #define CT_KA_DAI_ALARM 2 /* 卡带异常*/
  18. #define CT_SL_ORIGIN_ALARM 3
  19. #define CT_HSL_ORIGIN_ALARM 4
  20. #define CT_HSL_LIMIT_ALARM 5
  21. #define CT_XM_ORIGIN_ALARM 6 /* 下模下限位*/
  22. #define CT_ZIPPER_MAXLENGHT_ALARM 7 /* 拖带最长长度保护,检查拉链是否卡位*/
  23. #define CT_TOTAL_ALARM 8
  24. #define CT_DZ_ALARM 10
  25. #define CT_BL_ALARM 17
  26. #define CT_CR_ORIGIN_ALARM 21
  27. #define CT_FD_IN_ALARM 22
  28. #define CT_HangSongLiao_Out_ALARM 25 //横送料不能输出
  29. #define CT_SongLiao_VAVLE_Not_ALARM 26 //送料电磁阀不能有输出
  30. #define CT_JieLiao_VAVLE_Not_ALARM 27 //接料电磁阀不能有输出
  31. #define CT_XiaMo_VAVLE_Not_ALARM 28 //下模电磁阀不能有输出
  32. #define CT_LaTuo_Not_ALARM 29 //已经有拉头
  33. #define CT_TuiJieLiao_ALARM 30 //退接料条件为码勾输出情况下横送料要退回原点
  34. #define CT_JieLiao_out_ALARM 31 //码勾没输出或横送料在原点才能输出
  35. #define CT_XiaMo_out_ALARM 32 //横送料在原点才能输出
  36. #define CT_Guo_Lian_IN_ALARM 33 //拉链在空位上容易爆链
  37. #define CT_ZhuangLiao_ALARM 34 //装料不成功
  38. #define CT_HuChi_out_ALARM 35 //护齿输出不能拖带
  39. #define CT_FenDai_out_ALARM 36 //分带输出不能拖带
  40. #define CT_HeLian_out_ALARM 37 //护链输出不能拖带
  41. #define CT_ERROR_out_ALARM 38 //故障输入
  42. #define CT_FENDAI_JIALITOU_out_ALARM 39 //分带输出不能手动压拉头
  43. #define CT_FENDAI_LaLianKongWei_ALARM 40 //拉链空位超出预设长度
  44. #define VAVLE_ALARM_TIME 3000
  45. #define MOTOR_ALARM_TIME 5000
  46. #define CT_WORKTOTAL_ADDR 102
  47. #define CT_TOTAL_ADDR 76
  48. #define CT_ALARM_ADDR 100
  49. #define CT_PROSPEED_ADDR 78
  50. //#define CT_PARAM_SET_TOTAL (user_datas[74] | (user_datas[75] >> 16))
  51. #define CT_PARAM_CR_LENGTH (user_datas[1] | (user_datas[2] >> 16)) // 穿入长度,2位小数点 CM
  52. #define CT_PARAM_SL_DELAY_BACK (user_datas[3] * 10) //时间 秒 2位小数 //送料时间
  53. #define CT_PARAM_JIELIAO_DELAY (user_datas[4] * 10) //时间 秒 2位小数 //延时接料
  54. #define CT_PARAM_GJ_TIME (user_datas[5] * 10) //时间 秒 2位小数 //延时码勾
  55. #define CT_PARAM_HSL_BACK_DELAY (user_datas[6]*10) //时间 秒 2位小数 //横送料延时返回
  56. #define CT_PARAM_HSPEED (user_datas[7]) //拖带的最高速
  57. #define CT_PARAM_LSPEED (user_datas[8]) //空位速度
  58. #define CT_PARAM_STOP_LENGTH (user_datas[9]) // 长度CM,2位小数点 //定位长度
  59. #define CT_PARAM_FD_DELAY (user_datas[10]* 10) //时间 秒 2位小数 //延时分带
  60. #define CT_PARAM_XM_BACK_DELAY_START (user_datas[11] * 10) //时间 秒 2位小数 //下模返回延时拖带
  61. #define CT_PARAM_MAX_LENGTH (user_datas[12] * 10) //长度 CM 1位小数 //长链保护长度
  62. #define CT_PARAM_ZDP_START_TIME (user_datas[13] * 10) //时间 2位小数 //振动盘延时开
  63. #define CT_PARAM_CR_SPEED user_datas[14] //穿入速度
  64. #define CT_PARAM_GZ_LENGTH user_datas[15] // 长度,CM 2位小数点 //延迟上勾针
  65. #define CT_PARAM_TUIHELIAN_DELAY user_datas[16] // 长度,CM 2位小数点 //延时退合链
  66. #define CT_PARAM_TUIFENGDAI_DELAY user_datas[17] // 长度,CM 2位小数点 //延时退分带
  67. #define CT_PARAM_ZDP_STOP_TIME (user_datas[18] * 10) //时间 秒 2位小数 //振动盘延时关()
  68. #define CT_PARAM_DLP_TIME (user_datas[19] * 10) //时间 秒 2位小数 //顶拉片的时间
  69. #define CT_PARAM_TUIHELIAN_DanShuan_DELAY user_datas[20] // 长度,CM 2位小数点 //双闭模式延时退合链
  70. #define CT_PARAM_HL_ENABLE user_datas[30] //合链
  71. #define CT_PARAM_DALIAOPIAN user_datas[31] //自动打拉片
  72. #define CT_PARAM_SL_MODE user_datas[32] //送料模式(0 横送料, 1老款送料)
  73. #define CT_PARAM_GZ_MODE user_datas[33] //勾针选择
  74. #define CT_PARAM_ZDP_MODE user_datas[34] //振动盘
  75. #define CT_PARAM_HouMa_MODE user_datas[35] // 0位有后码模式 1为无后码模式
  76. #define CT_PARAM_DanShuan_MODE user_datas[36] // 0单开模式 1双闭模式
  77. #define CT_PARAM_CYCLE_LENGTH (user_datas[38])// *user_datas[52] // 2985
  78. #define CT_PARAM_CYCLE_PULSE user_datas[39] //2000 //user_datas[11]
  79. #define CT_PARAM_HuChi_Time user_datas[40] //穿入时护齿延时退 (原来单位是10MS,变为1MS, 没小数点)
  80. #define CT_PARAM_HuChi_DELAY user_datas[41] //提前护齿
  81. #define CT_PARAM_HeLian_HM_DELAY (user_datas[42] * 10) //有后码合链时间
  82. #define CT_PARAM_HeLian_WHM_DELAY (user_datas[43] * 10) //无后码合链时间
  83. #define CT_PARAM_KWZDCD_LENTH user_datas[44] //空位后走最大长度
  84. #define CT_PARAM_HSL_DELAY (user_datas[45] * 10) //延时横送料()
  85. #define CT_PARAM_bHuChi_mode user_datas[46] //护齿模式 0为正常模式 1为提前输出模式
  86. #define CT_PARAM_CheckLT_mode_CLT_Over user_datas[47] //自动状态,退下模时是否检测拉头
  87. #define CT_PARAM_CDBC_LENGTH user_datas[48] //超过定位后下升延处计算停止长度
  88. #define CT_PARAM_MGJC_DELAY (user_datas[49] * 10) //拉头检测时间
  89. #define CT_PARAM_CLT_DELAY (user_datas[50] * 10) //延时穿拉头
  90. #define CT_PARAM_WUHOUMAHL_DELAY (user_datas[51] * 10) //延时合链
  91. #define CT_AutoDelay cDelayTime1
  92. #define CT_MotorDelay cDelayTime2
  93. #define CT_HeMoDelay cDelayTime3
  94. #define CT_SL_Delay cDelayTime4
  95. #define CT_HSL_Delay cDelayTime5
  96. #define CT_ZL_Delay cDelayTime6
  97. #define CT_XM_BACK_Delay cDelayTime7
  98. #define CT_CLT_Delay cDelayTime8
  99. #define CT_ZDP_Delay cDelayTime9
  100. #define CT_AlarmDelay cDelayTime10
  101. #define CT_DLP_Time cDelayTime11
  102. #define CT_HeMoDelay1 cDelayTime12
  103. #define CT_HuChiDelay cDelayTime13
  104. #define CT_HeLianDelay cDelayTime14
  105. #define CT_AutoStep cStepMByte //自动动作
  106. #define CT_MotorStep cStepMByte1 //电机拖带
  107. #define CT_HeMoStep cStepMByte2 //合模动作
  108. #define CT_SL_Step cStepMByte3 //送料动作
  109. #define CT_HSL_Step cStepMByte4 //模送料动作
  110. #define CT_ZL_Step cStepMByte5 //装料动作
  111. #define CT_CLT_Step cStepMByte6 //穿拉头动作
  112. #define CT_ZD_Step cStepMByte7 //振动盘动作
  113. #define CT_HuChiStep cStepMByte8 //护齿动作
  114. #define CT_HeLianStep cStepMByte9 //合链动作
  115. //32位
  116. #define CT_Zipper_Length cUDword32Buff1
  117. #define CT_cKongWei_Pos cUDword32Buff2
  118. #define CT_cKongWeiCheck_Length cUDword32Buff3
  119. //8位
  120. #define CT_cSongLiaoOk cCharBuff1
  121. #define CT_cMotorDinWei_OK cCharBuff2
  122. #define CT_cZhuangLiaoOk cCharBuff3
  123. #define CT_cZLCnt cCharBuff4
  124. #define CT_SingOneFlg001 cCharBuff5
  125. #define CT_cZDP_Con cCharBuff6
  126. #define CT_HeMo_Mode cCharBuff7
  127. #define CT_START_IN M0384//X00 //开始
  128. #define CT_START_IN_UP (M0384 && !OLDM384) //(X00 && !OLDX00)
  129. #define CT_STOP_IN M0385 //X01 //停止
  130. #define CT_STOP_IN_UP (M0385 && !OLDM385) // (X01 && !OLDX01)
  131. #define CT_MG_IN M0386//X02 //码钩到位
  132. #define CT_MG_IN_UP (M0386 && !OLD386) //(X06 && !OLDX06)
  133. #define CT_JIELIAO_IN M0387//X03 接料到位
  134. #define CT_ERROR_IN M0388 //X04 //故障输入
  135. #define CT_FD_ORIGIN_IN M0389//X05 分带
  136. #define CT_DZ_IN M0390// X06 //拉头感应
  137. #define CT_XM_ORIGIN_IN M0391//X07 //下模原位
  138. #define CT_HSL_ORIGIN_IN M0392//X10 //横送料原位
  139. #define CT_HSL_LIMIT_IN M0393//X11 //横送料到位
  140. #define CT_HELLIAN_LIMIT_IN M0394//X12 //合链到位
  141. #define CT_SL_LIMIT_IN M0395// X13 //送拉头到位
  142. #define CT_ZDP_IN M0396//X14 //振动盘料检
  143. #define CT_ZDP_IN_UP (M0396 && !OLDM396) // (X14 && !OLDX14)
  144. #define CT_ZDP_IN_DW (!M0396 && OLDM396)
  145. #define CT_GUO_LIAN_IN M0397//X15 //过链感应
  146. #define CT_GUO_LIAN_IN_UP (M0397 && !OLDM397)
  147. #define CT_GUO_LIAN_IN_DW (!M0397 && OLDM397)
  148. #define CT_SL_ORIGIN_IN M0398// X16 //送拉头原位
  149. #define CT_GZ_IN M0399//X17 //钩针拉带到位
  150. #define CT_FenDai_VAVLE M0352// Y00 //分带
  151. #define CT_XiaMo_VAVLE M0353// Y01 //下模
  152. #define CT_SongLiao_VAVLE M0354// Y02 //送料
  153. #define CT_GouZhen_VAVLE M0355// Y03 //勾针
  154. #define CT_MaGou_VAVLE M0356//Y04 //码钩
  155. #define CT_DaLaPian_VAVLE M0357//Y05 //顶拉片(打拉片)
  156. #define CT_JiaLaTou_VAVLE M0358// Y06 //夹拉头
  157. #define CT_HeLian_VAVLE M0359// Y07 //合链
  158. #define CT_ZhenDongPian_OUT M0361//Y11 //振动盘
  159. #define CT_HangSongLiao_VAVLE M0362// Y12 //横送料
  160. #define CT_JieLiao_VAVLE M0363//Y13 //接料下模
  161. #define CT_HuChi_VAVLE M0364// Y14 //护齿
  162. //M0~M4全局固定使用
  163. /*
  164. #define bRunning M0000
  165. #define bStart M0001
  166. #define bStop M0002
  167. #define bAlarmStop M0003
  168. #define bClearTotal M0004
  169. */
  170. #define CT_bSL M0006 //手动送料
  171. #define CT_bHSL M0007 //手动横送拉头
  172. #define CT_bJL M0008 //手动接料
  173. #define CT_bGM M0009 //手动勾码
  174. #define CT_bFD M0010 //手动分带
  175. #define CT_bXM M0011 //手动下模
  176. #define CT_bMotorH M0012 //手动拖带
  177. #define CT_bHL M0013 //手动合链
  178. #define CT_bDLP M0014 //手动顶拉片
  179. #define CT_bHC M0015 //手动护齿
  180. #define CT_bMotorDW M0016 //电机一键定位
  181. #define CT_bZL M0017 //装料
  182. #define CT_bHM M0018 //合模
  183. #define CT_bSingle M0019 //单一自动
  184. #define CT_bZDP M0020 //振动盘
  185. #define CT_bJLT M0021 //手动夹拉头
  186. #define CT_bMGMS M0022 //码钩模式切换
  187. #define CT_bGZ M0023 //钩针输出
  188. #endif
  189. #endif