Skip to main content

o6-ncc

Your OPC UA information model describes the machine. ncc turns that model into code you can build an application around: C source for open62541 and Python namespace packages for o6\Python.

Types, instances, references, custom datatypes: the XML has already done the introductions. Let the compiler handle the repetitive declarations while you write the behavior that makes your application useful. There are better ways to spend an afternoon than copying NodeIds.

From information model to application

Keep the NodeSet as the source of truth for your model. Generate the code, connect it to your SDK, and keep application logic in your own modules. When the model changes, regenerate its output.

# Build the model's address space with open62541.
ncc c MyMachine.NodeSet2.xml -e Opc.Ua.NodeSet2.xml \
    --shortname mymachine -o generated/c

# Generate a namespace package for o6\Python.
ncc python MyMachine.NodeSet2.xml -e ns0 \
    --shortname mymachine -o generated/python

The C output gives your server an initializer to call. The Python output gives your application a namespace package to import and use. Dependencies stay explicit: C generation takes XML paths; Python generation accepts bundled model names or custom XML declarations with package locations.

Make open62541 development flow

  • Generate address spaces: turn one or more NodeSet XML files into C source and headers, with a named server initializer.
  • Bring your custom types: generate C structs and datatype tables from BSD definitions and NodeId CSVs, plus NodeId headers for application code.
  • Generate a complete model: ncc c model coordinates address-space code, datatype tables, and NodeId constants in one command.
  • Put generation in the build: the supplied CMake helper tracks model inputs, regenerates changed outputs, and carries include paths and link dependencies through a model target.

Change the model. Build the project. Get back to the interesting part.

Make o6\Python models feel at home

  • Generate organized packages: reference types, datatypes, variable types, object types, and instances have their own modules.
  • Keep editors in the loop: datatype .pyi stubs provide signatures for completion and static analysis.
  • Carry initial values into code: supported XML values become Python expressions, including nested structures, arrays, enums, unions, and composite OPC UA values.
  • Use companion specifications offline: bundled dependency XML is available through names such as ns0, di, and machinery.
  • Fit your project layout: declare where custom dependency packages belong and generate the corresponding imports.

Work with your model as Python classes: generated object and variable types preserve the model's inheritance and expose child nodes as typed attributes. The structure you designed in the NodeSet is ready to use in application code.

Inspect before you integrate

A reference graph occasionally needs a picture. Occasionally, it needs a very large picture.

# Inspect nodes, namespace URIs, and references as JSON.
ncc inventory MyMachine.NodeSet2.xml -e ns0 -o inventory.json

# Visualize the model with Graphviz.
ncc graphviz MyMachine.NodeSet2.xml -e ns0 -o model.dot

Inventory and Graphviz work independently of the chosen language backend. Graphviz supports DOT output, optional PDF/SVG/PNG rendering, and a selectable root node for focused diagrams. Shell completion covers commands, options, and dependency names in bash, zsh, fish, and PowerShell. cncc and pyncc are also available as shortcuts for ncc c and ncc python.

SDK compatibility

Generated code SDK baseline
C address spaces and datatype tables open62541 1.5 and later
Python namespace packages o6\Python 2.2.1 and later

Neither SDK is needed to generate code. Your application uses the corresponding SDK to compile or run the generated output; the compiler is not an application runtime dependency.

Model features can require SDK configuration—for example, UA_ENABLE_XML_ENCODING in open62541 preserves XML initial values. Consult your SDK's documentation for its configuration and runtime APIs.

SDK documentation

License

Developed by o6-Automation GmbH.

The compiler is licensed under the Mozilla Public License 2.0. Bundled NodeSet XML includes MIT-licensed material and retains its upstream notices.

Release files for o6-ncc 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for o6-ncc 1.0.1
File Size Uploaded
o6_ncc-1.0.1.tar.gz 3.9 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for o6-ncc 1.0.1
File Interpreter ABI Platform
o6_ncc-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 7.6 MB

Release files / o6_ncc-1.0.1.tar.gz

Download URL o6_ncc-1.0.1.tar.gz
Size 3.9 MB
Tags Source
SHA-256 checksum
How to use checksums
cf4c8681f1c957a6f7250d48d4da0834d533af2cbe236f1fade19ea35f666885
BLAKE2b-256 checksum
How to use checksums
92991207d69fd5565200d9acd395bace301e1ffd68ca202d25578bcb273732a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / o6_ncc-1.0.1-py3-none-any.whl

Download URL o6_ncc-1.0.1-py3-none-any.whl
Size 3.7 MB
Tags Python 3
SHA-256 checksum
How to use checksums
cd3d4581e9c22d967111fe7212123f6504bc5b9412737fe84c70a1f465a044c1
BLAKE2b-256 checksum
How to use checksums
f607eaca81c5898c7cea3474422454d29c548e0f84bc81ad9c6f13ae0310962b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page