Error during generation of .cs files

Questions regarding the use of UaModeler

Moderator: uamodeler

Post Reply
miles98
Jr. Member
Jr. Member
Posts: 4
Joined: 27 Mar 2024, 14:18

Error during generation of .cs files

Post by miles98 »

I am importing this list of nodesets:
- [locked] Opc.Ua.NodeSet2.ua
- [locked] Opc.Ua.Di.NodeSet2.ua
- [locked] Opc.Ua.PackML.NodeSet2.ua (download from GitHub)
- [locked] Opc.Ua.TMC.NodeSet2.ua (download from GitHub)
- MyCustom.NodeSet2.ua
- .NET Server 4.0

I am using 1.7.1.577

During the generation of the cs files,I see on the very top (where namespace should be) this error (in particular in the Classes.cs file):

Code: Select all

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using ;
using UnifiedAutomation.UaBase;
using UnifiedAutomation.UaServer;
as you can see this "using ;" is generating error for obvious reason.

I think this is a serious bug that need particular attention, because every time fixing replacing manually is a waste of time. The bug is in both 1.7.0 and 1.7.1.

User avatar
Support Team
Hero Member
Hero Member
Posts: 3265
Joined: 18 Mar 2011, 15:09

Re: Error during generation of .cs files

Post by Support Team »

Hi,

thank you for reporting this issue. This seems to be a misconfiguration in UaModeler. If there is a line only containing a semicolon, this is a hint that some base models, on which other models are depending on, are not selected for code generation. Please make sure that all model have "the blue gearwheel".

NOTE: when having set the above, however there is an issue with the TMC model. The issue is related to the SubStateMachines used in the type TMCStateMachineType. Eventhough not forbidden, it is questionable, if that makes sense and might be clarified with the TMC editor. The templates will be updated with the next template release.
Best regards
Unified Automation Support Team

miles98
Jr. Member
Jr. Member
Posts: 4
Joined: 27 Mar 2024, 14:18

Re: Error during generation of .cs files

Post by miles98 »

Support Team wrote:
14 Mar 2025, 19:13
Please make sure that all model have "the blue gearwheel".
No, I don't want to generate code with locked models. Because TMC is massive as a black hole (for no reason), every time I generate code with the TMC flagged with the blue gearwheel, I need to wait at least 10 minutes and I don't want to waste my time every time I do even a small change in my nodeset, so this in my codebase is controlled separately.
(Anyway, if I flag TMC with the blue gearwheel, the using namespace is written correctly.)
Support Team wrote:
14 Mar 2025, 19:13
NOTE: when having set the above, however there is an issue with the TMC model. The issue is related to the SubStateMachines used in the type TMCStateMachineType. Eventhough not forbidden, it is questionable, if that makes sense and might be clarified with the TMC editor. The templates will be updated with the next template release.
So what do you suggest?

User avatar
Support Team
Hero Member
Hero Member
Posts: 3265
Joined: 18 Mar 2011, 15:09

Re: Error during generation of .cs files

Post by Support Team »

Hi,

independent of being locked or unlocked (just hindering accidental modification), the "blue gear wheel" must be present for all models of which the derived objects may have references to. That said they all need to be enabled for "code generation". The UaModeler must run over them and check/resolve dependencies (which is the time consuming part), even if not nessesarily "code" is required.

For the second issue within the TMC model (SubStateMachine), there will be bugifxed UaModeler-Templates coming in next service release. If you need earlier you can contact the tech support via the support form: https://webdav.unifiedautomation.com/support/support_form.html
Best regards
Unified Automation Support Team

Post Reply