Tool · Modelling

UA-ModelCompiler

VendorOPC Foundation
CostOpen source, published by the OPC Foundation
PlatformsCross-platform via the .NET SDK (Windows, Linux, macOS)
TypeModelling

UA-ModelCompiler is the OPC Foundation's command-line nodeset compiler, installed as a .NET global tool. It compiles model design XML into NodeSet2 files and generated identifiers, and it resolves nodeset dependencies for you, which makes it the tool to reach for when modelling has to happen inside a build pipeline.

What you actually use it for

  • Compiling a model design file into a NodeSet2 XML file plus an identifier CSV, reproducibly, from a script.
  • Compiling a directory of nodesets for a specific namespace URI so that dependencies resolve consistently.
  • Putting model generation into CI, so the nodeset in your repository is always the one your build produced.
  • Producing the generated identifiers that server code needs alongside the nodeset, rather than transcribing NodeIds by hand.
  • Working with structures that permit subtypes, where the compiler has an explicit switch rather than degrading fields to plain ExtensionObjects.

Walkthrough

  1. Install it as a .NET global toolRun dotnet tool install --global OPCFoundation.Opc.Ua.ModelCompiler.Tool. You then invoke it as Opc.Ua.ModelCompiler. Because it is a global tool, the same install works on a Linux build agent as on a developer laptop.
  2. Compile a model design fileOpc.Ua.ModelCompiler compile -d2 ./MyModel.xml -cg ./MyModel.csv -o2 ./output takes your design and produces the NodeSet2 output plus the identifier CSV. Keep both under version control; the CSV is what stops NodeIds drifting between builds.
  3. Compile a nodeset directory for one namespaceOpc.Ua.ModelCompiler compile-nodesets -input ./NodeSets -o2 ./output -uri http://opcfoundation.org/UA/DI/ compiles a whole nodeset tree for a named namespace URI. Use this when your model depends on companion specifications and you need the dependency closure handled properly.
  4. Pin the nodeset versions you compile againstCheck the companion nodesets into your repository at a known revision rather than pulling latest at build time. Companion specifications are republished, and a silently newer dependency is a silently different model.
  5. Wire it into the buildMake nodeset compilation a build step and fail the build on compiler errors. A model that only compiles on one engineer's machine is the same class of problem as code that only builds there.
  6. Load the output into a server and browse itCompilation success is not conformance. Load the produced NodeSet2 into your server stack, browse it with an independent client and confirm HasTypeDefinition and mandatory components resolve as intended.

What it will not do

  • Command-line only. There is no graphical editor, so authoring the design XML is on you or on another tool.
  • Requires a .NET SDK on the build machine, which some constrained build environments will not have.
  • It validates and compiles; it does not test behaviour, conformance or client interoperability.
  • Options and switch names change between releases, so a command line copied from older documentation may not run.
  • It will not tell you that you chose the wrong companion specification or the wrong base type.

Alternatives

Instead of thisWhen
uamodelerWhen you want to author the model graphically rather than write design XML.
opcua-modelerAn open-source graphical editor to produce or fix the nodeset before or after compilation.
ua-cloud-libraryWhen the model you need may already exist and can be pulled rather than authored.
uanodesetwebviewerTo review compiled output quickly in a browser without standing up a server.
Verify before you rely on this: The .NET global tool package identifier, the required SDK version and the exact command-line switches move with the release. Confirm the current install command, switch names and supported .NET versions in the project's own readme before scripting it, and pin the tool version in your build so a new release cannot change your generated nodeset.

Last verified 7 September 2026 against OPC UA 1.05.07. OPC UA Connect is an educational resource and is not affiliated with the OPC Foundation.

Free download
OPC UA Server Acceptance Test Pack
A 40-check acceptance test you run against a vendor's server before commissioning sign-off. Weighted scoring, three hard gates, and a one-page verdict for the supplier meeting.
Get the free test pack →
Free, no course, no login