Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Differente translation in every node
April 3, 2023
17:22, EEST
Avatar
APesce
Italy
Member
Members
Forum Posts: 10
Member Since:
December 21, 2022
sp_UserOfflineSmall Offline

Good morning,
what is the best way to publish 5-6 translations of description\definition\EnumValues attributes?

Thanks for response!

April 4, 2023
10:33, EEST
Avatar
Matti Siponen
Moderator
Members

Moderators
Forum Posts: 346
Member Since:
February 11, 2020
sp_UserOfflineSmall Offline

Hello,

You can use the setDescription and setDisplayName methods of com.prosysopc.ua.server.nodes.BaseNode to set multiple Descriptions and DisplayNames in different Locales. Although the methods are named setX, they actually add LocalizedTexts to a LocalizedTextMap which can contain one LocalizedText per LocaleId. When reading Descriptions and DisplayNames, the Server will attempt to return a Value that matches the list of Locales provided by a Client in ActivateSession request.

When you say definition, I’m assuming you mean the Definition Property of DataItemType. If I’m wrong, please correct me. The OPC UA specification states the following about Definition: “Definition is non-localized and will often contain an equation that can be parsed by certain clients” (https://reference.opcfoundation.org/Core/Part8/v105/docs/5.3.1). Therefore, you should not localize Definitions.

EnumValues can be localized but there is no built-in support for this in the SDK and we don’t have any examples of how to do this. In theory, you could either replace the IoManager of the NodeManager that handles reading the EnumValues with your own IoManager or add an IoManagerListener to the default IoManager of the same NodeManager and have the listener handle reading the EnumValues. In either case, you would be able to use ServiceContext to get a Session and then use that to get a list of Locales and return different values depending on the listed Locales.

April 4, 2023
15:40, EEST
Avatar
APesce
Italy
Member
Members
Forum Posts: 10
Member Since:
December 21, 2022
sp_UserOfflineSmall Offline

I understand. The language of the session (of the client) drives the response of the server.

In my case we were asked to publish all the translations we have for each node.
Do you think it is possible to create an internal Dictionary (OPC UA 1000-19)?
Or should I create additional nodes with all translations?

April 5, 2023
8:42, EEST
Avatar
Matti Siponen
Moderator
Members

Moderators
Forum Posts: 346
Member Since:
February 11, 2020
sp_UserOfflineSmall Offline

Hello,

I’m not quite sure what you mean with “we were asked to publish all the translations we have for each node”. Who is asking for this?

In OPC UA, Clients provide Servers with lists of Locales ordered from the most preferred to the least preferred. The Servers are then expected to use this list and attempt to provide localized DisplayNames, Descriptions and so on if they have localized versions available for the specified Locales or use their default Locale if they do not support any of the listed Locales. There is no concept of the Server returning multiple different localized versions of an Attribute such as Description when a Client reads its value. Neither is there a standardized way of exposing different translations in the Server’s AddressSpace.

Part 19: Dictionary Reference specifies how Nodes can be connected to DictionaryEntry Nodes that provide additional semantics for a Node. For example, a Node representing a flow transmitter could reference a DictionaryEntry Node that represents flow transmitters with a HasDictionaryEntry Reference. For more examples, see https://reference.opcfoundation.org/Core/Part19/v105/docs/9

In short, Part 19: Dictionary Reference has nothing to do with translating values of Attributes. It simply allows providing more semantics to Nodes using external standardized dictionaries such as International Registration Data Identifiers (IRDI).

If you need to expose all the translations in the Server’s AddressSpace, you will most likely need to add them as Values of additional Nodes. For example, you could use Property Nodes with LocalizedText Arrays that contain all the translations as their Values. Do note that this is a non-standardized solution so Clients would not automatically understand the purpose of the Property Nodes containing the translations.

May 23, 2023
11:00, EEST
Avatar
APesce
Italy
Member
Members
Forum Posts: 10
Member Since:
December 21, 2022
sp_UserOfflineSmall Offline

Hi Matti,
can you implemented the EnumValues multilocale like the DisplayName o Description?
Currently, when I set my client (UaExpert) to Italian, the EnumValues of a MultiStateDiscrete Node are still displayed in English. The same issue occurs with the TrueState and FalseState of a TwoStateDiscrete Node.
Certenly our client request it to us.

Thanks,
Best regards.

May 23, 2023
11:32, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 1026
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

We will need to continue via email.

For anyone else reading this, basically SDK 4.x does only support the Description and DisplayName Attributes, anything else needs to be “faked” manually with a lot of work via IoManagerListener etc. Future SDK 5.x should support this better.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 1919

Currently Online:
65 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Heikki Tahvanainen: 402

hbrackel: 144

rocket science: 88

pramanj: 86

Francesco Zambon: 83

Ibrahim: 78

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

Member Stats:

Guest Posters: 0

Members: 734

Moderators: 7

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1523

Posts: 6449

Newest Members:

christamcdowall, redaahern07571, nigelbdhmp, travistimmons, AnnelCib, dalenegettinger, howardkennerley, Thomassnism, biancacraft16, edgardo3518

Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1026, Jimmy Ni: 26, Matti Siponen: 346, Lusetti: 0

Administrators: admin: 1