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: 9
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: 1687
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.

Avatar
Mikael Eklund
Member
Members
Forum Posts: 9
Member Since:
02/07/2017
sp_UserOfflineSmall Offline
3
08/28/2026 - 04:56
sp_Permalink sp_Print

Thanks for the reply Randy

 

Another question in same area. 

Is it allow to set property ConditionName (in EventType ConditionType) to null or empty according to the OPC UA specifications. 

 

Thanks

Avatar
Randy Armstrong
Admin
Forum Posts: 1687
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
4
08/31/2026 - 02:02
sp_Permalink sp_Print

https://reference.opcfoundatio.....ionType%2E

ConditionName identifies the Condition instance that the Event originated from. It can be used together with the SourceName in a user display to distinguish between different Condition instances. If a ConditionSource has only one instance of a ConditionType, and the Server has no instance name, the Server shall supply the name element of the BrowseName of the ConditionType.

Specification says no and provides a default if it does not make sense.

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