Add example: write a 32-bit float value register (#19298)

Co-authored-by: jan iversen <jancasacondor@gmail.com>
Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>
This commit is contained in:
Lieven Hollevoet 2021-09-13 08:08:04 +02:00 committed by GitHub
parent db6d814a85
commit b4fafdea08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -198,6 +198,19 @@ Description:
| value | (write_register) A single value or an array of 16-bit values. Single value will call modbus function code 0x06. Array will call modbus function code 0x10. Values might need reverse ordering. E.g., to set 0x0004 you might need to set `[4,0]`, this depend on the byte order of your CPU | | value | (write_register) A single value or an array of 16-bit values. Single value will call modbus function code 0x06. Array will call modbus function code 0x10. Values might need reverse ordering. E.g., to set 0x0004 you might need to set `[4,0]`, this depend on the byte order of your CPU |
| state | (write_coil) A single boolean or an array of booleans. Single boolean will call modbus function code 0x05. Array will call modbus function code 0x0F | | state | (write_coil) A single boolean or an array of booleans. Single boolean will call modbus function code 0x05. Array will call modbus function code 0x0F |
### Example: writing a float32 type register
To write a float32 datatype register use network format like `10.0` == `0x41200000` (network order float hexadecimal).
```yaml
service: modbus.write_register
data:
address: <target register address>
unit: <target slave address>
hub: <hub name>
value: [0x4120, 0x0000]
```
# configure Modbus platforms # configure Modbus platforms
Modbus platform entities are configured within the Modbus configuration. Modbus platform entities are configured within the Modbus configuration.