fix(variables): accept %MX memory-bit locations for BOOL (v4.2.10)#961
Conversation
BOOL_LOCATION_REGEX only allowed %QX/%IX, so valid IEC memory bits (%MX0.0 — e.g. Modbus coils) were rejected as "Location is invalid", while the word-width regexes already accepted the memory (M) area. Add M so every valid IEC area prefix (I/Q/M) is accepted for BOOL, matching WORD/DWORD/LWORD, and update the BOOL hint to list %MX. Reported: forum "%MX locations now invalid - Runtime v4". Verified in openplc-web: %MX0.0 now accepted on a BOOL; %MZ0.0 still rejected. Also bump APP_VERSION + package.json to 4.2.10 for the patch release. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
WalkthroughBOOL variable validation now accepts ChangesBOOL memory validation
Application version
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Problem
Forum report "%MX locations now invalid - Runtime v4":
BOOLvariables mapped to%MXmemory bits (e.g. Modbus coils) are rejected as "Location is invalid. Valid locations: %QX0.0..7, %IX0.0..7" —%MXis a legitimate IEC 61131-3 memory bit and is explicitly exposed by the Modbus TCP server as coils.Root cause
BOOL_LOCATION_REGEX = /^%[QI]X\d+\.\d$/omitted the memory area (M), whileWORD/DWORD/LWORDregexes already accept%[QIM]. So%MXwas the only valid IEC area silently rejected (for BOOL).Fix
BOOL_LOCATION_REGEX→/^%[QIM]X\d+\.\d$/— accepts every valid IEC area prefix (I/Q/M), consistent with the word-width regexes.%MX0.0..7.%QX/%IX/%MX.APP_VERSION+package.jsonto 4.2.10 (patch release).Verification
%MXcases).dev:local):%MX0.0now accepted on a BOOL; an invalid%MZ0.0is still rejected — validation intact.Shared surfaces are byte-identical with the openplc-web PR.
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
%MXmemory addresses alongside input and output addresses.%MXbit locations, including addresses such as%MX0.0and%MX3.7.Bug Fixes
Chores