JHChuantou_NL_HeLian.h 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403
  1. #ifndef __JHCHUANGTOU_NL_HELIAN_H__
  2. #define __JHCHUANGTOU_NL_HELIAN_H__
  3. #if JIN_HONG_MACHINE==1
  4. extern void JH_CTHL_NL_Action(void);
  5. extern void JH_CTHL_NL_InitAction(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 ALARM_CLR 1
  13. #define ALARM_NOCLR 0
  14. #define JH_CTHL_NL_VAVLE_ERROR_TIME 3000
  15. #define JH_CTHL_NL_MOTOR_ALARM_TIME 5000
  16. //故障代码列表
  17. #define JH_CTHL_NL_NO_ALARM 0
  18. #define JH_CTHL_NL_WLZDTJ_ALARM 1 //无拉链自动停机
  19. #define JH_CTHL_NL_XKSC_Limit_ALARM 2 //X03斜口上止到位异常
  20. #define JH_CTHL_NL_TLiao_Limit_ALARM 3 //X04推料到位异常
  21. #define JH_CTHL_NL_HSLiao_Limit_ALARM 5 //X06横送料到位异常
  22. #define JH_CTHL_NL_HSLiao_Origin_ALARM 6 //X07横送料原位异常
  23. #define JH_CTHL_NL_JLiao_Limit_ALARM 7 //X10接料到位异常
  24. #define JH_CTHL_NL_CTM_Limit_ALARM 8 //X11穿头模到位异常
  25. #define JH_CTHL_NL_CTM_Origin_ALARM 9 //X12穿头模原位异常
  26. #define JH_CTHL_NL_First_CT_Origin_ALARM 10 //X13一次穿头原位异常
  27. #define JH_CTHL_NL_LTou_Check_ALARM 11 //X14拉头缺料感应异常
  28. #define JH_CTHL_NL_CXSC_Limit_ALARM 12 //X15插稍上止感应异常
  29. #define JH_CTHL_NL_CX_Limit_ALARM 13 //X16插稍到位感应异常
  30. #define JH_CTHL_NL_XKTD_Origin_ALARM 14 //X17斜口原位感应异常
  31. #define JH_CTHL_NL_CXGL_Limit_ALARM 15 //X20插稍下移到位异常
  32. #define JH_CTHL_NL_SF_ALR_ALARM 16 //X22伺服报警异常
  33. #define JH_CTHL_NL_SF_Origin_ALARM 17 //X23伺服原位(穿链原位)异常
  34. #define JH_CTHL_NL_ZLT_ALARM 18 //装拉头异常
  35. #define JH_CTHL_NL_FK_Check_ALARM 19 //X02方块检测
  36. #define JH_CTHL_NL_FKCXDW_ALARM 20 //方块插销定位异常警告
  37. #define JH_CTHL_NL_YCCRYWYC_ALARM 21 //一次穿入原位异常
  38. #define JH_CTHL_NL_XCXXCYC_ALARM 22 //小插销行程异常
  39. #define JH_CTHL_NL_HENSONGLIAO_ALARM 23 //横送料不能输出
  40. #define JH_CTHL_NL_YCCT_ALARM 24 //一次穿头不能输出
  41. #define JH_CTHL_NL_YCXM_Origin_ALARM 25 //一次穿头和下模不能输出
  42. #define JH_CTHL_NL_DXKCTXM_Origin_ALARM 26 //顶斜口和穿头下模不能输出
  43. #define JH_CTHL_NL_XKTD_ALARM 27 //斜口推带不能有输出
  44. #define JH_CTHL_NL_CXQJD_ALARM 28 //插销前夹带不能有输出
  45. #define JH_CTHL_NL_WFZIDONGCX_ALARM 29 //无法自动插销
  46. #define JH_CTHL_NL_SafeDoor_ALARM 30 //安全门关上才能启动
  47. #define JH_CTHL_NL_YAxis_Limit_ALARM 31 //合链电机超过最大行程范围
  48. #define JH_CTHL_NL_YAxis_Origin_ALARM 32 //合链电机回零失败
  49. #define JH_CTHL_NL_Y_SF_ALR_ALARM 33 //Y伺服报警
  50. #define JH_CTHL_NL_SongDai_ALARM 34 //送带异常
  51. #define JH_CTHL_NL_SERVO_CONFIG_ALARM 35 //伺服配置转矩限制失败
  52. #define JH_CTHL_NL_AutoStep cStepMByte
  53. #define JH_CTHL_NL_ZhuangLiaoStep cStepMByte1
  54. #define JH_CTHL_NL_TLiaoStep cStepMByte2
  55. #define JH_CTHL_NL_TD_MotorStep cStepMByte3 //拖带电机
  56. #define JH_CTHL_NL_JiaLianStep cStepMByte4
  57. #define JH_CTHL_NL_ZhenDongStep cStepMByte6
  58. #define JH_CTHL_NL_SongLiaoStep cStepMByte7
  59. #define JH_CTHL_NL_CL_MotorStep cStepMByte8 //穿链
  60. #define JH_CTHL_NL_AutoStep1 cStepMByte9
  61. #define JH_CTHL_NL_bFKCXTDDW_Step cStepMByte10
  62. #define JH_CTHL_NL_bCXCR_Step cStepMByte11
  63. #define JH_CTHL_NL_bCLFirst_Step cStepMByte12
  64. #define JH_CTHL_NL_HeMoStep cStepMByte13
  65. #define JH_CTHL_NL_SongDai_Step cStepMByte14
  66. #define JH_CTHL_NL_ZhuangLiaoDelay cDelayTime2
  67. #define JH_CTHL_NL_TLiao_Delay cDelayTime3
  68. #define JH_CTHL_NL_TD_MotorDelay cDelayTime4
  69. #define JH_CTHL_NL_AutoDelay cDelayTime5
  70. #define JH_CTHL_NL_TestDelay cDelayTime6
  71. #define JH_CTHL_NL_CL_MotorDelay cDelayTime7
  72. #define JH_CTHL_NL_TouchDelay cDelayTime8
  73. #define JH_CTHL_NL_AutoDelay1 cDelayTime9
  74. #define JH_CTHL_NL_ZDP_Delay cDelayTime10
  75. #define JH_CTHL_NL_bCXCR_Delay cDelayTime11
  76. #define JH_CTHL_NL_bFKCXTDDW_Delay cDelayTime12
  77. #define JH_CTHL_NL_bCLFirst_Delay cDelayTime13
  78. #define JH_CTHL_NL_bLTCHECK_Delay cDelayTime14
  79. #define JH_CTHL_NL_bSFBBAOJIN_Delay cDelayTime15
  80. #define JH_CTHL_NL_HeMo_Time cDelayTime16
  81. #define JH_CTHL_NL_SongDai_Delay cDelayTime17
  82. #define JH_CTHL_NL_SongDai_Delay2 cDelayTime18
  83. #define JH_CTHL_NL_XMDW_DELAY cDelayTime19
  84. //16位变量
  85. #define JH_CTHL_NL_RunStepSave cUShort16Buff1
  86. #define JH_CTHL_NL_TDMotorStepSave cUShort16Buff2
  87. #define cXCLD_MAX_LENGTH cUShort16Buff3
  88. //32位无符号变量
  89. #define JH_CTHL_NL_LianLengthCheck cUDword32Buff1
  90. #define JH_CTHL_NL_LianLengthAutoCheck cUDword32Buff2
  91. #define JH_CTHL_NL_LianLengthAutoCheckOLD cUDword32Buff3
  92. #define JH_CTHL_NL_TimeBuff cUDword32Buff4
  93. #define JH_CTHL_NL_LianLengthCheckReal cUDword32Buff5
  94. #define JH_CTHL_NL_LianLengthAutoFirst cUDword32Buff6
  95. //32位有符号变量
  96. #define JH_CTHL_NL_XSavePosBuff cDword32Buff1
  97. #define JH_CTHL_NL_X_CXPosBuff cDword32Buff2
  98. #define JH_CTHL_NL_YSavePosBuff cDword32Buff3
  99. #define CheckInX02PosBuff cDword32Buff4
  100. #define JH_CTHL_NL_YsaveCXDWPosBuff cDword32Buff5
  101. #define JH_CTHL_NL_LENTH cDword32Buff6
  102. #define JH_CTHL_NL_X_FKCheckPos cDword32Buff7
  103. #define JH_CTHL_NL_Y_CL_Length cDword32Buff8
  104. #define JH_CTHL_NL_Y_CL_PosBuff cDword32Buff9
  105. #define JH_CTHL_NL_LENCountBuff cDword32Buff10
  106. #define JH_CTHL_NL_Y_CL_PosBuff1 cDword32Buff11
  107. #define JH_CTHL_NL_X_CXPosBuff1 cDword32Buff12
  108. #define JH_CTHL_NL_X_AutoLENGTH cDword32Buff13
  109. #define JH_CTHL_LianLengthERROR_Check cDword32Buff14
  110. #define JH_CTHL_NL_LianLengthXC_Check cDword32Buff15
  111. //8位变量
  112. #define JH_CTHL_NL_TryCnt cCharBuff1
  113. #define JH_CTHL_NL_cZipCnt cCharBuff2
  114. #define cStopInCnt cCharBuff3
  115. #define cStopMode cCharBuff4
  116. #define cXcxcrCnt cCharBuff5
  117. #define cWULATOUCnt cCharBuff6
  118. #define bSingOneCnt cCharBuff7
  119. #define cCHULIANBAOJIN cCharBuff8
  120. #define cCXCONE cCharBuff9
  121. #define cBanAuTo cCharBuff10
  122. #define cHeLian cCharBuff11
  123. #define cHeLianone cCharBuff12
  124. #define cDJzzcd cCharBuff13
  125. #define cXCDWONE cCharBuff14
  126. //位标志位
  127. #define bTuiLaTouOkFlg bBitFlag0
  128. #define bZhuangLiaoOkFlg bBitFlag1
  129. #define bXiaMoENFlg bBitFlag2
  130. #define bYFirstDingWeiFlg bBitFlag3
  131. #define bCL_EN_FLG bBitFlag4
  132. #define bCL_OK_FLG bBitFlag5
  133. #define bCheckEN_FLG bBitFlag6
  134. #define bSingOneFlg bBitFlag7
  135. #define JH_CTHL_NL_bXCBackOK bBitFlag8
  136. #define JH_CTHL_NL_bDinweiOK bBitFlag9
  137. #define JH_CTHL_NL_bTest bBitFlag10
  138. #define JH_CTHL_NL_bReStart bBitFlag11
  139. #define JH_CTHL_NL_X_EN_FLG bBitFlag12
  140. #define JH_CTHL_NL_Y_EN_FLG bBitFlag13
  141. #define JH_CTHL_NL_CXDW_Stop bBitFlag14
  142. #define JH_CTHL_NL_TOTAL_ADDR 76
  143. #define JH_CTHL_NL_WORK_TOTAL_ADDR 102
  144. //#define JH_CTHL_NL_CUR_TOTAL_ADDR 104
  145. #define JH_CTHL_NL_SPEED_ADDR 78
  146. #define JH_CTHL_NL_ALARM_ADDR 100
  147. #define JH_CTHL_NL_PARAM_CYCLE_PULSE user_datas[0]//0 转一圈脉冲数 (拖带)
  148. #define JH_CTHL_NL_PARAM_CYCLE_LENGTH user_datas[1]//0.1 转一圈拖带多长 (拖带)
  149. #define JH_CTHL_NL_PARAM_TD_RunSpeed user_datas[2]//整数 拖带电机拖带速度
  150. #define JH_CTHL_NL_PARAM_FKDW_Speed user_datas[3]//整数 方块定位速度(低速度)
  151. #define JH_CTHL_NL_PARAM_CL_Speed user_datas[4]//整数 合链速度
  152. #define JH_CTHL_NL_PARAM_CL_Back_O_Speed user_datas[5]//整数 合链电机回零速度
  153. #define JH_CTHL_NL_PARAM_FKDW_Length user_datas[6]//0.01 方块定位长度
  154. #define JH_CTHL_NL_PARAM_CXDW_Length user_datas[7]//0.01 插销定位长度
  155. #define JH_CTHL_NL_PARAM_CL_Length user_datas[8]//0.01 合链长度(气缸时为时间)
  156. #define JH_CTHL_NL_PARAM_CLT_Time (10*user_datas[8])//0.01 合链时间
  157. #define JH_CTHL_NL_PARAM_CL_MAX_Length user_datas[9]//0.01 穿链最长限制
  158. #define JH_CTHL_NL_PARAM_TLiao_BACKDELAY (10*user_datas[10])//0.01推拉头到位延时返回
  159. #define JH_CTHL_NL_PARAM_MaGou_DELAY (10*user_datas[11])//0.01接料到位延时码勾
  160. #define JH_CTHL_NL_PARAM_HSLiaoOff_DELAY (10*user_datas[12])//0.01码勾输出后退横送料
  161. #define JH_CTHL_NL_PARAM_CheckLT_DELAY (10*user_datas[13])//0.01码勾输出后延时检测拉头
  162. #define JH_CTHL_NL_PARAM_HL_BACK_Time (10*user_datas[14])//0.01合链气缸返回时间
  163. #define JH_CTHL_NL_PARAM_First_CL_Timer (10*user_datas[15]) //0.01一次穿入时间
  164. #define JH_CTHL_NL_PARAM_MGOff_XiaMo_DELAY (10*user_datas[16]) //0.01松码勾后延时退下模
  165. #define JH_CTHL_NL_PARAM_CXCR_DELAY (10*user_datas[17]) //0.01插销延时穿入
  166. #define JH_CTHL_NL_PARAM_XKDW_TD_DELAY (10*user_datas[18]) //0.01斜口定位后延时拖带
  167. #define JH_CTHL_NL_PARAM_XK_CR_DELAY (10*user_datas[19]) //0.01斜口延时穿拉头
  168. #define JH_CTHL_NL_PARAM_DXK_XKDW_Off_DELAY (10*user_datas[20]) //0.01顶斜口后延时退方块勾针
  169. //#define JH_CTHL_NL_PARAM_XCQJD_XCDW_DELAY (10*user_datas[21]) //0.01插销前夹带后延时插销定位
  170. #define JH_CTHL_NL_PARAM_First_CL_DELAY (10*user_datas[22]) //0.01延时一次穿入
  171. #define JH_CTHL_NL_PARAM_HLJJ_CL_DELAY (10*user_datas[23]) //0.01合链夹具延时合链
  172. #define JH_CTHL_NL_PARAM_ZDP_Start_TIME (10*user_datas[24]) //0.01振动盘启动延时
  173. #define JH_CTHL_NL_PARAM_ZDP_Stop_TIME (10*user_datas[25]) //0.01振动盘延时停止
  174. #define JH_CTHL_NL_PARAM_XCX_LENTH user_datas[26] //0.01 小插销感应后再走标准长度
  175. #define JH_CTHL_NL_PARAM_XCXWC_LENTH user_datas[27] //0.01 小插销标准长度过长的误差值
  176. #define JH_CTHL_NL_PARAM_TDFZ_LENTH user_datas[28] //0.01拖带电机反转长度
  177. #define JH_CTHL_NL_PARAM_WLCDSHEZHI_LENTH (10* user_datas[29]) //0.1无拉链情况再走长度设置
  178. #define JH_CTHL_NL_PARAM_YCYCLE_PULSE user_datas[30]//Y轴转一圈脉冲数
  179. #define JH_CTHL_NL_PARAM_YCYCLE_LENGTH user_datas[31]//Y轴 整数 转一圈拖带多长
  180. #define JH_CTHL_NL_PARAM_CR_MODE user_datas[32]//气缸穿入(0)还时电机穿入(1)
  181. //#define JH_CTHL_NL_PARAM_XXHT_Time (10*user_datas[33])//0.01 插销退回时间
  182. #define JH_CTHL_NL_PARAM_XKDW_Speed (user_datas[33])//斜口定位速度
  183. #define JH_CTHL_NL_PARAM_DXK_DELAY (10*user_datas[34])//0.01 插销退回时间
  184. #define JH_CTHL_NL_PARAM_CXJZ_HT_DELAY (10*user_datas[35]) //0.01插销前夹具延时后退
  185. #define JH_CTHL_NL_PARAM_Y_MAX_LENTH (user_datas[36]) //0.01 合链电机最大行程
  186. #define JH_CTHL_NL_PARAM_LACHUBAOHU_LENTH (user_datas[37]) //0.01 上止定位延时停电机
  187. #define JH_CTHL_NL_PARAM_TDCR_LowSpeed user_datas[38] //拖带穿入慢速度
  188. #define JH_CTHL_NL_PARAM_TDCR_LowSpeedLength user_datas[39] //拖带穿入慢速距离
  189. #define JH_CTHL_NL_PARAM_HSLYDTL_DELAY (10*user_datas[40]) //0.01 横送料原点延时推料
  190. #define JH_CTHL_NL_PARAM_UP_DOWN_OUT_SELECT (user_datas[41]) //拉链类型 0 树脂,1尼龙
  191. #define JH_CTHL_NL_PARAM_TuiDXM_Lenght (user_datas[42]) //退顶斜码位置
  192. #define JH_CTHL_NL_PARAM_GFJ_WorkMode (user_datas[43]) //公分节操作选择
  193. #define JH_CTHL_NL_PARAM_GFJ_Length (user_datas[44]) //公分节长度标准
  194. #define JH_CTHL_NL_PARAM_QianMaSelect (user_datas[45]) //前码类型选择
  195. #define JH_CTHL_NL_PARAM_ZDP_AUTO user_datas[46] //振动盘控制
  196. #define JH_CTHL_NL_PARAM_MOTOR_ENSelect user_datas[47] //合链电机类型 0 伺服 ,1 步进
  197. #define JH_CTHL_NL_PARAM_BoardSelect user_datas[48] //板块类型 0 DB15 ,1 无DB15
  198. #define JH_CTHL_NL_PARAM_SongDaiTime (10*user_datas[49]) //送带时间
  199. #define JH_CTHL_NL_PARAM_SongDaiEn user_datas[50] //送带配置 0 无送带 ,1 有送带
  200. #define JH_CTHL_NL_PARAM_CXSX_En user_datas[51] //插销上下开关 0 开 ,1 关
  201. #define JH_CTHL_NL_PARAM_FKDW_LowSpeedLength user_datas[52] //方块定位的慢速长度
  202. #define JH_CTHL_NL_PARAM_FKTD_ChangeSpeedPos user_datas[53] //拖带变速位置
  203. #define JH_CTHL_NL_PARAM_FDOff_Pos user_datas[54] //分带关闭位置
  204. #define JH_CTHL_NL_PARAM_FD_EN user_datas[55] //分带开关
  205. #define JH_CTHL_NL_PARAM_FKJD_DELAY (10*user_datas[56]) //方块夹带延时
  206. #define JH_CTHL_NL_PARAM_FKJDFZ_DELAY (10*user_datas[57]) //方块夹带延时
  207. #define JH_CTHL_NL_PARAM_XKMS_LENGTH user_datas[58] //前码穿入慢速长度
  208. #define JH_CTHL_NL_PARAM_CR_SPEED user_datas[60] //穿入速度
  209. #define JH_CTHL_NL_PARAM_CR_LENGTH user_datas[61] //穿入长度
  210. #define JH_CTHL_NL_FK_IN_SPEED user_datas[62] //方块感应后慢速度
  211. #define JH_CTHL_NL_XC_IN_LENGTH user_datas[63] //小插感应后慢速长度
  212. #define JH_CTHL_NL_CX_IN_DW_LENGTH user_datas[64] //小插感应后再走长度
  213. #define JH_CTHL_NL_PARAM_XCRU user_datas[65]//作监控
  214. #define JH_CTHL_NL_PARAM_CXCR user_datas[66]//作监控
  215. #define JH_CTHL_NL_PARAM_QMDW_LENGTH user_datas[67]//延时输出前码定位
  216. #define JH_CTHL_NL_PARAM_CX_DELAY (user_datas[68]*10)
  217. #define JH_CTHL_PARAM_DCGO_LENGTH user_datas[69]//前码定位后再走长度
  218. #define JH_CTHL_PARAM_YaDai_LENGTH user_datas[70]//提前压带
  219. #define JH_CTHL_PARAM_XCLD_MAX_LENGTH user_datas[71]//小插拉带最大拉出长度
  220. #define JH_CTHL_TRARR_FK_SPEED user_datas[72]//入方块的扭矩速度
  221. #define JH_CTHL_LOCAL_LOW_SPEED user_datas[73]//转向扭矩的低速速度
  222. #define JH_CTHL_TRARR_RUN_LENGTH user_datas[74]//扭矩行走距离
  223. #define JH_CTHL_X_RUN_MODE user_datas[86]//X轴入方块模式
  224. #define JH_CTHL_Y_RUN_MODE user_datas[87]//Y轴入方块模式
  225. //
  226. //伺服参数 180~190
  227. #define SERVO_PARAM_TRARR_LIMITMAX user_datas[180]//伺服扭矩最大限制
  228. #define SERVO_PARAM_TRARR_LIMITMIN user_datas[181]//伺服扭矩最小限制
  229. #define SERVO_PARAM_SPEED_DIFFER user_datas[182]//速度差值
  230. #define SERVO_PARAM_ENCODE user_datas[190]//转换后的值
  231. #define SERVO_PARAM_ALARM user_datas[192]//转换后的值
  232. //横送检测时间
  233. #define HSLIAO_CHECK_TIME 1//横送是检测穿头模和第一次合链是否在原位
  234. //输入
  235. #define JH_CTHL_NL_START_IN M0384 //X00 //启动
  236. #define JH_CTHL_NL_START_IN_UP (M0384 && !OLDM384)//(X00 && !OLDX00)
  237. #define JH_CTHL_NL_STOP_IN M0385 // X01 //停止
  238. #define JH_CTHL_NL_STOP_IN_UP (M0385 && !OLDM385)//(X01 && !OLDX01)
  239. #define JH_CTHL_NL_STOP_IN_DW (!M0385 && OLDM385)//(!X01 && OLDX01)
  240. #define JH_CTHL_NL_FK_Check M0386 //X02方块检测
  241. #define JH_CTHL_NL_FK_Check_UP (M0386 && !OLDM386)
  242. #define JH_CTHL_NL_FK_Check_DW (!M0386 && OLDM386)
  243. #define JH_CTHL_NL_XKSC_Limit_IN M0387 //X03斜口上止到位
  244. #define JH_CTHL_NL_TLiao_Limit_IN M0388 //X04推料到位
  245. #define JH_CTHL_NL_SafeDoor_IN 1//M0389 //X05安全门
  246. #define JH_CTHL_NL_HSLiao_Limit_IN M0390 //X06横送料到位
  247. #define JH_CTHL_NL_HSLiao_Origin_IN M0391 //X07横送料原位
  248. #define JH_CTHL_NL_JLiao_Limit_IN M0392 //X10接料到位
  249. #define JH_CTHL_NL_CTM_Limit_IN M0393 //X11穿头模到位
  250. #define JH_CTHL_NL_CTM_Origin_IN M0394 //X12穿头模原位
  251. #define JH_CTHL_NL_First_CT_Origin_IN M0395 //X13一次穿头原位
  252. #define JH_CTHL_NL_LTou_Check M0396 //X14拉头缺料感应
  253. #define JH_CTHL_NL_CXSC_Limit_IN M0397 //X15插稍上止感应
  254. #define JH_CTHL_NL_CXSC_Limit_IN_UP (M0397 && !OLDM397)
  255. #define JH_CTHL_NL_CXSC_Limit_IN_DW (!M0397 && OLDM397)
  256. #define JH_CTHL_NL_CX_Limit_IN M0398 //X16插稍到位感应
  257. #define JH_CTHL_NL_XKTD_Origin_IN M0399 //X17斜口推带原位感应
  258. #define JH_CTHL_NL_CXXY_Limit_IN M0400 //X20插稍下移到位
  259. #define JH_CTHL_NL_ZDP_IN M0401 //X21振动盘
  260. #define JH_CTHL_NL_SF_ALR_IN M0402 //X22伺服报警
  261. #define JH_CTHL_NL_SF_Origin_IN M0403 //X23伺服原位(穿链原位)
  262. #define JH_CTHL_NL_Y_SF_ALR_IN M0404 //X24伺服报警
  263. #define JH_CTHL_NL_SongDai_Origin_IN M0405 //X25 送带原点
  264. #define JH_CTHL_NL_SongDai_Limit_IN M0406 //X26 送带到位
  265. //#define JH_CTHL_NL_Test_Motor_P M0404 //测试用
  266. //#define JH_CTHL_NL_Test_Motor_N M0405 //测试用
  267. //输出
  268. #define JH_CTHL_NL_XKDW_VAVLE M0304 //Y00 斜口定位电磁阀(方块勾针)
  269. #define JH_CTHL_NL_XKTD_VAVLE M0305 //Y01 斜口推带电磁阀(前码前后)
  270. #define JH_CTHL_NL_DXK_VAVLE M0306 //Y02 顶斜口电磁阀(顶斜码)
  271. #define JH_CTHL_NL_GDXM_VAVLE M0307 //Y03 固定斜码
  272. #define JH_CTHL_NL_FKGD_VAVLE M0308 //Y04 方块固定电磁阀(方块定位)
  273. #define JH_CTHL_NL_CXSCDW_VAVLE M0330 //Y05 插销上止定位电磁阀(小插勾针)
  274. #define JH_CTHL_NL_CXSX_VAVLE M0310 //Y06 插销下移电磁阀(小插销上下)
  275. #define JH_CTHL_NL_CXQJD_VAVLE M0311 //Y07 插销前夹带电磁阀(插销前锁带)
  276. //#define JH_CTHL_NL_CXHT_VAVLE M0312 //Y10 摆臂
  277. #define JH_CTHL_NL_BB_VAVLE M0312 //Y10 摆臂
  278. #define JH_CTHL_NL_HLJJ_VAVLE M0313 //Y11 合链夹具电磁阀(夹子)
  279. #define JH_CTHL_NL_CXHDW_VAVLE M0314 //Y12 插销后定位电磁阀(穿小插)
  280. #define JH_CTHL_NL_CXHJD_VAVLE M0315 //Y13 插销后夹带电磁阀(穿小插锁带)
  281. #define JH_CTHL_NL_FKJD_VAVLE M0316 //Y14 方块夹带电磁阀(大插锁带)
  282. #define JH_CTHL_NL_TLiao_VAVLE M0317 //Y15 推料电磁阀
  283. #define JH_CTHL_NL_HSLiao_VAVLE M0318 //Y16 横送料电磁阀
  284. #define JH_CTHL_NL_JLTou_VAVLE M0319 //Y17 接拉头电磁阀
  285. #define JH_CTHL_NL_CTXMSS_VAVLE M0320 //Y20 穿头下模上升电磁阀
  286. #define JH_CTHL_NL_FengDai_VAVLE M0321 //Y21 分带电磁阀
  287. #define JH_CTHL_NL_ZhenDongPian_OUT M0322 //Y22 振动盘启动
  288. #define JH_CTHL_NL_First_CT_VAVLE M0323 //Y23 穿拉头电磁阀
  289. #define JH_CTHL_NL_MGuo_VAVLE M0324 //Y24 码勾电磁阀
  290. #define JH_CTHL_NL_Run_DENG_VAVLE M0325 //Y25 运行
  291. #define JH_CTHL_NL_Stop_DENG_VAVLE M0327 //Y27 待机
  292. #define JH_CTHL_NL_ERROR_DENG_VAVLE M0328 //Y30 报警
  293. #define JH_CTHL_NL_CXDWZ_VAVLE M0326 //Y26 插销定位针(到位)电磁阀(小插卡位)
  294. #define JH_CTHL_NL_YaiDai_VAVLE M0309 //Y27 告警清除
  295. #define JH_CTHL_NL_SongDai_VAVLE M0330 //Y30 送带电机启动
  296. #define JH_CTHL_NL_HL_VAVLE M0330 //Y25 合链电磁阀
  297. #define JH_CTHL_NL_ALARMCLR_VAVLE M0330 //Y27 告警清除
  298. #define JH_CTHL_NL_Run_State M0330 //Y31 运行灯
  299. #define JH_CTHL_NL_Stop_State M0330 //Y32 停止灯
  300. //M0~M4全局固定使用
  301. /*
  302. #define bRunning M0000
  303. #define bStart M0001
  304. #define bStop M0002
  305. #define bAlarmStop M0003
  306. #define bClearTotal M0004
  307. */
  308. #define JH_CTHL_NL_bTLiao M0005 //手动推料
  309. #define JH_CTHL_NL_bHSL M0006 //手动横送料
  310. #define JH_CTHL_NL_bJLT M0007 //接拉头
  311. #define JH_CTHL_NL_bMG M0008 //码勾
  312. #define JH_CTHL_NL_bFKJD M0009 //方块夹带
  313. #define JH_CTHL_NL_bXKTD M0010 //斜口推带
  314. #define JH_CTHL_NL_bXKDW M0011 //斜口定位
  315. #define JH_CTHL_NL_bCTXM M0012 //穿头下模
  316. #define JH_CTHL_NL_bDXK M0013 //顶斜口
  317. #define JH_CTHL_NL_bFKGD M0014 //方块固定
  318. #define JH_CTHL_NL_bCXQJD M0015 //插销前夹带
  319. #define JH_CTHL_NL_bCXSY M0016 //插销下移电磁阀
  320. #define JH_CTHL_NL_bCXDWZ M0017 //Y14 插销定位针电磁阀
  321. #define JH_CTHL_NL_bCXHJD M0018 //Y15 插销后夹带电磁阀
  322. #define JH_CTHL_NL_bCXHDW M0019 //Y16 插销后定位电磁阀(插销穿入)
  323. #define JH_CTHL_NL_bXKGD M0020 //Y17 固定斜码电磁阀
  324. #define JH_CTHL_NL_bFirst_CT M0021 //Y20 一次穿头电磁阀(穿拉头)
  325. #define JH_CTHL_NL_bHLJJ M0022 //Y21 合链夹具电磁阀
  326. #define JH_CTHL_NL_bCXSCDW M0023 //Y23 插销上止定位电磁阀
  327. #define JH_CTHL_NL_bCXHT M0034 //Y10 插销后退
  328. #define JH_CTHL_NL_bHL M0035 //合链电磁阀
  329. #define JH_CTHL_NL_bZDP M0036 //振动盘
  330. #define JH_CTHL_NL_bBB M0037 //摆臂
  331. #define JH_CTHL_NL_bFD M0038 //分带
  332. #define JH_CTHL_NL_bTiaoShiStep M0041
  333. #define JH_CTHL_NL_bTiaoShiMode M0040
  334. #define JH_CTHL_NL_bOnceStart M0042 //单一启动,做一条停止
  335. #define JH_CTHL_NL_bBanZiDong M0047 //前码穿入
  336. #define JH_CTHL_NL_CXC M0048 //小插穿入
  337. #define JH_CTHL_NL_bCLMotor_P M0026 //穿链电机正转
  338. #define JH_CTHL_NL_bCLMotor_N M0025 //穿链电机反转
  339. //下面为动作组合按键
  340. #define JH_CTHL_NL_bAutoZhuangLiao M0024 //自动装料
  341. #define JH_CTHL_NL_bCLMotor_O M0027 //穿链电机定位原点
  342. #define JH_CTHL_NL_bCL_First M0028 //一次穿链动作
  343. #define JH_CTHL_NL_bFKTDDW M0029 //拖带方块定位
  344. #define JH_CTHL_NL_bFKCXTDDW M0030 //拖带方块插销定位
  345. #define JH_CTHL_NL_bCXMotorDW M0031 //插销电机前定位
  346. #define JH_CTHL_NL_bCXCR M0032 //插销穿入(包含电机前定位,插销下移,后夹,后定位)
  347. #define JH_CTHL_NL_bMotorHL M0033 //电机合链操作
  348. #define JH_CTHL_NL_bTDMotor_P M0046 //穿链电机正转
  349. #define JH_CTHL_NL_bTDMotor_N M0045 //穿链电机反转
  350. //
  351. #define QDCT_TOTAL_ADDR 8
  352. #define QDCT_NOWTOTAL_ADDR 10
  353. #define QDCT_SETTOTAL_ADDR 12
  354. #define QDCT_SPEED_ADDR 14
  355. #define QDCT_ALARM_ADDR 100
  356. #define QDCT_NO_ALARM 0
  357. #define QDCT_EX_ALARM 40
  358. #define JYDC_FILTER user_datas[39]
  359. #endif
  360. #endif