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 modelcoordinates 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
.pyistubs 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, andmachinery. - 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.0 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
- Official o6\Python documentation — build your Python application around its models, server APIs, and runtime.
- Official open62541 documentation — explore the C SDK, server configuration, tutorials, and API reference.
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.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| o6_ncc-1.0.0.tar.gz | 3.9 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| o6_ncc-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.5 MB
Release files / o6_ncc-1.0.0.tar.gz
| Download URL | o6_ncc-1.0.0.tar.gz |
|---|---|
| Size | 3.9 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4f0397c1fa84c4327f88cb0acef8f4d85e9472bdd44830e6a918db9cfb8af400
|
|
BLAKE2b-256 checksum How to use checksums |
deb7bf04ac980caf2050b2c2a6e9e74c086a8be5c790af0a5e85df88019ad25a
|
| 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.0-py3-none-any.whl
| Download URL | o6_ncc-1.0.0-py3-none-any.whl |
|---|---|
| Size | 3.7 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7bae0efdf0a1acee4251ebd8713658f681ddc355b3bcb38f90c7ca6277a23cc1
|
|
BLAKE2b-256 checksum How to use checksums |
6987e53b12a2c97a586831abbc558735742b81ffba37864692e80cda69cfc78e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|