07/09/2025
OfflineHello everyone,
I’ve been struggling for a few days now to get my own OPC UA server up and running, and I’m hoping someone here can help point me in the right direction.
Context
- Server base: Console Reference Server from the OPC Foundation GitHub repo
- Models: multiple NodeSet2 XML files (custom information models)
- Toolchain: ModelCompiler.exe (latest version from the GitHub release)
- Goal: To generate C# code from the NodeSet2 files and integrate that code into the reference server.
Approach
- ModelCompiler is invoked for each NodeSet2 file like this:
echo Building PackML (NodeSet2)
%MODELCOMPILER% compile -version v105 ^
-d2 "%MODELROOT%/PackML/Opc.Ua.PackML.NodeSet2.xml,PackML,PackML" ^
-cg "%MODELROOT%/PackML/PackMLDesign.csv" ^
-o2 "%MODELROOT%/PackML"
IF %ERRORLEVEL% EQU 0 echo Success! - This creates folder structures for each model with files similar to those in the Boiler example (e.g., PackML.Classes.cs, PackML.Constants.cs, PackMLDataTypes.cs, etc.).
- I include these files in the Visual Studio project of the Quickstart Server.
Problem
I expected the Model Compiler to also automatically generate a ...NodeManager.cs file for each NodeSet (similar to BoilerNodeManager.cs in the example), so I would just need to register the lines in ReferenceServer.cs.
Unfortunately, that file is not generated.
What I’ve tried so far
- Various combinations of Model Compiler flags
- Manually adding a custom NodeManager class based on BoilerNodeManager.cs
→ leads to extensive manual adjustments that I haven’t been able to implement successfully - Reviewed all available example projects
→ none match my specific workflow (multiple NodeSet2 → one server) - Searched the forum & GitHub issues
→ found a few similar questions, but no clear solution for this exact scenario
Questions to the community
- Has anyone integrated multiple NodeSet2 models into a server without writing custom NodeManager classes manually?
- Is there perhaps an additional compiler flag or script that will generate the NodeManager files after all?
Any tips, sample code, or documentation links would be greatly appreciated. If I’ve missed any relevant information, I’m happy to provide it.
Thanks a lot in advance, and have a great day!
Best regards,
Nils
07/09/2025
OfflineHi everyone,
Just wanted to follow up on my original post in case it helps others facing a similar situation.
In the meantime, I discovered the Data Types Server example, which is part of the OPC Foundation Workshop projects on GitHub. This example finally gave me the clarity I needed on how to properly integrate NodeSet2 files into an OPC UA server and implement the necessary NodeManager and server extensions.
As a first step, I worked with a single NodeSet2 file — specifically, the OPC UA DI model. I compiled it using the following command:
echo Building DI (NodeSet2)
Opc.Ua.ModelCompiler.exe compile ^
-version v105 ^
-d2 ".\DI\Opc.Ua.Di.NodeSet2.xml,Opc.Ua.DI,DI" ^
-d2 ".\DI\Opc.Ua.NodeSet2.xml,Opc.Ua,UA" ^
-cg ".\DI\Output\ModelDesign2.csv" ^
-o2 ".\DI\Output"
echo Success!
After integrating the generated files into the server, I used UA Expert to browse the namespace. Interestingly, I noticed that some expected nodes from the original DI NodeSet were missing. For example, the variable MaxInactiveLockTime — which is clearly present in the input XML:
<UAVariable NodeId="ns=1;i=6387" BrowseName="1:MaxInactiveLockTime" DataType="i=290">
<DisplayName>MaxInactiveLockTime</DisplayName>
<Description>Server-specific period of time in milliseconds until the Server will revoke a lock.</Description>
<References>
<Reference ReferenceType="HasProperty" IsForward="false">i=2268</Reference>
<Reference ReferenceType="HasTypeDefinition">i=68</Reference>
</References>
</UAVariable>
…does not show up in the compiled code or the running server.
I’m currently investigating why this node is excluded during the compilation process.
If anyone has encountered similar missing-node issues during NodeSet2 compilation, or knows how to ensure all original nodes are preserved during transformation, I’d love to hear your input.
Thanks again,
Nils
05/30/2017
OfflineThe ModelCompiler does not generate NodeManagers because there is no need.
What you want to do is start with a sample:
https://github.com/OPCFoundati.....ler/Server
That example shows how to:
1) Add behaviour to an Object declared in the ModelDesign
2) Add a new Object based on ObjectType in the ModelDesign
3) Handle methods defined in the ModelDesign.
07/09/2025
OfflineHi Randy,
Thanks a lot for your response!
It looks like our posts crossed paths — my previous update about the code generation process was probably approved by the moderators after you had already replied. In that post, I described the next steps after successfully using the ModelCompiler, particularly in the context of integrating the DI model from the OPC UA Companion Specification.
That’s where I ran into a new issue: certain nodes from the NodeSet2 XML, such as MaxInactiveLockTime, are silently excluded during compilation. The node is fully present in the XML, but doesn’t appear in the generated C# code or the running server. At this point, I suspect some filtering or dependency mechanism during compilation, but I haven’t identified the root cause yet.
If you’ve encountered this behavior before or have any pointers on what to look out for, I’d really appreciate the insight.
Best regards,
Nils
05/30/2017
OfflineIt is missing from the class or missing from the instance?
MaxInactiveLockTime does not appear to a instance Property.
It has to be manually added to the address space.
07/09/2025
OfflineHi Randy,
Thanks again for your support!
I wanted to give a quick update: I’ve now successfully integrated all my NodeSet2 models into the server, and everything is running. In UA Expert, I can clearly see the expected types under Root\Types, which confirms that the compilation and loading process is working as intended.
However, I’m now struggling with the next step — creating instances of these types. The compiled NodeSet classes seem to be missing important properties, and in some cases, they appear to be entirely empty. This makes it difficult to instantiate objects as defined in the original models.
At this point, I believe the support I need has become quite specific and critical to the success of our project — likely beyond the scope of what this forum can provide. I’d really appreciate more in-depth, individual guidance on this topic.
Could you point me in the right direction on how to get extended or official consulting support for this?
Best regards,
Nils
07/09/2025
OfflineHello Randy,
Thank you very much for your help! I'm just not sure if I can share all the information from my project, as there are some confidential details. However, if I remove this information, I would hardly have anything left to explain my problem. Is there perhaps a way for me to get individual support?
Thank you,
Nils
1 Guest(s)


Log In

Usage Policy