Skip to content

Commit 8852f14

Browse files
add note for callback value to be always signed, see #51
1 parent eacf0bf commit 8852f14

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

docs/USAGE.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,13 @@ The callback function shall have the following three parameters:
217217
| `address` | int | Type of register. `COILS`, `HREGS`, `ISTS`, `IREGS` |
218218
| `val` | Union[bool, int, Tuple[bool], Tuple[int], List[bool], List[int]] | Current value of register |
219219

220+
```{note}
221+
The function parameter `val` is always an unsigned value. The host device
222+
requesting data is interpreting the data as signed or not, the client device
223+
has no informations about it. Setting a holding register to `-4` will be
224+
returned as `65532` on a registered callback.
225+
```
226+
220227
This example functions registered for e.g. coil 123 will output the following
221228
content after the coil has been requested and afterwards set to a different
222229
value

0 commit comments

Comments
 (0)