Module_CabinetParallel.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * Module_CabinetParallel.h
  3. *
  4. * Created on: 2021年9月28日
  5. * Author: 7978
  6. */
  7. #ifndef MODULE_CABINETPARALLEL_H_
  8. #define MODULE_CABINETPARALLEL_H_
  9. #define MASTER_SLAVE_CABINET_TIMEOUT 10
  10. #define SLAVE_RECONNECT_TIME 5 // unit: 1s
  11. #define MASTER_TCP_LISTEN_PORT 63000
  12. #define DISCONNECT_PROMPT 300 // unit: 1s
  13. #define MAX_DATA_BUFFER_LEN 4096
  14. #define MAX_PACKET_BUFFER_LEN 10
  15. #define PARALLEL_CABINET_REG_QUANTITY 9
  16. #define REG_RSEND_TIME_NONE 0 // unit: 1ms
  17. #define REG_RSEND_TIME_MODELNAME 3000 // unit: 1ms
  18. #define REG_RSEND_TIME_ID 3000 // unit: 1ms
  19. #define REG_RSEND_TIME_REG03 0 // unit: 1ms
  20. #define REG_RSEND_TIME_STATUS 1000 // unit: 1ms
  21. #define REG_RSEND_TIME_OUTPUT_RELAY 500 // unit: 1ms
  22. #define REG_RSEND_TIME_AC_CONTACTOR 500 // unit: 1ms
  23. #define REG_RSEND_TIME_UPDATE 10000 // unit: 1ms
  24. #define REG_RSEND_TIME_PARALLEL_RELAY 5000 // unit: 1ms
  25. #define REG_REQ_LEN_NONE 0
  26. #define REG_REQ_LEN_MODELNAME 0
  27. #define REG_REQ_LEN_ID 1
  28. #define REG_REQ_LEN_REG03 0
  29. #define REG_REQ_LEN_STATUS 0
  30. #define REG_REQ_LEN_OUTPUT_RELAY 5
  31. #define REG_REQ_LEN_AC_CONTACTOR 2
  32. #define REG_REQ_LEN_UPDATE 2
  33. #define REG_REQ_LEN_PARALLEL_RELAY 5
  34. #define REG_RES_LEN_NONE 0
  35. #define REG_RES_LEN_MODELNAME 2
  36. #define REG_RES_LEN_ID 3
  37. #define REG_RES_LEN_REG03 0
  38. #define REG_RES_LEN_STATUS 2
  39. #define REG_RES_LEN_OUTPUT_RELAY 6
  40. #define REG_RES_LEN_AC_CONTACTOR 3
  41. #define REG_RES_LEN_UPDATE 3
  42. #define REG_RES_LEN_PARALLEL_RELAY 6
  43. enum PARALLEL_CABINET_PAYLOAD_REGISTER
  44. {
  45. _Reg_SCabinet_None = 0x00,
  46. _Reg_SCabinet_Model_Name = 0x01,
  47. _Reg_SCabinet_ID = 0x02,
  48. _Reg_SCabinet_Reg03 = 0x03,
  49. _Reg_SCabinet_Status = 0x04,
  50. _Reg_OutputRelay_Status = 0x05,
  51. _Reg_AcContactor_Status = 0x06,
  52. _Reg_SCabinet_FwUpdate = 0x07,
  53. _Reg_ParallelRelay_Status = 0x08,
  54. };
  55. enum RELAY_STATUS
  56. {
  57. Relay_OFF = 0x00,
  58. Relay_ON = 0x01,
  59. };
  60. enum UPDATE_STATUS
  61. {
  62. Not_Update = 0x00,
  63. Updating = 0x01,
  64. Updated = 0x02,
  65. };
  66. #endif /* MODULE_CABINETPARALLEL_H_ */