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
Engineering Units management
May 3, 2023
11:40, EEST
Avatar
Francesco Zambon
Member
Members
Forum Posts: 81
Member Since:
December 20, 2021
sp_UserOfflineSmall Offline

Good morning,

Can you please explain how to manage the measurement units (EngineeringUnits) of the analog variables (AnalogItemType) in the OPC UA standard?

I take as an example the TemperatureLimitation variable defined in the EUROMAP 82.1 standard https://www.euromap.org/euromap82-1

Variable name:
TemperatureLimitation

Type:
0:AnalogItemType

Description (File EUROMAP82.1_Release_1.01.pdf Page 18):
10.5 Temperature Limitation
Description: This setpoint is for temperature limitation of the mold circuit e.g. to protect the connected tubes or the downstream water distribution system.
Units: °C or °F
Example: 120

Question 1:
Can the EngineeringUnits node be “handled” like the LocalizedText node?
Can the OPC UA client display the TemperatureLimitation variable in the desired unit of measurement?
For example by setting the LOCALE of the client (en_US, de_DE, fr_FR, …), the server translates the LocalizedText into the desired language of the client.

Question 2:
I don’t understand the meaning of the sentence “Unit: °C or °F”.
It means that the OPC UA server can decide to display the variable in “°C” or “°F”, or that the OPC UA client can display the variable both in the unit of measure “°C” and in the unit of measure “°F”?

Question 3:
Are there other types in the OPC UA standard besides EngineeringUnits to manage units of measurement?

Thank you for your help.
Best regards.

Francesco

May 3, 2023
14:05, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 982
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

Technically it is also a “standard Property” that is optional to any Variable node: https://reference.opcfoundation.org/Core/Part3/v105/docs/5.6.2 (with some limitations). For the EUInformation Structure itself see: https://reference.opcfoundation.org/v104/Core/docs/Part8/5.6.3/.

SDK contains some help from the ” “Codes for Units of Measurement” published by the “United Nations Centre for Trade Facilitation and Electronic Business”” in in com.prosysopc.ua.stack.core.StandardEngineeringUnits. It is .. maybe not the easiest to use, but it has static methods: ‘List getAll()’, ‘EUInformation getByCommonCode(String commonCode)’ and ‘getByUnitId(int unitId)’. There are .. a lot of units, but here the StandardEngineeringUnits.DEGREE_CELSIUS and DEGREE_FAHRENHEIT are most likely the ones you look for. A “°C or °F” from a different “EUInformation”-namespace than the “https://opcfoundation.org/UA/units/un/cefact” might mean a different thing (doublecheck does the euromap say anything about this, if not I would assume it to mean this one). And it probably would be better to use the namespace+unitId instead of any displayname/desription for other than visualization purposes. But in general I would sort of say it is the same thing with localization, these are features added to the spec, but possibly like never (yet) used.

1. No, it is just extra info about the “type/kind” of the value, so here it is either °C or °F, but there are no automatic conversions (spec-wise). You can only set one of them. In the localization the locales are transmitted as part of the ActivateSession; there is nothing similar for this. In theory client can of course convert values by itself, but it would be a purely client-side thing.

2. It means the literal value given (by the server maker etc.) can either be given/set as farenheit or celcius and the EngineeringUnits Property shall be set to the same so that there is no confusion for clients which one it is. (so if you set it in celsius, you would also use StandardEngineeringUnits.DEGREE_CELSIUS as the EngineeringUnits).

3. For units of measurement, not that I know. For currency it would seem at some point this was added: https://reference.opcfoundation.org/Core/Part3/v105/docs/8.61.

May 3, 2023
16:14, EEST
Avatar
Francesco Zambon
Member
Members
Forum Posts: 81
Member Since:
December 20, 2021
sp_UserOfflineSmall Offline

Dear Bjarne,

Thanks for your help.

Best regards,
Francesco

October 25, 2023
13:16, EEST
Avatar
Francesco Zambon
Member
Members
Forum Posts: 81
Member Since:
December 20, 2021
sp_UserOfflineSmall Offline

Hi Bjarne,

In my OPC UA server I would need to change the runtime EngineeringUnits of an analog variable at runtime.
I would need to understand if the SDK handles the SemanticChange flag and the SemanticChangeEvent event.

Documentation:
https://reference.opcfoundation.org/Core/Part3/v105/docs/5.6.2

Best regards,
Francesco

October 25, 2023
19:16, EEST
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1009
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

Yes, if you change variables with SemanticChange in their AccessLevel, the SDK should handle the SemanticChange bit being set for the next Value change that is reported for MonitoredItems and also it should send a SemanticChangeEvent.

It seems, though, that EngineeringUnits in AnalogItems don’t have the SemanticChange flag set in their AccessLevel by default, so you would need to check that in your server to enable this functionality.

October 26, 2023
18:16, EEST
Avatar
Francesco Zambon
Member
Members
Forum Posts: 81
Member Since:
December 20, 2021
sp_UserOfflineSmall Offline

Hi Jouni,

I only set the SemanticChange flag of the AccessLevel of the EngineeringUnits property of an Analog variable.

Then I listened to the SemanticChangeEventType events of the Server node with the UaExpert client.

I noticed that I receive SemanticChangeEventType events when the value of the Analog changes, and not only when the value of the EngineeringUnits property changes (e.g. °C -> °F).

Is this behavior correct?

Thanks,
Francesco

October 27, 2023
10:46, EEST
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1009
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

Hi Francesco,

Thanks for the update. Does not sound correct that it would trigger from the changes of the variable itself. But we will have to check this.

BR, Jouni

November 2, 2023
18:15, EET
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1009
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

Hi Francesco,

Sorry for a long delay. I tried this now myself with the following modification to the SampleConsoleServer:

I added the following code into ComplianceNodeManager.initialize(),

BaseAnalogTypeNodeBase.setBaseAnalogTypeNodeInitializer(new GeneratedNodeInitializer<BaseAnalogTypeNode>() {

@Override
public void init(BaseAnalogTypeNode node) {
AccessLevelType accessLevel = node.getEngineeringUnitsNode().getAccessLevel();
accessLevel = (AccessLevelType) accessLevel.toBuilder().add(AccessLevelType.Options.SemanticChange)
.add(AccessLevelType.Options.CurrentWrite).build();

node.getEngineeringUnitsNode().setAccessLevel(accessLevel);

}
});

(EngineeringUnits of these variables in the sample are read-write already, but if you want to enable this in your own applications, you also need to add the CurrentWrite bit to enable changes from the clients).

After this, I write the EngineeringUnits from the UA Browser and I get a SemanticChangeEvent in the EventView immediately and after I change the value of the respective variable (DoubleAnalogItem) it’s status has SemanticChangeBit set (0x00004000).

So, to me it looks like it works correctly.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
9 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 135

pramanj: 86

Francesco Zambon: 81

rocket science: 75

ibrahim: 75

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

fred: 41

Member Stats:

Guest Posters: 0

Members: 708

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1465

Posts: 6252

Newest Members:

christi10l, ahamad1, Flores Frederick, ellenmoss, harriettscherer, shanonhumphreys, KupimotoblokfuB, tamhollander5, paulinafcf, bridgette18l

Moderators: Jouni Aro: 1009, Otso Palonen: 32, Tuomas Hiltunen: 5, Pyry: 1, Petri: 0, Bjarne Boström: 982, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Jimmy Ni: 26, Teppo Uimonen: 21, Markus Johansson: 42, Niklas Nurminen: 0, Matti Siponen: 319, Lusetti: 0, Ari-Pekka Soikkeli: 5

Administrators: admin: 1