Compile to IEC 61131-10 XML - Omron - #1896
Draft
DoubleCouponDay wants to merge 22 commits into
Draft
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.88% -1.80%
==========================================
Files 188 197 +9
Lines 58726 78862 +20136
==========================================
+ Hits 55603 73252 +17649
- Misses 3123 5610 +2487 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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 complying with the specific subset of Structured Text compatible with Sysmac Studio. All that is required is to add the
--xml-omronargument to a compilation command. the newplc_xmlgenmodule should be portable enough to handle other specific subsets in the future, such as 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 be implemented. 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 TOWSTRINGUnit tests have been added to confirm the feature.
Here is a concise list of changes made in this PR:
New XML export target
Type rendering for Sysmac
New diagnostic
plc_xmlgenscans user types, globals, POU variable blocks and struct members, skipping external linkage and compiler-generated declarations.VAR_EXTERNAL behaviour
Supporting changes