GLHeLian - ZG.h 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. #ifndef __GLHELIAN_H__
  2. #define __GLHELIAN_H__
  3. #if CHANG_SHENG_GEI_LI_MACHINE
  4. extern void HL_InitAction(void);
  5. extern void HL_ManualAction(void);
  6. extern void HL_Action(void);
  7. extern void HL_PWMAction(void);
  8. #define HL_MOTOR_DISEN 1
  9. #define HL_MOTOR_EN 0
  10. #define HL_DIR_P 0
  11. #define HL_DIR_N 1
  12. #define HL_ALARM_ADDR 100
  13. #define HL_TOTAL_ADDR 76
  14. #define HL_PROSPEED_ADDR 78
  15. #define HL_VAVLE_ALARM_TIME 3000
  16. //故障代码列表
  17. #define HL_NO_ALARM 0
  18. #define HL_TOTAL_ALARM 1
  19. #define HL_GUOLIAN_ALARM 2
  20. #define HL_SM_LIMIT_ALARM 3
  21. #define HL_XM_LIMIT_ALARM 4
  22. #define HL_BB_LIMIT_ALARM 5
  23. #define HL_DK_LIMIT_ALARM 6
  24. #define HL_DK_ORIGIN_ALARM 7
  25. #define HL_DK_UP_LIMIT_ALARM 8
  26. #define HL_CCX_LIMIT_ALARM 9
  27. #define HL_CCX_ORIGIN_ALARM 10
  28. #define HL_TFK_LIMIT_ALARM 11
  29. #define HL_TFK_ORIGIN_ALARM 12
  30. #define HL_MJ_LIMIT_ALARM 13
  31. #define HL_HM_BACK_ALARM 14
  32. #define HL_MotorStep cStepMByte
  33. #define HL_AutoStep cStepMByte1
  34. #define HL_HLStep cStepMByte2
  35. #define HL_ManDKStep cStepMByte3
  36. #define HL_AutoDelay cDelayTime1
  37. #define HL_MotorDelay cDelayTime2
  38. #define HL_CheckDelay cDelayTime3
  39. #define HL_HLDelay cDelayTime4
  40. #define HL_YCXDelay cDelayTime5
  41. #define HL_ManDKDelay cDelayTime6
  42. #define HL_Y14Delay cDelayTime7
  43. #define HL_Y15Delay cDelayTime8
  44. #define HL_PARAM_SET_TOTAL (user_datas[2] | user_datas[3] << 16)
  45. #define HL_PARAM_MOTOR_ALARM_TIME (user_datas[4] * 10)
  46. #define HL_PARAM_HIGH_SPEED user_datas[5] // 电机高速
  47. #define HL_PARAM_LOW_SPEED user_datas[6] // 空位速度
  48. #define HL_PARAM_DELAY_STOP user_datas[7] // 定位调节
  49. #define HL_PARAM_CYCLE_DELAY (user_datas[8] * 10) // 延时启动
  50. #define HL_PARAM_DELAY_HM (user_datas[9] * 10) // 延时合模
  51. #define HL_PARAM_DELAY_TFK (user_datas[10] * 10) // 延时推方块
  52. #define HL_PARAM_DELAY_JD (user_datas[11] * 10) // 延时夹带
  53. #define HL_PARAM_DELAY_CCX (user_datas[12] * 10) // 延时穿插销
  54. #define HL_PARAM_DELAY_CHECK_CCX (user_datas[13] * 10) // 延时检测穿插销到位
  55. #define HL_PARAM_DELAY_BACK_DK_UP (user_datas[14] * 10) // 延时复位上下挡块
  56. #define HL_PARAM_CCX_LENGTH user_datas[15] // 穿插销到位后拖带走多长
  57. #define HL_PARAM_DELAY_TFK_BACK (user_datas[16] * 10) // 延时复位推方块
  58. #define HL_PARAM_DELAY_DK_GO (user_datas[17] * 10) // 延时挡块前后
  59. //#define HL_PARAM_DELAY_STOP2 user_datas[18]
  60. #define HL_PARAM_DELAY_BB_BACK (user_datas[19] * 10) // 延时复位摆臂
  61. #define HL_PARAM_DELAY_BB (user_datas[20] * 10) // 延时摆臂
  62. #define HL_PARAM_DELAY_HM_BACK user_datas[21] // 延时复位合模
  63. //#define HL_PARAM_OFFSET_LENGTH user_datas[22]
  64. #define HL_PARAM_DELAY_JD_BACK (user_datas[23] * 10) // 夹带延时复位
  65. #define HL_PARAM_DELAY_CHECK_TIME user_datas[24] // 延时检测定位信号
  66. #define HL_PARAM_YCX_TIME (user_datas[25] * 10) // 压插销时间
  67. #define HL_PARAM_DELAY_DK_UP (user_datas[26] * 10) // 延时上挡块
  68. #define HL_PARAM_CCX_TIMES user_datas[27] //夹带穿插销次数0为1次 1为两次
  69. #define HL_PARAM_CCX_MODE user_datas[28] //穿插销模式 1为电机穿 0为夹带气缸穿
  70. #define HL_PARAM_CCX_SPEED user_datas[29]
  71. #define HL_PARAM_DELAY_YD_BACK user_datas[30] // 延时收压带
  72. #define HL_PARAM_DELAY_Y14_BACK user_datas[31] // 延时
  73. #define HL_PARAM_DELAY_CD (user_datas[32] * 10) //延时扯带
  74. #define HL_PARAM_CD_ENABLE user_datas[33]//扯带功能使能 1为带扯带功能
  75. #define HL_PARAM_BB_ENABLE user_datas[34]//0为摆臂晚放开1为摆臂提前放开
  76. #define HL_PARAM_CONNECT_MODE user_datas[35]//1为联机模式
  77. #define HL_PARAM_DELAY_START (user_datas[36] * 10)
  78. #define DISPLAY_DATA0 user_datas[121]
  79. #define DISPLAY_DATA1 user_datas[122]
  80. #define DISPLAY_DATA2 user_datas[123]
  81. #define DISPLAY_DATA3 user_datas[124]
  82. #define DISPLAY_DATA4 user_datas[125]
  83. #define DISPLAY_DATA5 user_datas[126]
  84. #define DISPLAY_DATA6 user_datas[127]
  85. #define DISPLAY_DATA7 user_datas[128]
  86. #define START_IN X00
  87. #define START_IN_UP (X00 && !OLDX00)
  88. #define STOP_IN X01
  89. #define STOP_IN_UP (X01 && !OLDX01)
  90. #define HL_GUO_LIAN_IN X02 //过链感应
  91. #define HL_GUO_LIAN_IN_UP (X02 && !OLDX02)
  92. #define HL_GUO_LIAN_IN_DW (!X02 && OLDX02)
  93. #define HL_SM_LIMIT_IN X04 //上模到位
  94. #define HL_XM_LIMIT_IN X05 //下模到位
  95. #define HL_BB_LIMIT_IN X06 //摆臂到位
  96. #define HL_DK_ORIGIN_IN X07 //挡块前后原位
  97. #define HL_DK_LIMIT_IN X10 //挡块前后到位
  98. #define HL_DK_UP_LIMIT_IN X11 //挡块上下到位
  99. #define HL_CCX_LIMIT_IN X12 //穿插销到位
  100. #define HL_CCX_ORIGIN_IN X13 //穿插销原位
  101. #define HL_TFK_LIMIT_IN X14 //推方块到位
  102. #define HL_TFK_ORIGIN_IN X15 //推方块原位
  103. #define HL_STOP_IN X16 //联网信号上
  104. #define HL_STOP_IN_DW (!X16 && OLDX16) //联网信号上
  105. #define HL_START_IN X17 //联网信号下
  106. #define HL_front_IN X20 //前机工作状态
  107. #define HL_front_IN_DW (!X20 && OLDX20) //
  108. #define HL_HM_VAVLE Y00 //合模
  109. #define HL_TFK_VAVLE Y01 //推方块
  110. #define HL_BB_VAVLE Y02 //摆臂
  111. #define HL_DK_UP_VAVLE Y03 //挡块上下
  112. #define HL_JD_VAVLE Y04 //夹带
  113. #define HL_CCX_VAVLE Y05 //穿插销
  114. #define HL_DK_GO_VAVLE Y06 //挡块前后
  115. #define HL_YD_VAVLE Y07 //压带
  116. #define HL_SJ_VAVLE Y10 //松紧气缸
  117. #define HL_CD_MOTOR Y11 //储带电机
  118. #define HL_ALARM_OUT Y12
  119. #define HL_YCX_VAVLE Y13 //压插销电磁阀
  120. #define HL_CD_VAVLE Y14 //扯带电磁阀
  121. #define HL_OVEROUt_VAVLE Y15 //工作完成输出
  122. //M0~M4 Actioon.h全局使用
  123. #define HL_bHM M0005 //合模
  124. #define HL_bTFK M0006 //推方块
  125. #define HL_bBB M0007 //摆 臂
  126. #define HL_bDK_UP M0008 //上挡块
  127. #define HL_bJD M0009 //夹 带
  128. #define HL_bCCX M0010 //穿插销
  129. #define HL_bDK_GO M0011 //挡块前后
  130. #define HL_bYD M0012 //压 带
  131. #define HL_bSJ M0013 //松 紧
  132. #define HL_bCD M0014
  133. #define HL_bMotor M0015 //拖带电机
  134. #define HL_bStart M0016 //启动
  135. #define HL_bRunning M0017 //运行
  136. #define HL_bStop M0018 //停止
  137. #define HL_bAlarmStop M0019 //
  138. #define HL_bSingStart M0020 //单一自动
  139. #define HL_bAdd M0021 //定位数值加
  140. #define HL_bSetWorkData M0022
  141. #define HL_bDec M0023 //定位数值减
  142. #define HL_bDW M0024 //拖带定位
  143. #define HL_bZCX M0025 //装插销
  144. #define HL_bHL M0026 //合 链
  145. #define HL_bHMYD M0027 //合 模压带
  146. #define HL_bDKUP M0028 //上挡块
  147. #define HL_bYCX M0029 //压插销
  148. #define HL_bYCD M0030 // 扯带
  149. #endif
  150. #endif