defines.py 703 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/usr/bin/env python
  2. # -*- encoding: utf-8 -*-
  3. # modbus exception codes
  4. ILLEGAL_FUNCTION = 1
  5. ILLEGAL_DATA_ADDRESS = 2
  6. ILLEGAL_DATA_VALUE = 3
  7. SLAVE_DEVICE_FAILURE = 4
  8. COMMAND_ACKNOWLEDGE = 5
  9. SLAVE_DEVICE_BUSY = 6
  10. MEMORY_PARITY_ERROR = 8
  11. # supported modbus functions
  12. RAW = 0
  13. READ_COILS = 1
  14. READ_DISCRETE_INPUTS = 2
  15. READ_HOLDING_REGISTERS = 3
  16. READ_INPUT_REGISTERS = 4
  17. WRITE_SINGLE_COIL = 5
  18. WRITE_SINGLE_REGISTER = 6
  19. READ_EXCEPTION_STATUS = 7
  20. DIAGNOSTIC = 8
  21. REPORT_SLAVE_ID = 17
  22. WRITE_MULTIPLE_COILS = 15
  23. WRITE_MULTIPLE_REGISTERS = 16
  24. READ_FILE_RECORD = 20
  25. READ_WRITE_MULTIPLE_REGISTERS = 23
  26. DEVICE_INFO = 43
  27. # supported block types
  28. COILS = 1
  29. DISCRETE_INPUTS = 2
  30. HOLDING_REGISTERS = 3
  31. ANALOG_INPUTS = 4