Avatar
Please consider registering
guest
sp_LogInOut Log Insp_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 RSSsp_TopicIcon
Range.getLow() / Range.getHigh() returns 0.0 instead of null when server sends null values.
February 9, 2026
16:39, EET
Avatar
mithun
Member
Members
Forum Posts: 13
Member Since:
September 11, 2024
sp_UserOfflineSmall Offline

Hello,

I am reading AnalogItem nodes with EURange properties in my custom OPC UA Client that uses the Prosys OPC UA SDK for Java.

The Range objects from the server have null Low/High values, as shown in the Prosys Simulation Server browser:
https://i.snipboard.io/pASd0y.jpg

In my Java code, I read the Range like this:

In my Java code that looks like this:
“`
DataValue dataValue = client.readValue(nodeId);
Object value = dataValue.getValue().getValue();
if (value instanceof Range)
{
Range range = (Range) value;
Double low = range.getLow(); // Returns 0.0, expected null
Double high = range.getHigh(); // Returns 0.0, expected null
}
“`
The values being returned by the SDK’s Range.getLow() and Range.getHigh() methods are 0.0 instead of null. See debugger screenshot here:
https://i.snipboard.io/wTR8KE.jpg

Interestingly, range.toString() shows Range [Low=”0.0″, High=”0.0″] rather than Range [Low=”null”, High=”null”], confirming the SDK has already converted null to 0.0 during decoding.

My questions:

1. Is this the expected behavior when the server sends null Double values in a Structure?
2. What would be the right way to identify when the Range Low/High values are actually null vs. intentionally set to 0.0?
3. Is there a way to access the raw encoded data or status to detect null fields before the SDK converts them?

We need to distinguish between “no range specified” (null) and “range is 0 to 0” (valid) to properly configure alarm limits on our control points.

SDK Version: 5.4.0-201
Server: Prosys OPC UA Simulation Server

Thanks.
Mithun,
Tridium Inc.

Thanks.

February 10, 2026
9:42, EET
Avatar
Matti Siponen
Moderator
Members

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

Hello,

When double values are encoded and decoded, it becomes impossible for Clients to distinguish between null and zero because both use the same encoded form. This also applies when they are used in Structure fields such as Low and High fields of Range. In fact, double is a non-nullable DataType in OPC UA and therefore it is technically not possible to set such values to null. The UI of Simulation Server is simply being misleading as it shows the value without any encoding and decoding and in “Java world” it is possible for the values of these fields to be null.

The OPC UA specification states the following for Range:

If a limit is not known a NaN shall be used. (https://reference.opcfoundatio…..docs/5.6.2)

I’ve verified that NaN can be used in Simulation Server as the value of the Low and High fields of Range. Thus, you should use that instead of null. Simply type NaN to the text field where you would enter Low and High values and it should be accepted and handled properly by the Server and the Client.

Forum Timezone: Europe/Helsinki
Most Users Ever Online: 1919
Currently Online:
Guest(s) 63
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Heikki Tahvanainen: 402
hbrackel: 144
rocket science: 100
pramanj: 86
Francesco Zambon: 83
Ibrahim: 78
Sabari: 62
kapsl: 57
gjevremovic: 49
Xavier: 43
Member Stats:
Guest Posters: 0
Members: 773
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1558
Posts: 6567
Newest Members:
earthameredith5, SheilaNag, freddiehuntsman, Sentra, linwoodpedley, martin.fires@kuka.com, coin24.io, nyx05, laitcanard, arianne1886
Moderators: Jouni Aro: 1039, Pyry: 1, Petri: 1, Bjarne Boström: 1054, Jimmy Ni: 26, Matti Siponen: 359, Lusetti: 0
Administrators: admin: 1