Integrating Multiple NodeSet2 Models into OPC UA Reference Server – NodeManager Not Generated|OPC UA Implementation: Stacks, Tools, and Samples|Forum|OPC Foundation

Avatar
Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
Lost password?
sp_Feed sp_PrintTopic sp_TopicIcon
Integrating Multiple NodeSet2 Models into OPC UA Reference Server – NodeManager Not Generated
Avatar
Nils Mensing_1
Member
Members
Forum Posts: 5
Member Since:
07/09/2025
sp_UserOfflineSmall Offline
1
07/09/2025 - 23:24
sp_Permalink sp_Print

Hello 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

  1. 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!
  2. 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.).
  3. 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

  1. Has anyone integrated multiple NodeSet2 models into a server without writing custom NodeManager classes manually?
  2. 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

Avatar
Nils Mensing_1
Member
Members
Forum Posts: 5
Member Since:
07/09/2025
sp_UserOfflineSmall Offline
2
07/11/2025 - 01:21
sp_Permalink sp_Print

Hi 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

Avatar
Randy Armstrong
Admin
Forum Posts: 1664
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
3
07/12/2025 - 12:14
sp_Permalink sp_Print

The 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.

Avatar
Nils Mensing_1
Member
Members
Forum Posts: 5
Member Since:
07/09/2025
sp_UserOfflineSmall Offline
4
07/13/2025 - 09:51
sp_Permalink sp_Print

Hi 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

Avatar
Randy Armstrong
Admin
Forum Posts: 1664
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
5
07/14/2025 - 07:05
sp_Permalink sp_Print sp_EditHistory

It 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.

https://reference.opcfoundatio.....4/docs/7.4

Avatar
Nils Mensing_1
Member
Members
Forum Posts: 5
Member Since:
07/09/2025
sp_UserOfflineSmall Offline
6
07/16/2025 - 07:18
sp_Permalink sp_Print

Hi 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

Avatar
Randy Armstrong
Admin
Forum Posts: 1664
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
7
07/18/2025 - 06:14
sp_Permalink sp_Print sp_EditHistory

If you are willing post details here I can get into the specifics of your problems.

Avatar
Nils Mensing_1
Member
Members
Forum Posts: 5
Member Since:
07/09/2025
sp_UserOfflineSmall Offline
8
07/22/2025 - 14:35
sp_Permalink sp_Print

Hello 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

Forum Timezone: America/Phoenix
Most Users Ever Online: 975
Currently Online:
Guest(s) 18
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 10
Topics: 1516
Posts: 5124