Skip to content

Align error parser status codes with MT-SICS spec#970

Merged
BioCam merged 3 commits intoPyLabRobot:mainfrom
BioCam:update/scale-error-parser-status-codes
Mar 27, 2026
Merged

Align error parser status codes with MT-SICS spec#970
BioCam merged 3 commits intoPyLabRobot:mainfrom
BioCam:update/scale-error-parser-status-codes

Conversation

@BioCam
Copy link
Copy Markdown
Collaborator

@BioCam BioCam commented Mar 26, 2026

Summary

  • _parse_basic_errors checked for status 'P' (not in MT-SICS spec) instead of 'L' (logical error, e.g. parameter not allowed)
  • 'L' responses from the scale were silently ignored, meaning bad-parameter commands appeared to succeed
  • Corrected docstring to match MT-SICS spec (p.10, sec 2.1.3.1): documents A, B, I, L, +, -
  • Added TODO for B (multi-response) status handling

Verification

Hardware-tested on a WXS205SDU:

M21 99 99 -> b'M21 L\r\n'   (scale sends L, not P)
SI        -> b'S S    0.00006 g\r\n'  (normal read OK)
XYZNOTREAL -> b'ES\r\n'     (syntax error OK)
ZC 5000   -> b'ES\r\n'      (confirms ZC takes no params)

Test plan

  • Simulated ['S', 'L'] response now correctly raises MettlerToledoError
  • Simulated ['S', 'P'] no longer falsely caught
  • Hardware-verified: real WXS205SDU returns L for invalid parameters
  • All other status codes (I, +, -, ES, ET, EL) unchanged and working

🤖 Generated with Claude Code

BioCam and others added 3 commits March 26, 2026 18:14
The _parse_basic_errors docstring and code used 'P' for logical errors,
but the MT-SICS spec (p.10, sec 2.1.3.1) defines 'L'. Hardware-verified
on a WXS205SDU: M21 99 99 returns 'M21 L', confirming the spec.

Also documents A/B status codes and adds a TODO for multi-response
command handling (B status).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@BioCam BioCam requested a review from rickwierenga March 26, 2026 23:59
@BioCam BioCam merged commit fff31e9 into PyLabRobot:main Mar 27, 2026
21 checks passed
@BioCam BioCam deleted the update/scale-error-parser-status-codes branch March 27, 2026 00:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants