YXDaKong.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. #ifndef __XDDAKONG_H__
  2. #define __XDDAKONG_H__
  3. #if FJ_YING_XING_MACHINE
  4. extern void DK_InitAction(void);
  5. extern void DK_ManualAction(void);
  6. extern void DK_Action(void);
  7. #define DK_ALARM_ADDR 100
  8. #define DK_TOTAL_ADDR 76
  9. #define DK_ALLTOTAL_ADDR 79
  10. #define DK_PROSPEED_ADDR 78
  11. #define DK_VAVLE_ALARM_TIME 3000
  12. #define DK_DIR_N 1
  13. #define DK_DIR_P 0
  14. //故障代码列表
  15. #define DK_NO_ALARM 0
  16. #define DK_TOTAL_ALARM 1
  17. #define DK_GZ_ORIGIN_ALARM 2
  18. #define DK_XIACHONG_ARRIVE_ALARM 3
  19. #define DK_XM_LIMIT_ALARM 4
  20. #define DK_SM_LIMIT_ALARM 5
  21. #define DK_GUOLIAN_ALARM 6
  22. #define DK_GZ_ALARM 7
  23. #define DK_START_GZ_ALARM 8
  24. #define DK_START_YD_ALARM 9
  25. #define DK_START_SM_ALARM 10
  26. #define DK_START_XM_ALARM 11
  27. #define DK_XiaChongStep cStepMByte3
  28. #define DK_ManualStep cStepMByte2
  29. #define DK_MotorStep cStepMByte1
  30. #define DK_AutoStep cStepMByte
  31. #define DK_XiaChongDelay cDelayTime1
  32. #define DK_AutoDelay cDelayTime2
  33. #define DK_CQ_Delay cDelayTime4
  34. #define DK_MotorDelay cDelayTime5
  35. #define DK_PARAM_SET_TOTAL (user_datas[2] | user_datas[3] << 16)
  36. #define DK_PARAM_ZIPRER_LENGTH (user_datas[4] | user_datas[5] << 16)
  37. #define DK_PARAM_XC_DELAY (user_datas[6] * 10)
  38. #define DK_PARAM_XC_ALARM_TIME (user_datas[8] * 10)
  39. #define DK_PARAM_XC_DELAY_STOP_TIME (user_datas[9] * 10)
  40. #define DK_PARAM_HIGH_SPEED user_datas[10]
  41. #define DK_PARAM_CYCLE_DELAY (user_datas[11] * 10)
  42. #define DK_PARAM_CYCLE_PULSE user_datas[12]
  43. #define DK_PARAM_CYCLE_LENGTH user_datas[13]
  44. #define DK_PARAM_BM_LINE user_datas[14]
  45. #define DK_PARAM_CQ_TIME (user_datas[15]*10)
  46. #define DK_PARAM_LOWSPEED_LENGTH user_datas[16]
  47. #define DK_PARAM_BACK_LENGTH user_datas[17]
  48. #define DK_PARAM_LOW_SPEED user_datas[18]
  49. #define DK_PARAM_XM_DELAY (user_datas[19] * 10)
  50. #define DK_PARAM_CS_ENABLE user_datas[20]
  51. #define DK_PARAM_GZ_DELAY (user_datas[21] * 10)
  52. #define DK_PARAM_DELAY_STOP_MOTOR user_datas[22]
  53. #define DK_PARAM_YD_DELAY (user_datas[23] * 10)
  54. #define DK_PARAM_SM_DELAY_BACK (user_datas[24] * 10)
  55. #define DK_PARAM_NO_ZIPPER_TIME (user_datas[25] * 10)
  56. #define DK_PARAM_GZ_DELAY_BACK (user_datas[26] * 10)
  57. #define DK_PARAM_SM_DELAY (user_datas[27] * 10)
  58. #define DK_PARAM_CS_DELAY (user_datas[28] * 10)
  59. #define DK_PARAM_CS_TIME (user_datas[29] * 10)
  60. #define DK_PARAM_CS_COLD_TIME (user_datas[30] * 10)
  61. #define DK_PARAM_XM_ENABLE user_datas[31]
  62. #define DK_PARAM_RUN_STATE user_datas[250]
  63. #define DK_PROSPEED user_datas[78]
  64. #define DISPLAY_DATA0 user_datas[121]
  65. #define DISPLAY_DATA1 user_datas[122]
  66. #define DISPLAY_DATA2 user_datas[123]
  67. #define DISPLAY_DATA3 user_datas[124]
  68. #define DISPLAY_DATA4 user_datas[125]
  69. #define DISPLAY_DATA5 user_datas[126]
  70. #define DISPLAY_DATA6 user_datas[127]
  71. #define DISPLAY_DATA7 user_datas[128]
  72. #define START_IN X00
  73. #define START_IN_UP (X00 && !OLDX00)
  74. #define STOP_IN X01
  75. #define STOP_IN_UP (X01 && !OLDX01)
  76. #define DK_GZSwitch_IN X02
  77. #define DK_GZSwitch_IN_UP (X02 && !OLDX02)
  78. #define DK_GZSwitch_IN_DW (!X02 && OLDX02)
  79. #define DK_YDSwitch_IN X03
  80. #define DK_YDSwitch_IN_UP (X03 && !OLDX03)
  81. #define DK_YDSwitch_IN_DW (!X03 && OLDX03)
  82. #define DK_RJSwitch_IN X04
  83. #define DK_RJSwitch_IN_UP (X04 && !OLDX04)
  84. #define DK_ManAuto_IN X05
  85. #define DK_ManAuto_IN_UP (X05 && !OLDX05)
  86. #define DK_GZ_ORIGIN_IN X06
  87. #define DK_GuoLian_IN X07
  88. #define DK_GuoLian_IN_UP (X07 && !OLDX07)
  89. #define DK_GZ_IN X10
  90. #define DK_SM_LIMIT_IN X11
  91. #define DK_CSSwitch_IN X12
  92. #define DK_CSSwitch_IN_UP (X12 && !OLDX12)
  93. #define DK_XM_LIMIT_IN X13
  94. #define DK_GZ_VAVLE Y01
  95. #define DK_CQ_VAVLE Y02
  96. #define DK_SM_VAVLE Y03
  97. #define DK_XM_VAVLE Y04
  98. #define DK_SZ_OUT Y05
  99. #define DK_CS_OUT Y15
  100. //M0~M4 Actioon.h全局使用
  101. #define DK_bMotor M0005
  102. #define DK_bBackMotor M0006
  103. #define DK_bSM M0007
  104. #define DK_bManXiaChong M0008
  105. #define DK_bStart M0009
  106. #define DK_bGZ M0010
  107. #define DK_bCQ M0011
  108. #define DK_bRJ M0012
  109. #define DK_bSingle M0020
  110. #define DK_bXM M0015
  111. #define DK_bRunning M0017
  112. #define DK_bStop M0018
  113. #define DK_bAlarmStop M0019
  114. #endif
  115. #endif