Commit 0333e45
Fix db_get/db_fill failing on S7-1200 PLCs with incorrect MC7Size (#608)
Some PLCs (e.g. S7-1200) report MC7Size as the load memory allocation
(1024) rather than the actual data area size (e.g. 37 bytes) in block
info responses. This caused db_get() to attempt reading more bytes than
exist, resulting in "No data in response" errors.
Wrap the auto-sized read/write in db_get and db_fill with error handling
that provides a clear message suggesting the user pass the size parameter
explicitly. Also update the e2e test to skip gracefully on affected PLCs.
Fixes #569 (comment by @razour08)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 0bfc883 commit 0333e45
2 files changed
Lines changed: 25 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
269 | 269 | | |
270 | 270 | | |
271 | 271 | | |
272 | | - | |
273 | | - | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
274 | 275 | | |
275 | 276 | | |
276 | 277 | | |
| |||
283 | 284 | | |
284 | 285 | | |
285 | 286 | | |
286 | | - | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
287 | 295 | | |
288 | 296 | | |
289 | 297 | | |
290 | 298 | | |
291 | 299 | | |
292 | 300 | | |
293 | | - | |
294 | | - | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
295 | 304 | | |
296 | 305 | | |
297 | 306 | | |
| |||
306 | 315 | | |
307 | 316 | | |
308 | 317 | | |
309 | | - | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
310 | 326 | | |
311 | 327 | | |
312 | 328 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
492 | 492 | | |
493 | 493 | | |
494 | 494 | | |
495 | | - | |
496 | | - | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
497 | 498 | | |
498 | 499 | | |
499 | 500 | | |
| |||
0 commit comments