Skip to content

Commit be4b36c

Browse files
authored
Modbus: clarify writecoil (#1017)
1 parent 316aa20 commit be4b36c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

docs/reference/modbus.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ Die Definition eines Registers benötigt folgende Parameter:
197197

198198
- `address`: die Registeradresse
199199
- `type`: Der Registertyp, zulässig sind `coil`, `input`, `holding`
200-
- `decode`: Die Art der Codierung der Daten. Zulässig sind: `int16|32|64, uint16|32|64, float32|64 and u|int32s + float32s`. Beim Typ `coil` wird die Codierung ignoriert, muss aber trotzdem angegeben werden.
200+
- `decode`: Die Art der Codierung der Daten. Zulässig sind: `int16|32|64, uint16|32|64, float32|64 and u|int32s + float32s`. Beim Typ `coil` wird die Codierung ignoriert, muss aber trotzdem angegeben werden. Beim Typ `writecoil` muss `bool8` angegeben werden.
201201
- `bitmask`: Eine optionale Angabe. Der angegebene Wert wird mit dem gelesenen UND verknüpft, um so einzelne Bits extrahieren zu können.
202202

203203
Weitere zulässige Parameter einer manuellen Konfiguration sind:
@@ -225,7 +225,7 @@ Bei den `int32s/uint32s` Dekodierungen wird die Wortreihenfolge vertauscht und s
225225

226226
Es können sowohl Holding-Register als auch Coils beschrieben werden. Dazu muss entweder `type: writeholding` für Holding-Register oder `type: writecoil` für Coils angegeben werden.
227227
`type: writeholding` schreibt immer ein 16Bit Register (int oder bool16). Für `decode` muss hier daher immer `uint16` angegeben werden.
228-
`type: writecoil` schreibt ein Coil. Angaben für `decode` werden ignoriert.
228+
`type: writecoil` schreibt ein Coil. Für `decode` muss `bool8` angegeben werden.
229229

230230
**Beispiel**:
231231

@@ -275,7 +275,7 @@ chargers:
275275
register:
276276
address: 400
277277
type: writecoil # Write a coil
278-
decode: uint8 # Doesn't matter but required
278+
decode: bool8
279279
maxcurrent:
280280
# Set the maximum current
281281
source: modbus

i18n/en/docusaurus-plugin-content-docs/current/reference/modbus.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ The definition of a register requires the following parameters:
193193

194194
- `address`: the register address
195195
- `type`: The register type, allowed are `coil`, `input`, `holding`
196-
- `decode`: The type of encoding of the data. Allowed are: `int16|32|64, uint16|32|64, float32|64 and u|int32s + float32s`. For type `coil` the encoding is ignored, but must still be specified.
196+
- `decode`: The type of encoding of the data. Allowed are: `int16|32|64, uint16|32|64, float32|64 and u|int32s + float32s`. For type `coil` the encoding is ignored, but must still be specified. For type `writecoil`, `bool8` must be specified.
197197
- `bitmask`: An optional specification. The specified value is ANDed with the read value to extract individual bits.
198198

199199
Other allowed parameters of a manual configuration are:
@@ -221,7 +221,7 @@ For the `int32s/uint32s` decodings, the byte order is swapped, which is useful f
221221

222222
Both holding registers and coils can be written. For this, either `type: writeholding` for holding registers or `type: writecoil` for coils must be specified.
223223
`type: writeholding` always writes a 16-bit register (int or bool16). Therefore, for `decode`, `uint16` must always be specified.
224-
`type: writecoil` writes a coil. Specifications for `decode` are ignored.
224+
`type: writecoil` writes a coil. For `decode`, `bool8` must be specified.
225225

226226
**For example**:
227227

@@ -271,7 +271,7 @@ chargers:
271271
register:
272272
address: 400
273273
type: writecoil # Write a coil
274-
decode: uint8 # Doesn't matter but required
274+
decode: bool8
275275
maxcurrent:
276276
# Set the maximum current
277277
source: modbus

0 commit comments

Comments
 (0)