JCWYHuaXianJi.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. #ifndef __JCWYHUA_XIAN_JI_H__
  2. #define __JCWYHUA_XIAN_JI_H__
  3. #if JIA_CHENG_WEI_YE_MACHINE
  4. extern void HuaXian_Action(void);
  5. extern void HuaXian_InitAction(void);
  6. #define HX_DIR_P 1
  7. #define HX_DIR_N 0
  8. #define HX_TOTAL_ADDR 76
  9. #define HX_ALARM_ADDR 100
  10. #define HX_PROSPEED_ADDR 78
  11. /*
  12. * 警告类型 警告编号
  13. */
  14. #define HX_NO_ALARM 0 /* 没警告*/
  15. #define HX_NO_ZIPPER_ALARM 1 /* 没拉链,自动停机*/
  16. #define HX_KA_DAI_ALARM 2 /* 卡带异常*/
  17. #define HX_DW_UP_ALARM 3 /* 上模上限位*/
  18. #define HX_DW_DOWN_ALARM 4 /* 上模下限位*/
  19. #define HX_HX_LIMIT 5 /* 下模上限位*/
  20. #define HX_HX_ORIGIN 6 /* 下模下限位*/
  21. #define HX_TOTAL_ALARM 7
  22. #define HX_GZ_ALARM 8
  23. #define HX_GZ_OUT_ALARM 9
  24. #define VAVLE_ALARM_TIME 3000
  25. #define MOTOR_ALARM_TIME 5000
  26. #define HX_PARAM_ZIPPER_LENGTH (user_datas[1] | (user_datas[2] >> 16))
  27. #define HX_PARAM_SET_TOTAL (user_datas[74] | (user_datas[75] >> 16))
  28. #define HX_PARAM_HIGH_SPEED user_datas[3]
  29. #define HX_PARAM_LOW_SPEED user_datas[4]
  30. #define HX_PARAM_CYCLE_PULSE user_datas[5]
  31. #define HX_PARAM_CYCLE_LENGTH user_datas[6]
  32. #define HX_PARAM_DELAY_STOP_LENGTH user_datas[7]
  33. #define HX_PARAM_DELAY_DELAY_START (user_datas[8]*10)
  34. #define HX_PARAM_DELAY_GZ (user_datas[9]*10)
  35. #define HX_PARAM_SL_LENGTH (user_datas[10]*10)
  36. #define HX_PARAM_DELAY_DOWN (user_datas[11]*10)
  37. #define HX_PARAM_DELAY_HX (user_datas[12]*10)
  38. #define HX_PARAM_DELAY_DOWNBACK (user_datas[13]*10)
  39. #define HX_PARAM_DELAY_HXBACK (user_datas[14]*10)
  40. #define HX_PARAM_MOTOR_ALARM_TIME (user_datas[15]*10)
  41. #define HX_PARAM_HX_TIMES user_datas[16]
  42. #define HX_AutoDelay cDelayTime1
  43. #define HX_MotorDelay cDelayTime2
  44. #define HX_AlarmDelay cDelayTime3
  45. #define HX_HXDelay cDelayTime4
  46. #define HX_AutoStep cStepMByte
  47. #define HX_MotorStep cStepMByte1
  48. #define HX_HuaXianStep cStepMByte2
  49. #define START_IN X00
  50. #define START_IN_UP (X00 && !OLDX00)
  51. #define STOP_IN X01
  52. #define STOP_IN_UP (X01 && !OLDX01)
  53. #define HX_GUO_LIAN_IN X03
  54. #define HX_GUO_LIAN_IN_UP (X03 && !OLDX03)
  55. #define HX_GUO_LIAN_IN_DW (!X03 && OLDX03)
  56. #define HX_GOUZHEN_IN X04
  57. #define HX_DOWN_UP_IN X05
  58. #define HX_DOWN_DOWN_IN X06
  59. #define HX_HX_LIMIT_IN X07
  60. #define HX_HX_ORIGIN_IN X10
  61. #define HX_DOWN_VAVLE Y02
  62. #define HX_HX_VAVLE Y03
  63. #define HX_GZ_VAVLE Y04
  64. #define HX_SZ_OUT Y07
  65. //M0~M4全局固定使用
  66. /*
  67. #define bRunning M0000
  68. #define bStart M0001
  69. #define bStop M0002
  70. #define bAlarmStop M0003
  71. #define bClearTotal M0004
  72. */
  73. #define HX_bDown M0006
  74. #define HX_bHX M0007
  75. #define HX_bClearTotal M0008
  76. #define HX_bGZ M0009
  77. #define HX_bSingle M0010
  78. #define HX_bHXRun M0011
  79. #define HX_bGoMotor M0013
  80. #define HX_bBackMotor M0014
  81. #endif
  82. #endif