12345678910111213141516171819202122232425262728293031323334 |
- #!/usr/bin/env python
- # -*- encoding: utf-8 -*-
- # modbus exception codes
- ILLEGAL_FUNCTION = 1
- ILLEGAL_DATA_ADDRESS = 2
- ILLEGAL_DATA_VALUE = 3
- SLAVE_DEVICE_FAILURE = 4
- COMMAND_ACKNOWLEDGE = 5
- SLAVE_DEVICE_BUSY = 6
- MEMORY_PARITY_ERROR = 8
- # supported modbus functions
- RAW = 0
- READ_COILS = 1
- READ_DISCRETE_INPUTS = 2
- READ_HOLDING_REGISTERS = 3
- READ_INPUT_REGISTERS = 4
- WRITE_SINGLE_COIL = 5
- WRITE_SINGLE_REGISTER = 6
- READ_EXCEPTION_STATUS = 7
- DIAGNOSTIC = 8
- REPORT_SLAVE_ID = 17
- WRITE_MULTIPLE_COILS = 15
- WRITE_MULTIPLE_REGISTERS = 16
- READ_FILE_RECORD = 20
- READ_WRITE_MULTIPLE_REGISTERS = 23
- DEVICE_INFO = 43
- # supported block types
- COILS = 1
- DISCRETE_INPUTS = 2
- HOLDING_REGISTERS = 3
- ANALOG_INPUTS = 4
|