user_mb_app.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #ifndef USER_APP
  2. #define USER_APP
  3. /* ----------------------- Modbus includes ----------------------------------*/
  4. #include "mb.h"
  5. #include "mb_m.h"
  6. #include "mbconfig.h"
  7. #include "mbframe.h"
  8. #include "mbutils.h"
  9. /* -----------------------Slave Defines -------------------------------------*/
  10. #define S_DISCRETE_INPUT_START 0
  11. #define S_DISCRETE_INPUT_NDISCRETES 16
  12. #define S_COIL_START 0
  13. #define S_COIL_NCOILS 64
  14. #define S_REG_INPUT_START 0
  15. #define S_REG_INPUT_NREGS 100
  16. #define S_REG_HOLDING_START 0
  17. #define S_REG_HOLDING_NREGS 100
  18. /* salve mode: holding register's all address */
  19. #define S_HD_RESERVE 0
  20. /* salve mode: input register's all address */
  21. #define S_IN_RESERVE 0
  22. /* salve mode: coil's all address */
  23. #define S_CO_RESERVE 0
  24. /* salve mode: discrete's all address */
  25. #define S_DI_RESERVE 0
  26. /* -----------------------Master Defines -------------------------------------*/
  27. #define M_DISCRETE_INPUT_START 0
  28. #define M_DISCRETE_INPUT_NDISCRETES 16
  29. #define M_COIL_START 0
  30. #define M_COIL_NCOILS 64
  31. #define M_REG_INPUT_START 0
  32. #define M_REG_INPUT_NREGS 100
  33. #define M_REG_HOLDING_START 0
  34. #define M_REG_HOLDING_NREGS 100
  35. /* master mode: holding register's all address */
  36. #define M_HD_RESERVE 0
  37. /* master mode: input register's all address */
  38. #define M_IN_RESERVE 0
  39. /* master mode: coil's all address */
  40. #define M_CO_RESERVE 0
  41. /* master mode: discrete's all address */
  42. #define M_DI_RESERVE 0
  43. #endif