Repository navigation
Import the WAGO PLC configuration from the CODESYS 2.3 export - #2
Merged
Merged
Conversation
- Parser for PLC CONFIGURATION.EXP: one device per I/O module named after its comment, one port per channel, one signal per named channel with its IEC address; default channel comments are dropped - settings.imports.wago points at the export; it is read on every load - Hand-written records with the same ID are laid over imported ones (ports matched by name), so imported signals can be linked to points - Every list can be split over <name>/*.yaml - Device pages list their ports with signals, cables and spare ports; search finds unlinked PLC signals; issues are grouped per source - Demo house uses a small export; README explains the workflow Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017KyUdSpsGYq6NV2mMmxJBv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Mathias · project thread
Before: every PLC module, channel and variable had to be typed into
devices.yamlandsignals.yamlby hand.After: drop the CODESYS
PLC CONFIGURATION.EXPinto the data folder and pointsettings.imports.wago.configat it. Each I/O module then shows up as a device named after its comment (DI 11becomesplc-di11) with its four ports. Each named channel becomes a signal (PLC-SM_0_E2, "Voordeur",%IX6.9). A module's page lists every port with its PLC variable, the point it is linked to, its cables, or "spare". Imported channels that aren't linked to a point yet are grouped under "To check", and search finds them by PLC name or comment.To link an imported signal to a point, or to add notes, write an entry with the same ID. Its fields are laid over the import, and ports are matched by name. The export is read on every load, so a re-export from CODESYS updates HAdoc without editing anything.
How
server/src/importers/wago.ts: a line-based parser for the export format, plus the mapping to HAdoc devices and signals. Default CODESYS channel comments ("Ch_3 Digital input") are dropped and real ones become the signal name.load.ts: runs the configured imports, overlays hand-written records on imported ones, and reads every list from<name>.yamlplus<name>/*.yaml.signals.schema.json:portis no longer required, so an overlay entry can be justid+point.ports. The details panel shows a port table, search covers unlinked signals, and issues are grouped per source.examples/demo-house/imports/.I tested against Mathias's real export, which is not committed: 59 modules, 232 ports and 186 signals, with no errors.
🤖 Generated with Claude Code
https://claude.ai/code/session_017KyUdSpsGYq6NV2mMmxJBv
Generated by Claude Code