Commit 331e6a4
Fix BoolRegister.ReadAsync reading the DT area instead of X/Y/R
ReadAreaByteRangeAsync takes an areaPrefix parameter that defaults to
RegisterPrefix.DT. BoolRegister.ReadAsync did not pass it, so a direct
read of a bit register resolved against the data area rather than the
bit area: reading R183 actually read DT18 and returned bit 3 of that
word. Reads silently returned wrong values rather than failing, and on
a PLC whose low DT registers happen to be zero every bit register reads
as false.
The address itself was resolved correctly (GetMewName/MemoryAddress),
and the write path (WriteSingleBitAsync) was already correct, so only
reads were affected. AreaBase already passes registerType through, so
the polled path was unaffected too - this only hit direct ReadAsync.
Verified against an FP-series PLC over MEWTOCOL by comparing against
raw RCC word reads (WR18 = 0x82A8, WX0 = 0x000D): 12 of 12 bit
registers across the R and X areas now match, where previously all 12
returned false.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent 1e27436 commit 331e6a4
1 file changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
120 | 122 | | |
121 | 123 | | |
122 | 124 | | |
| |||
0 commit comments