11:40, EEST
December 20, 2021
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
14:05, EEST
April 3, 2012
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.
16:14, EEST
December 20, 2021
13:16, EEST
December 20, 2021
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
19:16, EEST
December 21, 2011
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.
18:16, EEST
December 20, 2021
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
10:46, EEST
December 21, 2011
18:15, EET
December 21, 2011
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(),
@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.
Most Users Ever Online: 1919
Currently Online:
62 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: 737
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1524
Posts: 6450
Newest Members:
fannielima, kristiewinkle8, rust, christamcdowall, redaahern07571, nigelbdhmp, travistimmons, AnnelCib, dalenegettinger, howardkennerleyModerators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1026, Jimmy Ni: 26, Matti Siponen: 346, Lusetti: 0
Administrators: admin: 1