Compile to IEC 61131-10 XML - Omron - #1896
Open
DoubleCouponDay wants to merge 35 commits into
Open
Conversation
DoubleCouponDay
marked this pull request as draft
August 28, 2026 04:37
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #1896 +/- ##
==========================================
- Coverage 94.68% 92.90% -1.78%
==========================================
Files 188 197 +9
Lines 58726 78883 +20157
==========================================
+ Hits 55603 73285 +17682
- Misses 3123 5598 +2475 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Use --generate-external-constructors if you need that.
Author
DoubleCouponDay
marked this pull request as ready for review
September 4, 2026 08:38
Author
|
The 'PR Artifacts' stage of the pipeline is failing with "HttpError: Resource not accessible by integration". How can that be fixed? Also, the |
Member
|
Hi, thanks for the contribution! Just as a heads-up, we have quite a lot going on at the moment so it may take us a little while to find the time to review this. |
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.
Based on my discussion post here, I've implemented XML generation as a first class compilation target. For now, the implementation focuses on a subset of Structured Text that is compatible with Sysmac Studio. All that is required is to add the
--xml-omronargument. the newplc_xmlgenmodule is portable enough to handle other specific subsets in the future (eg: CODESYS).Here is an example of usage:
For this to work, the builtins of a specific PLC device are compiled into a separate library which can be linked to. As a result,
VAR_EXTERNALandVAR_EXTERNAL CONSTANThad to fixed. Without external references to a stub library, none of the references to built in constants, types, and global functions could compile.To be clear, Sysmac does not support the following ST syntax:
POINTER TOREFERENCE TOWSTRINGCLASSINTERFACEALIAS TOUnit tests have been added to confirm the feature.
Here is a concise list of changes made in this PR:
New XML export target
--xml-omronCLI flag and a GenerationParameters struct threaded into codegen..xmloutput naming in plc_project and the codegen participant.Type rendering for Sysmac
StructTypeSpecandEnumTypeWithNamedValueSpecdeclarations; The two Sysmac actually accepts.ARRAY[0..3] OF X, multi-dimensional asARRAY[0..1,1..3] OF Xwith no space after the separator.VAR_EXTERNAL behaviour
VAR_EXTERNALblocks, so variables from a linked library are no longer initialised a second time.New diagnostic
plc_xmlgenscans user types, globals, POU variable blocks and struct members, skipping external linkage and compiler-generated declarations.Supporting changes