Reverse Engineering (reverse)
The reverse command converts an existing NodeSet2.xml file back into the OPC UA Modeler
YAML DSL. This is the entry point for teams migrating from hand-written NodeSet XML files,
or for importing third-party companion specification nodesets to use as a starting point.
opcua-modeler reverse --input MyModel.NodeSet2.xml --output my-model.yaml
Why reverse-engineer?
| Scenario | How reverse helps |
|---|---|
| You have existing NodeSet2.xml files and want to adopt the YAML workflow | Convert once, then maintain in YAML |
| You want to understand a companion specification (e.g., DI, Robotics) | Inspect it as readable YAML |
| You need to customise a third-party NodeSet | Import it, modify the YAML, regenerate |
Basic usage
# Reverse a single NodeSet2.xml to YAML
opcua-modeler reverse --input MyModel.NodeSet2.xml
# Specify output filename explicitly
opcua-modeler reverse --input MyModel.NodeSet2.xml --output my-model.yaml
By default, the output file is named after the input file with a .model.yaml suffix.
What gets converted
The reverse command reconstructs:
objectTypes— all custom ObjectType definitionsvariableTypes— all custom VariableType definitionsdataTypes— enumerations and structure typesreferenceTypes— custom reference type definitionsinterfaces— OPC UA interface typesinstances— concrete object instances with placement referencesstateMachines— finite state machine definitionsnamespaces— imported namespace aliases (where known)promotedToMandatory— optional members that were instantiated- Descriptions, display names, and engineering unit data
The reverse output is a good starting point but may require manual cleanup. Not all NodeSet2.xml constructs have a 1:1 YAML equivalent, and some legacy constructs (OPC UA 1.03 type dictionaries, BSD/XSD schemas) are deliberately omitted from the output.
Round-trip workflow
A common workflow is to reverse-engineer once and then use generate for all subsequent
changes:
NodeSet2.xml ──reverse──► model.yaml ──generate──► NodeSet2.xml (regenerated)
▲
edit here
After the initial reverse, commit the .model.yaml to version control and treat it as
the single source of truth. The original XML can be archived.
Options
| Flag | Short | Description |
|---|---|---|
--input | -i | Input NodeSet2.xml file (required) |
--output | -o | Output .model.yaml filename |
--debug | -d | Extra debugging output |