Is it allowed to set the value to null on a mandatory property in an EventType?|OPC UA Standard|Forum|OPC Foundation

Avatar
Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
Lost password?
sp_Feed sp_PrintTopic sp_TopicIcon
Is it allowed to set the value to null on a mandatory property in an EventType?
Avatar
Mikael Eklund
Member
Members
Forum Posts: 8
Member Since:
02/07/2017
sp_UserOfflineSmall Offline
1
08/12/2026 - 01:07
sp_Permalink sp_Print sp_EditHistory

Hi,

Is it allowed, according to the specifications, to set the value on a mandatory property, in an event, to null. 

 

For example:

Assuming an event of EventType BaseEventType.

Is it allowed for an OPC UA server to set, for example, property SourceName to null in the event?

 

If it is, is it the same for any mandatory property in any EventType? 

Should an OPC UA client be able to take that into account?

 

Thanks

Avatar
Randy Armstrong
Admin
Forum Posts: 1686
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
2
08/12/2026 - 19:36
sp_Permalink sp_Print

If a mandatory field has a nullable value you could set it to. i..e String to ""

But the Value cannot be Variant.Empty for mandatory properties.

However, the "" rule does not apply if the description of the property makes it clear that "" is not a valid value:

SourceName provides a description of the source of the Event. This could be the string-part of the DisplayName of the Event source using the default locale of the server, if the Event is specific to a Node, or some server-specific notation.

(i.e. "" is not a description)

Clients should be designed defensively to deal with misbehaving Servers but that does not make the server right.

Forum Timezone: America/Phoenix
Most Users Ever Online: 1361
Currently Online:
Guest(s) 35
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 10
Topics: 1530
Posts: 5173