Hi,
When subscribing to model change events. How can I get the BrowseName or DisplayName of the affected node?
I can get the nodeId from the BrowseNames.Changes and the parent node name from BrowseNames.SourceName. But I can not figure out how to get the name of the affected node.
I have tried BrowseNames.Name and BrowseNames.EffectiveDisplayName but the all return null.
string parentName = changeEvent.MonitoredItem.Filter.GetValue<string>(changeEvent.Event, BrowseNames.SourceName, "null"); // Returns the name of the parent node
string name = changeEvent.MonitoredItem.Filter.GetValue<string>(changeEvent.Event, BrowseNames.Name, "null"); // Returns "null"
string ename = changeEvent.MonitoredItem.Filter.GetValue<string>(changeEvent.Event, BrowseNames.EffectiveDisplayName, "null"); // Returns "null"
BR,
-Martin
At model change, get the name of the affected node
Moderator: uasdknet
-
- Jr. Member
- Posts: 3
- Joined: 17 Nov 2017, 08:47
- Support Team
- Hero Member
- Posts: 3068
- Joined: 18 Mar 2011, 15:09
Re: At model change, get the name of the affected node
Hello Martin,
you cannot get the BrowseName of the affected node directly. You need to add the EventField "Changes" to the SelectClauses. The Datatype of this event field is ModelChangeStructureDataType. The structure field Affected represents the NodeId of the affected node. You can use the Read service to get the BrowseName.
you cannot get the BrowseName of the affected node directly. You need to add the EventField "Changes" to the SelectClauses. The Datatype of this event field is ModelChangeStructureDataType. The structure field Affected represents the NodeId of the affected node. You can use the Read service to get the BrowseName.
Best regards
Unified Automation Support Team
Unified Automation Support Team