Repository navigation
Decode Rockwell FBD sheets into statements - #6
Merged
Merged
Conversation
Follow each sheet's wires to write one statement per output: an output reference as the boolean expression wired into it, and every block, function, AOI or JSR as a call with its wired pins. Boolean blocks and comparisons fold into the expressions that read them, connectors carry signals by name, feedback loops are cut, and layout (positions, sizes) is ignored.
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.
What
FBD routines in an
.L5Xwere listed as one line per drawn element, with X/Y positions. That meant moving a block made a diff, and a rewired input was hard to spot. Now each sheet is decoded from its wires into one statement per output:ORef) is written as the expression wired into it.BAND/BOR/BXOR/BNOT, and theAND/OR/NOT/XORfunction names) and comparisons (EQU,GRT, ...) fold into the expressions that read them.JSRis a call with its wired input pins and the output references it writes (DN => JamAlarm).OCon/ICon) carry a signal across the sheet by name. A feedback loop is cut at the block's own output member (BOR_01.Out).Verified
uv run pytest: 68 passed (4 new intests/test_fbd.py, covering decoding, a moved layout giving no diff, a changed operand and a feedback loop)ruff check,ruff format --check,mypy: cleanGenerated by Claude Code