TYHeLian.h 5.7 KB

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