YXChuantou_HeLian.h 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437
  1. #if FJ_YING_XING_MACHINE==1
  2. extern void XYChuanTou_HeLian_InitAction(void);
  3. extern void XYChuanTou_HeLian_Action(void);
  4. extern void XYChuanTou_HeLian_SetAlarmCode(unsigned alarm_code);
  5. extern void ExtiAcitionX02(void);
  6. #define DIR_P 1
  7. #define DIR_N 0
  8. #define MOTOR_EN 0
  9. #define MOTOR_DISEN 1
  10. #define MOTOR_ALARM 0
  11. #define MOTOR_NOALARM 1
  12. #define XY_CTHL_VAVLE_ERROR_TIME 3000
  13. #define XY_CTHL_MOTOR_ALARM_TIME 5000
  14. //故障代码列表
  15. #define XY_CTHL_NO_ALARM 0
  16. #define XY_CTHL_WLZDTJ_ALARM 1 //无拉链自动停机
  17. #define XY_CTHL_FKGYYC_Limit_ALARM 2 //感应不到方块或方块感应异常
  18. #define XY_CTHL_TLiao_Limit_ALARM 3 //X04推料到位异常
  19. #define XY_CTHL_COLOR_IN_ALARM 4 //X24色标感应停机
  20. #define XY_CTHL_HSLiao_Limit_ALARM 5 //X06横送料到位异常
  21. #define XY_CTHL_HSLiao_Origin_ALARM 6 //X07横送料原位异常
  22. #define XY_CTHL_JLiao_Limit_ALARM 7 //X10接料到位异常
  23. #define XY_CTHL_CTM_Limit_ALARM 8 //X11穿头模到位异常
  24. #define XY_CTHL_CTM_Origin_ALARM 9 //X12穿头模原位异常
  25. #define XY_CTHL_First_CT_Origin_ALARM 10 //X13一次穿头原位异常
  26. #define XY_CTHL_LTou_Check_ALARM 11 //X14拉头缺料感应异常
  27. #define XY_CTHL_CXSC_Limit_ALARM 12 //X15插稍上止感应异常
  28. #define XY_CTHL_CX_Limit_ALARM 13 //X16插稍到位感应异常
  29. #define XY_CTHL_XKTD_Origin_ALARM 14 //X17斜口原位感应异常
  30. #define XY_CTHL_CXXY_Limit_ALARM 15 //X20插稍下移到位异常
  31. #define XY_CTHL_SF_ALR_ALARM 16 //X22伺服报警异常
  32. #define XY_CTHL_SF_Origin_ALARM 17 //X23伺服原位(穿链原位)异常
  33. #define XY_CTHL_ZLT_ALARM 18 //装拉头异常
  34. #define XY_CTHL_FK_Check_ALARM 19 //X02方块检测
  35. #define XY_CTHL_FKCXDW_ALARM 20 //方块插销定位异常警告
  36. #define XY_CTHL_YCCRYWYC_ALARM 21 //一次穿入原位异常
  37. #define XY_CTHL_XCXXCYC_ALARM 22 //小插销行程异常
  38. #define XY_CTHL_HENSONGLIAO_ALARM 23 //横送料不能输出
  39. #define XY_CTHL_YCCT_ALARM 24 //一次穿头不能输出
  40. #define XY_CTHL_YCXM_Origin_ALARM 25 //下模不能输出
  41. #define XY_CTHL_DXKCTXM_Origin_ALARM 26 //顶斜口不能输出
  42. #define XY_CTHL_XKTD_ALARM 27 //斜口推带不能有输出
  43. #define XY_CTHL_CXQJD_ALARM 28 //插销前夹带不能有输出
  44. #define XY_CTHL_WFZIDONGCX_ALARM 29 //无法自动插销
  45. #define XY_CTHL_SafeDoor_ALARM 30 //安全门关上才能启动
  46. #define XY_CTHL_AutoStep cStepMByte
  47. #define XY_CTHL_ZhuangLiaoStep cStepMByte1
  48. #define XY_CTHL_TLiaoStep cStepMByte2
  49. #define XY_CTHL_TD_MotorStep cStepMByte3 //拖带电机
  50. #define XY_CTHL_JiaLianStep cStepMByte4
  51. #define XY_CTHL_ZhenDongStep cStepMByte6
  52. #define XY_CTHL_SongLiaoStep cStepMByte7
  53. #define XY_CTHL_CL_MotorStep cStepMByte8 //穿链
  54. #define XY_CTHL_AutoStep1 cStepMByte9
  55. #define XY_CTHL_bFKCXTDDW_Step cStepMByte10
  56. #define XY_CTHL_bCXCR_Step cStepMByte11
  57. #define XY_CTHL_bCLFirst_Step cStepMByte12
  58. #define XY_CTHL_ColorStep cStepMByte13
  59. #define XY_CTHL_ShiJueStep cStepMByte14
  60. #define XY_CTHL_ShiJueStep1 cStepMByte15
  61. #define XY_CTHL_ZhuangLiaoDelay cDelayTime2
  62. #define XY_CTHL_TLiao_Delay cDelayTime3
  63. #define XY_CTHL_TD_MotorDelay cDelayTime4
  64. #define XY_CTHL_AutoDelay cDelayTime5
  65. #define XY_CTHL_TestDelay cDelayTime6
  66. #define XY_CTHL_CL_MotorDelay cDelayTime7
  67. #define XY_CTHL_TouchDelay cDelayTime8
  68. #define XY_CTHL_AutoDelay1 cDelayTime9
  69. #define XY_CTHL_ZDP_Delay cDelayTime10
  70. #define XY_CTHL_bCXCR_Delay cDelayTime11
  71. #define XY_CTHL_bFKCXTDDW_Delay cDelayTime12
  72. #define XY_CTHL_bCLFirst_Delay cDelayTime13
  73. #define XY_CTHL_bLTCHECK_Delay cDelayTime14
  74. #define XY_CTHL_bSFBBAOJIN_Delay cDelayTime15
  75. #define XY_CTHL_bTFKGD_Delay cDelayTime16
  76. #define XY_CTHL_bXiaMoSJ_Delay cDelayTime17
  77. #define XY_CTHL_btest_Delay cDelayTime18
  78. #define XY_CTHL_bColor_Delay cDelayTime19
  79. #define XY_CTHL_ZDP_auto_Delay cDelayTime20
  80. #define XY_CTHL_SQJD_Delay cDelayTime21
  81. #define XY_CTHL_ShiJue_Delay cDelayTime22
  82. #define XY_CTHL_ShiJue_Delay1 cDelayTime23
  83. #define XY_CTHL_ShiJue_Delay2 cDelayTime24
  84. //32位无符号变量
  85. #define XY_CTHL_LianLengthCheck cUDword32Buff1
  86. #define XY_CTHL_LianLengthAutoCheck cUDword32Buff2
  87. #define XY_CTHL_LianLengthAutoCheckOLD cUDword32Buff3
  88. #define XY_CTHL_LianLengthAutoCheckERROR cUDword32Buff4
  89. #define XY_CTHL_LianLengSave cUDword32Buff5
  90. #define XY_CTHL_testDCF cUDword32Buff6
  91. #define XY_CTHL_LianLengthAutoCheckthree cUDword32Buff7
  92. #define XY_CTHL_LianLengthCheckOLD cUDword32Buff8
  93. #define XY_CTHL_LianLengthNEWCheck cUDword32Buff9
  94. #define XY_CTHL_LianLengthXC_Check cUDword32Buff10
  95. #define XY_CTHL_LianLengthERROR_Check cUDword32Buff11
  96. #define XY_CTHL_LianLengthBCLENGTH_Check cUDword32Buff12
  97. #define XY_CTHL_LianLengthTEXT cUDword32Buff13
  98. //32位有符号变量
  99. #define XY_CTHL_XSavePosBuff cDword32Buff1
  100. #define XY_CTHL_X_CXPosBuff cDword32Buff2
  101. #define XY_CTHL_YSavePosBuff cDword32Buff3
  102. #define XY_CTHL_CheckInX02PosBuff cDword32Buff4
  103. #define XY_CTHL_YsaveCXDWPosBuff cDword32Buff5
  104. #define XY_CTHL_LENTH cDword32Buff6
  105. #define XY_CTHL_Y_CL_Length cDword32Buff8
  106. //8位变量
  107. #define XY_CTHL_TryCnt cCharBuff1
  108. #define XY_CTHL_cZipCnt cCharBuff2
  109. #define cStopInCnt cCharBuff3
  110. #define cStopMode cCharBuff4
  111. #define cXcxcrCnt cCharBuff5
  112. #define cWULATOUCnt cCharBuff6
  113. #define cZDP_Auto cCharBuff7
  114. #define cQDXK_DXK cCharBuff8
  115. #define cBanAuTo cCharBuff9
  116. #define cXiaoChaTest cCharBuff10
  117. #define cXiaoChaCNT cCharBuff11
  118. #define cBAOHUCNT cCharBuff12
  119. #define cCHULIANBAOJIN cCharBuff13
  120. #define cZhouWanone cCharBuff14
  121. #define cZhouWantwo cCharBuff15
  122. #define cXMdelay cCharBuff16
  123. #define cXCXQXQD cCharBuff17
  124. #define cJACEXIAOCA cCharBuff18
  125. #define cTIMEONE cCharBuff19
  126. #define cDLPONE cCharBuff20
  127. #define cHeLian cCharBuff21
  128. #define cHeLianone cCharBuff22
  129. #define cStopGN cCharBuff23
  130. #define cCXCONE cCharBuff24
  131. #define cSTOPLENGTH cCharBuff25
  132. #define cONERROR cCharBuff26
  133. #define ctwoone cCharBuff27
  134. #define cShiJue cCharBuff28
  135. #define cXCGYcheck cCharBuff29
  136. #define cDJzzcd cCharBuff30
  137. //位标志位
  138. #define bTuiLaTouOkFlg bBitFlag0
  139. #define bZhuangLiaoOkFlg bBitFlag1
  140. #define bXiaMoENFlg bBitFlag2
  141. #define bYFirstDingWeiFlg bBitFlag3
  142. #define bCL_EN_FLG bBitFlag4
  143. #define bCL_OK_FLG bBitFlag5
  144. #define bCheckEN_FLG bBitFlag6
  145. #define bSingOneFlg bBitFlag7
  146. #define bHELIAN_OK bBitFlag7
  147. #define XY_CTHL_TOTAL_ADDR 76
  148. #define XY_CTHL_SPEED_ADDR 78
  149. #define XY_CTHL_ALARM_ADDR 100
  150. #define XY_CTHL_TRUST_ALARM_ADDR 102
  151. #define XY_CTHL_TEST_ALARM_ADDR 106
  152. //104、105地址 作产量锁
  153. #define XY_CTHL_PARAM_CYCLE_PULSE user_datas[0]//0 转一圈脉冲数
  154. #define XY_CTHL_PARAM_CYCLE_LENGTH user_datas[1]//整数 转一圈拖带多长
  155. #define XY_CTHL_PARAM_SFCYCLE_LENGTH user_datas[36] //伺服电机周长
  156. #define XY_CTHL_PARAM_TD_RunSpeed user_datas[2]//整数 拖带电机拖带速度
  157. #define XY_CTHL_PARAM_FKDW_Speed user_datas[3]//整数 方块定位速度(低速度)
  158. #define XY_CTHL_PARAM_CL_Speed user_datas[4]//整数 合链速度
  159. #define XY_CTHL_PARAM_CL_Back_O_Speed user_datas[5]//整数 合链电机回零速度
  160. #define XY_CTHL_PARAM_FKDW_Length user_datas[6]//0.01 方块定位长度
  161. #define XY_CTHL_PARAM_CXDW_Length user_datas[7]//0.01 插销定位长度
  162. #define XY_CTHL_PARAM_CL_Length user_datas[8]//0.01 合链长度
  163. #define XY_CTHL_PARAM_CL_MAX_Length user_datas[9]//0.01 穿链最长限制
  164. #define XY_CTHL_PARAM_TLiao_BACKDELAY (10*user_datas[10])//0.01推拉头到位延时返回
  165. #define XY_CTHL_PARAM_MaGou_DELAY (10*user_datas[11])//0.01接料到位延时码勾
  166. #define XY_CTHL_PARAM_HSLiaoOff_DELAY (10*user_datas[12])//0.01码勾输出后退横送料
  167. #define XY_CTHL_PARAM_CheckLT_DELAY (10*user_datas[13])//0.01码勾输出后延时检测拉头
  168. #define XY_CTHL_PARAM_HL_BACK_Time (10*user_datas[14])//0.01合链气缸返回时间
  169. #define XY_CTHL_PARAM_First_CL_Timer (10*user_datas[15]) //0.01一次穿入时间
  170. #define XY_CTHL_PARAM_MGOff_XiaMo_DELAY (10*user_datas[16]) //0.01松码勾后延时退下模
  171. #define XY_CTHL_PARAM_SCDWOff_CXDW_DELAY (10*user_datas[17]) //0.01插销延时穿入
  172. #define XY_CTHL_PARAM_XKDW_TD_DELAY (10*user_datas[18]) //0.01斜口定位后延时拖带
  173. #define XY_CTHL_PARAM_XK_CR_DELAY (10*user_datas[19]) //0.01斜口延时穿拉头
  174. #define XY_CTHL_PARAM_DXK_XKDW_Off_DELAY (10*user_datas[20]) //0.01顶斜口后延时退斜口定位
  175. #define XY_CTHL_PARAM_XCQJD_XCDW_DELAY (10*user_datas[21]) //0.01插销前夹带后延时插销定位
  176. #define XY_CTHL_PARAM_First_CL_DELAY (10*user_datas[22]) //0.01延时一次穿入
  177. #define XY_CTHL_PARAM_HLJJ_CL_DELAY (10*user_datas[23]) //0.01合链夹具延时穿入
  178. #define XY_CTHL_PARAM_ZDP_Start_TIME (10*user_datas[24]) //0.01振动盘启动延时
  179. #define XY_CTHL_PARAM_ZDP_Stop_TIME (10*user_datas[25]) //0.01振动盘延时停止
  180. #define XY_CTHL_PARAM_XCX_LENTH user_datas[26] //0.01 小插销感应后再走标准长度
  181. #define XY_CTHL_PARAM_XCXWC_LENTH user_datas[27] //0.01 小插销标准长度过长的误差值
  182. #define XY_CTHL_PARAM_TDFZ_LENTH user_datas[28] //0.01拖带电机反转长度
  183. #define XY_CTHL_PARAM_WLCDSHEZHI_LENTH (10* user_datas[29]) //0.1无拉链情况再走长度设置
  184. #define XY_CTHL_PARAM_DXKFZ_LENTH user_datas[30] //顶斜口反转长度
  185. #define XY_CTHL_PARAM_DXKYS_DELAY (user_datas[31]*10) //前顶斜口后延时顶斜口
  186. #define XY_CTHL_PARAM_ZDP_AUTO user_datas[32] //振动盘控制按钮
  187. #define XY_CTHL_PARAM_CXXY_MODE user_datas[33] //插销下移切换 0直插、1下移
  188. #define XY_CTHL_PARAM_FKJD_DELAY (user_datas[34]*10) //延时方块夹带
  189. #define XY_CTHL_PARAM_FKGD_DELAY (user_datas[35]*10) //延时方块固定
  190. #define XY_CTHL_PARAM_AUTO_MODE user_datas[37] //合拉头测长模式
  191. //#define XY_CTHL_PARAM_SDCFXM_MODE user_datas[38] //双电磁阀下模
  192. #define XY_CTHL_PARAM_NLSL_MODE user_datas[39] //尼龙塑料切换 0塑料/1尼龙
  193. #define XY_CTHL_PARAM_HLTSY_LENTH (user_datas[40]*10) //合拉头剩余长度
  194. #define XY_CTHL_PARAM_CR_MODE 1 //1为电机穿入,0为气缸穿入
  195. #define XY_CTHL_PARAM_BanZiDong user_datas[41]
  196. #define XY_CTHL_PARAM_CLT_Time (10*user_datas[42])//0.01 合链时间
  197. #define XY_CTHL_PARAM_XCCR_DEALY (user_datas[43]*10) //小插下移延时/定位延时
  198. #define XY_CTHL_PARAM_DYTLL_LENTH user_datas[44]
  199. //#define XY_CTHL_PARAM_XCCR_DEALY user_datas[45] //切换公司简介
  200. #define XY_CTHL_PARAM_CXTHREE_MODE user_datas[46] //小插三次切换
  201. #define XY_CTHL_PARAM_DB_MODE user_datas[47] //DB切换 0为DB口、1为IO口
  202. #define XY_CTHL_PARAM_FKJDSECONG_DEALY (user_datas[48]*10) //拖带方块夹带延时
  203. #define XY_CTHL_ANQUANMEN_MODE user_datas[49] //安全门切换
  204. #define XY_CTHL_AUTO_run_LENGTH user_datas[50] //色标感应后再走长度
  205. #define XY_CTHL_MotorChose_MODE user_datas[51] //伺服 步进
  206. #define XY_CTHL_DLPJG_TIME (user_datas[52]*10) //打拉片时间
  207. #define XY_CTHL_PARAM_DALIAOPIAN user_datas[53] //打拉片模式
  208. #define XY_CTHL_PARAM_COLOR_CODE user_datas[54] //色标感应 /0无 1 有
  209. #define XY_CTHL_PARAM_SD_LENGTH user_datas[55] //提前退松带气缸长度
  210. #define XY_CTHL_PARAM_SD_MODE user_datas[56] //提前退松带模式
  211. #define XY_CTHL_PARAM_LXC_SPEED user_datas[58] //拉小插速度
  212. #define XY_CTHL_PARAM_BanAuto_MODE user_datas[59] //半自动 模式切换
  213. //#define XY_CTHL_PARAM_first_SPEED 7500// user_datas[60] //半自动 模式切换
  214. #define XY_CTHL_PARAM_TQJD_DELAY (user_datas[61]*10) //延时退前夹带
  215. #define XY_CTHL_PARAM_STOP_length user_datas[62] //提前停机长度
  216. #define XY_CTHL_PARAM_XCDWGY_MODE user_datas[63] //小插到位感应切换
  217. #define XY_CTHL_PARAM_XCGY_MODE user_datas[64] //小插到位感应切换
  218. //视觉模式参数
  219. #define XY_CTHL_PARAM_SHIJUE_MODE user_datas[65] //视觉模式
  220. #define XY_CTHL_PARAM_JIANCHE_DEALY (user_datas[66]*10) //延时输出检测
  221. #define XY_CTHL_PARAM_DingLT_time (user_datas[67]*10) //顶拉头时间
  222. #define XY_CTHL_PARAM_GBXIANZZHI_DEALY (user_datas[68]*10)//延时关闭限制
  223. #define XY_CTHL_PARAM_DKXIANZZHI_DEALY (user_datas[69]*10)//延时打开限制
  224. #define XY_CTHL_PARAM_GBJIANCHE_DEALY (user_datas[70]*10)//延时关闭限制
  225. #define XY_CTHL_PARAM_DINGLTOU_DEALY (user_datas[71]*10)//延时输出顶拉头
  226. #define XY_CTHL_PARAM_ShiJue user_datas[72] //视觉控制
  227. #define XY_CTHL_SHIJUE_ONE 0 //1为视觉模式,0为正常模式
  228. #define XY_CTHL_PARAM_TQXCGZ_LENGTH user_datas[74] //提前小插勾针
  229. #define XY_CTHL_PARAM_DCGO_LENGTH user_datas[75] //大插上止定位再走长度
  230. #define XY_CTHL_PARAM_XCXJY_MODE 0// user_datas[76] //小插下降沿定位模式
  231. #define XY_CTHL_PARAM_XCDWZ_MODE user_datas[77] //小插定位针后上
  232. //速度调试参数
  233. #define XY_CTHL_XCCR_SPEED user_datas[150] //小插穿入速度
  234. #define XY_CTHL_XCCR_LENGTH user_datas[151] //小插穿入长度
  235. #define XY_CTHL_PARAM_first_SPEED user_datas[152] //]第一条速度
  236. #define XY_CTHL_PARAM_first_LENGTH user_datas[153] //第一条定位长度
  237. #define XY_CTHL_StopSlow_LENGTH user_datas[154] //减速停机长度
  238. #define XY_CTHL_GYHKSD_SPEED user_datas[155] //感应后速度
  239. //输入
  240. #define XY_CTHL_FK_Check M0384 //X00方块检测
  241. #define XY_CTHL_FK_Check_UP (M0384 && !OLDM384)
  242. #define XY_CTHL_FK_Check_DW (!M0384 && OLDM384)
  243. #define XY_CTHL_XKSC_Limit_IN M0385 //X01斜口上止到位
  244. #define XY_CTHL_START_IN M0386 //X02 //启动
  245. #define XY_CTHL_START_IN_UP (M0386 && !OLDM386)//X02
  246. #define XY_CTHL_HSLiao_Origin_IN M0387 //X03横送料原位
  247. #define XY_CTHL_HSLiao_Limit_IN M0388 //X04横送料到位
  248. #define XY_CTHL_ZDP_IN M0389 //X05振动盘
  249. #define XY_CTHL_CTM_Limit_IN M0390 //X06穿头模到位
  250. #define XY_CTHL_First_CT_Origin_IN M0391 //X07一次穿头原位
  251. #define XY_CTHL_TLiao_Origin_IN M0392 //X10推料原位 原来是到位
  252. #define XY_CTHL_SF_Origin_IN M0393 //X11伺服原位(合链原位)
  253. #define XY_CTHL_LTou_Check M0394 //X12拉头缺料感应
  254. #define XY_CTHL_STOP_IN M0395 // X13 //停止
  255. #define XY_CTHL_STOP_IN_UP (M0395 && !OLDM395)
  256. #define XY_CTHL_STOP_IN_DW (!M0395 && OLDM395)
  257. #define XY_CTHL_CX_Limit_IN M0396 //X14插稍到位感应
  258. #define XY_CTHL_CXSC_Limit_IN M0397 //X15插稍上止感应
  259. #define XY_CTHL_CXSC_Limit_IN_UP (M0397 && !OLDM397)
  260. #define XY_CTHL_CXSC_Limit_IN_DW (!M0397 && OLDM397)
  261. #define XY_CTHL_XKTD_Origin_IN M0398 //X16斜口推带原位感应
  262. #define XY_CTHL_CXXY_Origin_IN M0399 //X17插稍下移到位
  263. #define XY_CTHL_JLiao_Limit_IN M0400 //X20接料到位
  264. #define XY_CTHL_CTM_Origin_IN M0401 //X21穿头模原位
  265. #define XY_CTHL_SafeDoor_IN M0403 //X23安全门
  266. #define XY_CTHL_SafeDoor_IN_DW (!M0403 && OLDM403)
  267. #define XY_CTHL_Colorcode_IN M0404 //X24色标感应
  268. #define XY_CTHL_Colorcode_IN_UP (M0404 && !OLDM404)
  269. //输出
  270. #define XY_CTHL_CTXM_VAVLE M0304 //Y00 穿头下模电磁阀
  271. #define XY_CTHL_FKJD_VAVLE M0305 //Y01 方块夹带电磁阀
  272. #define XY_CTHL_CXHDW_VAVLE M0306 //Y02 插销后定位电磁阀
  273. #define XY_CTHL_CXHJD_VAVLE M0307 //Y03 插销后夹带电磁阀
  274. #define XY_CTHL_HSLiao_VAVLE M0308 //Y04 横送料电磁阀
  275. #define XY_CTHL_XKTD_VAVLE M0309 //Y05 斜口推带电磁阀
  276. #define XY_CTHL_FKGD_VAVLE M0310 //Y06 方块固定电磁阀
  277. #define XY_CTHL_XKDW_VAVLE M0311 //Y07 斜口定位电磁阀
  278. #define XY_CTHL_CXDWZ_VAVLE M0312 //Y10 插销定位针(到位)电磁阀
  279. #define XY_CTHL_CXXY_VAVLE M0313 //Y11 插销下移电磁阀
  280. #define XY_CTHL_TLiao_VAVLE M0316 //Y14 推料电磁阀
  281. #define XY_CTHL_MGuo_VAVLE M0317 //Y15码勾电磁阀
  282. #define XY_CTHL_First_CT_VAVLE M0318 //Y16 一次穿头电磁阀
  283. #define XY_CTHL_JLTou_VAVLE M0319 //Y17 接拉头电磁阀
  284. #define XY_CTHL_DXK_VAVLE M0320 //Y20 顶斜口电磁阀
  285. #define XY_CTHL_CXQJD_VAVLE M0323 //Y23 插销前夹带电磁阀
  286. #define XY_CTHL_CXSCDW_VAVLE M0324 //Y24 插销上止定位电磁阀
  287. #define XY_CTHL_HLJJ_VAVLE M0325 //Y25 合链夹具电磁阀
  288. #define XY_CTHL_QDXK_VAVLE M0327 // Y27 前顶斜口电磁阀
  289. #define XY_CTHL_HL_VAVLE M0329 //Y12合链电磁阀
  290. #define XY_CTHL_CXHT_VAVLE M0330 //Y13插销后退电磁阀
  291. #if XY_CTHL_SHIJUE_ONE
  292. //视觉兼用
  293. #define XY_CTHL_JIANCHE_VAVLE M0314 // Y12检测电磁阀
  294. #define XY_CTHL_DINGCHU_VAVLE M0315 //Y13顶出电磁阀
  295. #define XY_CTHL_XIANZHI_VAVLE M0321 //Y21 限制电磁阀
  296. #define XY_CTHL_SHIJUEMODE_VAVLE M0328 //Y30 顶完信号
  297. #define XY_CTHL_ZDP_IN M0402 //X22振动盘
  298. //#define XY_CTHL_ZDP_IN_UP (M0402 && !OLDM402 )
  299. #define XY_CTHL_LMBJ M0389 //X05视觉信号振动盘
  300. #define XY_CTHL_LMBJ_UP (M0389 && !OLDM389 )
  301. #define XY_CTHL_ZhenDongPian_OUT M0326 //Y21 振动盘启动吹气电磁阀
  302. #define XY_CTHL_SF_ALR_CLR M0330 //Y26 伺服警告清除
  303. //视觉屏蔽
  304. #define XY_CTHL_DLP_VAVLE M0330 // Y12打拉片电磁阀
  305. #define XY_CTHL_SD_VAVLE M0330 //Y13松带电磁阀
  306. #define XY_CTHL_SF_ALR_IN M0410 //X22伺服报警
  307. #define XY_CTHL_XiaJiangXM_VAVLE M0330 //Y30 下模 (下降)
  308. #define XY_CTHL_SF_ALR_IN M0410 //X22伺服报警
  309. #else //无视觉
  310. //屏蔽
  311. #define XY_CTHL_JIANCHE_VAVLE M0330 // Y12检测电磁阀
  312. #define XY_CTHL_DINGCHU_VAVLE M0330 //Y13顶出电磁阀
  313. #define XY_CTHL_XIANZHI_VAVLE M0330 //Y21 限制电磁阀
  314. #define XY_CTHL_SHIJUEMODE_VAVLE M0328 //Y30 顶完信号
  315. #define XY_CTHL_LMBJ_UP (M0410 && !OLDM410 )
  316. //正常
  317. #define XY_CTHL_DLP_VAVLE M0314 // Y12打拉片电磁阀
  318. #define XY_CTHL_SF_ALR_CLR M0326 //Y26 伺服警告清除
  319. #define XY_CTHL_SF_ALR_IN M0402 //X22伺服报警
  320. #define XY_CTHL_SD_VAVLE M0315 //Y13松带电磁阀
  321. #define XY_CTHL_ZhenDongPian_OUT M0321 //Y21 振动盘启动吹气电磁阀
  322. #define XY_CTHL_XiaJiangXM_VAVLE M0328 //Y30 下模 (下降)//
  323. #define XY_CTHL_ZDP_IN M0389 //X05振动盘
  324. #endif
  325. //M0~M4全局固定使用
  326. /*
  327. #define bRunning M0000
  328. #define bStart M0001
  329. #define bStop M0002
  330. #define bAlarmStop M0003
  331. #define bClearTotal M0004
  332. */
  333. #define XY_CTHL_bTLiao M0005 //手动推料
  334. #define XY_CTHL_bHSL M0006 //手动横送料
  335. #define XY_CTHL_bJLT M0007 //接拉头
  336. #define XY_CTHL_bMG M0008 //码勾
  337. #define XY_CTHL_bFKJD M0009 //方块夹带
  338. #define XY_CTHL_bXKTD M0010 //斜口推带
  339. #define XY_CTHL_bXKDW M0011 //斜口定位
  340. #define XY_CTHL_bCTXM M0012 //穿头下模
  341. #define XY_CTHL_bDXK M0013 //顶斜口
  342. #define XY_CTHL_bFKGD M0014 //方块固定
  343. #define XY_CTHL_bCXQJD M0015 //插销前夹带
  344. #define XY_CTHL_bCXSY M0016 //插销上移电磁阀
  345. #define XY_CTHL_bCXDWZ M0017 //Y14 插销定位针电磁阀
  346. #define XY_CTHL_bCXHJD M0018 //Y15 插销后夹带电磁阀
  347. #define XY_CTHL_bCXHDW M0019 //Y16 插销后定位电磁阀
  348. //#define XY_CTHL_bCXDWCheck M0020 //Y17 插销到位电磁阀
  349. #define XY_CTHL_bFirst_CT M0021 //Y20 一次穿头电磁阀
  350. #define XY_CTHL_bHLJJ M0022 //Y21 合链夹具电磁阀
  351. #define XY_CTHL_bCXSCDW M0023 //Y23 插销上止定位电磁阀
  352. #define XY_CTHL_bCLMotor_P M0026 //穿链电机正转
  353. #define XY_CTHL_bCLMotor_N M0025 //穿链电机反转
  354. //下面为动作组合按键
  355. #define XY_CTHL_bAutoZhuangLiao M0024 //自动装料
  356. #define XY_CTHL_bCLMotor_O M0027 //穿链电机定位原点
  357. #define XY_CTHL_bCL_First M0028 //一次穿链动作
  358. #define XY_CTHL_bFKTDDW M0029 //拖带方块定位
  359. #define XY_CTHL_bFKCXTDDW M0030 //拖带方块插销定位
  360. #define XY_CTHL_bCXMotorDW M0031 //插销电机前定位
  361. #define XY_CTHL_bCXCR M0032 //插销穿入(包含电机前定位,插销下移,后夹,后定位)
  362. #define XY_CTHL_bMotorHL M0033 //电机合链操作
  363. #define XY_CTHL_bQianDXK M0034 //Y27 前顶斜口电磁阀
  364. #define XY_CTHL_bQianDXK_DXK M0035 //顶斜口动作
  365. #define XY_CTHL_bTESTCXTD M0036 //测试插销拖带长度
  366. #define XY_CTHL_bBanZiDong M0037 //半自动
  367. #define XY_CTHL_bSingleone M0038 //单循环
  368. #define XY_CTHL_bXiaoChaTest M0039 //小插销测试
  369. #define XY_CTHL_bCXHT M0040 //Y12 插销后退
  370. #define XY_CTHL_bHL M0041 //Y13 插销后退
  371. #define XY_CTHL_MotorTEST M0042 //拖带电机测试
  372. #define XY_CTHL_MotorTEST_N M0043 //拖带电机测试N
  373. #define XY_CTHL_DLP M0044 //打拉片
  374. #define XY_CTHL_STOPone M0045 //拖带电机测试N
  375. #define XY_CTHL_SD M0046 //松带
  376. #define XY_CTHL_CXC M0047 //穿小插
  377. #define XY_CTHL_DANBU_MODE M0048 //单步动作
  378. #define XY_CTHL_bXianZhi M0049 //限制电磁阀
  379. #define XY_CTHL_bJianChe M0050 //检测电磁阀
  380. #define XY_CTHL_bDingChu M0051 //顶出电磁阀
  381. #endif