YXChuanTouJi.h 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. #ifndef __XDCHUAN_TOU_JI_H__
  2. #define __XDCHUAN_TOU_JI_H__
  3. #if FJ_YING_XING_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. #define HouMa_MODE_DANKUAI 0
  13. #define HouMa_MODE_SHUANGBI 1
  14. #define HouMa_MODE_YOUHOUMA 2
  15. /*
  16. * 警告类型 警告编号
  17. */
  18. #define CT_NO_ALARM 0 /* 没警告*/
  19. #define CT_NO_ZIPPER_ALARM 1 /* 没拉链,自动停机*/
  20. #define CT_KA_DAI_ALARM 2 /* 卡带异常*/
  21. #define CT_SL_ORIGIN_ALARM 3
  22. #define CT_HSL_ORIGIN_ALARM 4
  23. #define CT_HSL_LIMIT_ALARM 5
  24. #define CT_XM_ORIGIN_ALARM 6 /* 下模下限位*/
  25. #define CT_ZIPPER_MAXLENGHT_ALARM 7 /* 拖带最长长度保护,检查拉链是否卡位*/
  26. #define CT_TOTAL_ALARM 8
  27. #define CT_DZ_ALARM 10
  28. #define CT_BL_ALARM 17
  29. #define CT_CR_ORIGIN_ALARM 21
  30. #define CT_FD_IN_ALARM 22
  31. #define CT_HangSongLiao_Out_ALARM 25
  32. #define CT_SongLiao_VAVLE_Not_ALARM 26 //送料电磁阀不能有输出
  33. #define CT_JieLiao_VAVLE_Not_ALARM 27 //接料电磁阀不能有输出
  34. #define CT_XiaMo_VAVLE_Not_ALARM 28 //下模电磁阀不能有输出
  35. #define CT_LaTuo_Not_ALARM 29 //已经有拉头
  36. #define CT_TuiJieLiao_ALARM 30 //退接料条件为码勾输出情况下横送料要退回原点
  37. #define CT_JieLiao_out_ALARM 31 //码勾没输出或横送料在原点才能输出
  38. #define CT_XiaMo_out_ALARM 32 //横送料在原点才能输出
  39. #define CT_Guo_Lian_IN_ALARM 33 //拉链在空位上容易爆链
  40. #define CT_ZhuangLiao_ALARM 34 //装料不成功
  41. #define CT_HuChi_out_ALARM 35 //护齿输出不能拖带
  42. #define CT_FenDai_out_ALARM 36 //分带输出不能拖带
  43. #define CT_HeLian_out_ALARM 37 //护链输出不能拖带
  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_CYCLE_LENGTH 2950 //user_datas[10]
  60. #define CT_PARAM_CYCLE_PULSE 2000 //user_datas[11]
  61. #define CT_PARAM_FD_DELAY (user_datas[10]* 10) //时间 秒 2位小数 //延时分带
  62. #define CT_PARAM_XM_BACK_DELAY_START (user_datas[11] * 10) //时间 秒 2位小数 //下模返回延时拖带
  63. #define CT_PARAM_MAX_LENGTH (user_datas[12] * 10) //长度 CM 1位小数 //长链保护长度
  64. #define CT_PARAM_ZDP_START_TIME (user_datas[13] * 10) //时间 2位小数 //振动盘延时开
  65. #define CT_PARAM_CR_SPEED user_datas[14] //穿入速度
  66. #define CT_PARAM_GZ_LENGTH user_datas[15] // 长度,CM 2位小数点 //延迟上勾针
  67. #define CT_PARAM_TUIHELIAN_DELAY user_datas[16] // 长度,CM 2位小数点 //延时退合链
  68. #define CT_PARAM_TUIFENGDAI_DELAY user_datas[17] // 长度,CM 2位小数点 //延时退分带
  69. #define CT_PARAM_ZDP_STOP_TIME (user_datas[18] * 10) //时间 秒 2位小数 //振动盘延时关()
  70. #define CT_PARAM_DLP_TIME (user_datas[19] * 10) //时间 秒 2位小数 //顶拉片的时间
  71. #define CT_PARAM_HL_ENABLE user_datas[30] //合链
  72. #define CT_PARAM_DALIAOPIAN user_datas[31] //自动打拉片
  73. #define CT_PARAM_SL_MODE user_datas[32] //送料模式(0 横送料, 1老款送料)
  74. #define CT_PARAM_GZ_MODE user_datas[33] //勾针选择
  75. #define CT_PARAM_ZDP_MODE user_datas[34] //振动盘
  76. #define CT_PARAM_HouMa_MODE user_datas[35] // 0无后码单开模式 1无后码双闭模式,2有后码模式,
  77. #define CT_AutoDelay cDelayTime1
  78. #define CT_MotorDelay cDelayTime2
  79. #define CT_HeMoDelay cDelayTime3
  80. #define CT_SL_Delay cDelayTime4
  81. #define CT_HSL_Delay cDelayTime5
  82. #define CT_ZL_Delay cDelayTime6
  83. #define CT_XM_BACK_Delay cDelayTime7
  84. #define CT_CLT_Delay cDelayTime8
  85. #define CT_ZDP_Delay cDelayTime9
  86. #define CT_AlarmDelay cDelayTime10
  87. #define CT_DLP_Time cDelayTime11
  88. #define CT_AutoStep cStepMByte //自动动作
  89. #define CT_MotorStep cStepMByte1 //电机拖带
  90. #define CT_HeMoStep cStepMByte2 //合模动作
  91. #define CT_SL_Step cStepMByte3 //送料动作
  92. #define CT_HSL_Step cStepMByte4 //模送料动作
  93. #define CT_ZL_Step cStepMByte5 //装料动作
  94. #define CT_CLT_Step cStepMByte6 //穿拉头动作
  95. #define CT_ZD_Step cStepMByte7 //振动盘动作
  96. #define CT_START_IN X00 // 启动
  97. #define CT_START_IN_UP (X00 && !OLDX00) //
  98. #define CT_STOP_IN X01 //停止
  99. #define CT_STOP_IN_UP (X01 && !OLDX01)
  100. #define CT_MG_IN X02 //码勾检料
  101. #define CT_MG_IN_UP (X02 && !OLDX02)
  102. #define CT_FD_IN X05 //分带到位
  103. #define CT_DZ_IN X06 //拉头检测(顶针)
  104. #define CT_XM_ORIGIN_IN X07 //下模原位
  105. #define CT_HSL_ORIGIN_IN X10 //横送原位
  106. #define CT_HSL_LIMIT_IN X11 //横送到位
  107. #define CT_ZDP_IN X14 //振动盘料检
  108. #define CT_ZDP_IN_UP (X14 && !OLDX14)
  109. #define CT_ZDP_IN_DW (!X14 && OLDX14)
  110. #define CT_GUO_LIAN_IN X15 //过链感应
  111. #define CT_GUO_LIAN_IN_UP (X15 && !OLDX15)
  112. #define CT_GUO_LIAN_IN_DW (!X15 && OLDX15)
  113. #define CT_SL_ORIGIN_IN X16 //送料原位
  114. #define CT_Manual_DW X20 //手动定位
  115. #define CT_Manual_DW_DW (!X20 && OLDX20)
  116. #define CT_Manual_DW_UP (!X20 && OLDX20)
  117. #define CT_Manual_ZHUANGLI X21 //手动装料
  118. #define CT_Manual_ZHUANGLI_DW (!X20 && OLDX20)
  119. #define CT_Manual_ZHUANGLI_UP (!X20 && OLDX20)
  120. #define CT_XiaMo_VAVLE Y01 //下模
  121. #define CT_SongLiao_VAVLE Y02 //送料
  122. #define CT_GouZhen_VAVLE Y03 //勾针
  123. #define CT_MaGou_VAVLE Y04 //码勾
  124. #define CT_DaLaPian_VAVLE Y05 //顶拉片(打拉片)
  125. #define CT_FenDai_VAVLE Y06 //分带
  126. #define CT_HeLian_VAVLE Y07 //合链(穿模后面)
  127. #define CT_ZhenDongPian_OUT Y11 //振动盘
  128. #define CT_HangSongLiao_VAVLE Y12 //横送料
  129. #define CT_JieLiao_VAVLE Y13 //接料下模
  130. #define CT_HuChi_VAVLE Y14 //护齿
  131. //M0~M4全局固定使用
  132. /*
  133. #define bRunning M0000
  134. #define bStart M0001
  135. #define bStop M0002
  136. #define bAlarmStop M0003
  137. #define bClearTotal M0004
  138. */
  139. #define CT_bSL M0006 //手动送料
  140. #define CT_bHSL M0007 //手动横送拉头
  141. #define CT_bJL M0008 //手动接料
  142. #define CT_bGM M0009 //手动勾码
  143. #define CT_bFD M0010 //手动分带
  144. #define CT_bXM M0011 //手动下模
  145. #define CT_bMotorH M0012 //手动拖带
  146. #define CT_bHL M0013 //手动合链
  147. #define CT_bDLP M0014 //手动顶拉片
  148. #define CT_bHC M0015 //手动护齿
  149. #define CT_bMotorDW M0016 //电机一键定位
  150. #define CT_bZL M0017 //装料
  151. #define CT_bHM M0018 //合模
  152. #define CT_bSingle M0019 //单一自动
  153. #define CT_bZDP M0020 //振动盘
  154. #endif
  155. #endif