fix(driver-modbus-addressing): resolve Low code-review findings (Driver.Modbus.Addressing-006,007,009)
- Driver.Modbus.Addressing-006: broaden the catch in TryParseFamilyNative so a future helper throwing a non-Argument/Overflow type still satisfies the try-parse contract. - Driver.Modbus.Addressing-007: document that the address grammar does not carry ModbusStringByteOrder (the structured-tag path does); add a 'Grammar scope' bullet to docs/v2/dl205.md. - Driver.Modbus.Addressing-009: reword the ModbusModiconAddress comments so they don't imply a leading-digit invariant the parser doesn't enforce. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -43,6 +43,15 @@ that a naive Modbus client will byte-swap [1][2].
|
||||
really "read 10 consecutive holding registers starting at the Modbus address
|
||||
that V2000 translates to (see next section), unpack each register low-byte
|
||||
then high-byte, stop at the first `0x00`."
|
||||
- **Grammar scope** (Driver.Modbus.Addressing-007): the
|
||||
`ModbusStringByteOrder` knob (HighByteFirst / LowByteFirst) is **not**
|
||||
expressible through the `ModbusAddressParser` grammar string — the 3rd grammar
|
||||
field is the multi-register word/byte order (ABCD/CDAB/BADC/DCBA) and the 4th
|
||||
is the array count, so there is no token slot for the per-string byte order.
|
||||
Tags that need low-byte-first packing on DL205 must set
|
||||
`ModbusTagDefinition.StringByteOrder = LowByteFirst` via the structured tag
|
||||
form (the driver config DTO). The grammar default produces high-byte-first
|
||||
strings (matches Ignition / Kepware default behaviour).
|
||||
|
||||
Test names:
|
||||
`DL205_String_low_byte_first_within_register`,
|
||||
|
||||
Reference in New Issue
Block a user