fix: display global variable values consistently across all programs#597
Conversation
Global (external) variables share a single debug index (CONFIG0__VAR_NAME) across programs. The variableInfoMap was keyed by index with a single entry, so when multiple programs used the same global variable, only the last program processed would display the value. Changed the map to support multiple entries per debug index and write parsed values to all composite keys, ensuring global variables show their state in every program. Resolves: DOPE-162 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
WalkthroughUpdated Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 🧹 Recent nitpick comments
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. 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 |
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
Summary
_FBD) were not displaying their value in other programs (e.g.main) during debugging, even though the PLC runtime processes them correctly.variableInfoMapwasMap<number, VariableInfo>— keyed by debug index with a single entry. Global variables share a single debug index (CONFIG0__VAR_NAME) across programs, so the last program processed would overwrite the previous entry.Map<number, VariableInfo[]>to support multiple entries per debug index. When a value is polled, it is now written to all composite keys for that index, ensuring global variables display their state in every program that uses them.Resolves DOPE-162
Closes #529
Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes