Hello,
More than an issue this thread is to request your help to understand if there are any limitations in the possible characters used to name variables or objects or any thing when creating the model using the UA Modeler and also when consuming those objects from the .NET SDK?
I've not found yet any documentation about this specific topic, for example, can we use special symbols or characters from any language? Can we use all the possible characters in the ascii/ANSI table? Are there any known issues when using special chars?
I will appreaciate your response.
Limitations in the characters used to name objects/variables
Moderator: uasdknet
-
- Hero Member
- Posts: 21
- Joined: 14 Jun 2021, 23:39
- Support Team
- Hero Member
- Posts: 3072
- Joined: 18 Mar 2011, 15:09
Re: Limitations in the characters used to name objects/variables
First, there are different names used in OPC UA and the UaModeler. There is the localized DisplayName, the BrowseName (having a Namespace for qualifying) and the SymbolicName (see also https://documentation.unified-automation.com/uamodeler/1.6.7/html/sec_objecttypes.html).
There are no restrictions on the BrowseName and DisplayName (other than in the specification (https://reference.opcfoundation.org/Core/Part3/8.31/).
The SymbolicName (name in the UI of the UaModeler) is actually used for the code generation, and therefore has limitations with special characters (like space). If you type in a name, the UaModeler automictically fixes the SymbolicName but leaves the Browse- and DisplayName (after deploying the name). The SymbolicName cannot be accessed by the OPC UA interface. There, only Browse- and DisplayName are used.
The size of the name is rather a theoretical limitation from handling it in the UaModeler or in an information model, however the size of the SymbolicName might become an issue in code generation. In .NET, if I read correctly, the length (including .NET namespace) is limited to 1023 chars. So, depending on your .NET namespace, the length is limited and you will get compiler errors if the SymbolicName is too large.
Anyhow, as recommendation the size of any name should not become that long that it becomes hard to handle (from a user’s perspective). If you need a longer text explaining what the Node is doing, use the Description attribute.
There are no restrictions on the BrowseName and DisplayName (other than in the specification (https://reference.opcfoundation.org/Core/Part3/8.31/).
The SymbolicName (name in the UI of the UaModeler) is actually used for the code generation, and therefore has limitations with special characters (like space). If you type in a name, the UaModeler automictically fixes the SymbolicName but leaves the Browse- and DisplayName (after deploying the name). The SymbolicName cannot be accessed by the OPC UA interface. There, only Browse- and DisplayName are used.
The size of the name is rather a theoretical limitation from handling it in the UaModeler or in an information model, however the size of the SymbolicName might become an issue in code generation. In .NET, if I read correctly, the length (including .NET namespace) is limited to 1023 chars. So, depending on your .NET namespace, the length is limited and you will get compiler errors if the SymbolicName is too large.
Anyhow, as recommendation the size of any name should not become that long that it becomes hard to handle (from a user’s perspective). If you need a longer text explaining what the Node is doing, use the Description attribute.
Best regards
Unified Automation Support Team
Unified Automation Support Team