defines.py 882 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. """
  4. Modbus TestKit: Implementation of Modbus protocol in python
  5. (C)2009 - Luc Jean - luc.jean@gmail.com
  6. (C)2009 - Apidev - http://www.apidev.fr
  7. This is distributed under GNU LGPL license, see license.txt
  8. """
  9. #modbus exception codes
  10. ILLEGAL_FUNCTION = 1
  11. ILLEGAL_DATA_ADDRESS = 2
  12. ILLEGAL_DATA_VALUE = 3
  13. SLAVE_DEVICE_FAILURE = 4
  14. COMMAND_ACKNOWLEDGE = 5
  15. SLAVE_DEVICE_BUSY = 6
  16. MEMORY_PARITY_ERROR = 8
  17. #supported modbus functions
  18. READ_COILS = 1
  19. READ_DISCRETE_INPUTS = 2
  20. READ_HOLDING_REGISTERS = 3
  21. READ_INPUT_REGISTERS = 4
  22. WRITE_SINGLE_COIL = 5
  23. WRITE_SINGLE_REGISTER = 6
  24. READ_EXCEPTION_STATUS = 7
  25. DIAGNOSTIC = 8
  26. REPORT_SLAVE_ID = 17
  27. WRITE_MULTIPLE_COILS = 15
  28. WRITE_MULTIPLE_REGISTERS = 16
  29. READ_WRITE_MULTIPLE_REGISTERS = 23
  30. DEVICE_INFO = 43
  31. #supported block types
  32. COILS = 1
  33. DISCRETE_INPUTS = 2
  34. HOLDING_REGISTERS = 3
  35. ANALOG_INPUTS = 4