16:46, EEST
March 16, 2017
Hi,
I’ve problems in getting the QualifiedName for the EventFields for an Event of Type RfidScanEventType
I’ve an OpcUa server where I’ve subscribed with a MonitoredEventItem to a node where I receive Events of the type RfidScanEventType which looks basically like this in the types view:
+ Types
…+ EventTypes
……+ BaseEventType
………+ConditionType
…………+ EventId
…………+ Message
………+ AutoIdScanEventType
…………+ DeviceName
…………+ ScanResult
…………+ RfidScanEventType
……………+ ScanResult
When I specify the ‘EventFieldNames’ like in the SampleConsoleClient with e.g. ‘new QualifiedName(“EventId”);’ then it works for the EventId and Message, but when I use new QualifiedName(“DeviceName”); or new QualifiedName(“ScanResult”); I’m getting only null in the event notifier for this two EventFields.
So in the method ‘onEvent(MonitoredEventItem monitoredEventItem, Variant[] eventFields)’ the Variant for e.g. EventId and Message has a value, but for DeviceName and ScanResult I’m always getting null.
I think the the EventField name for the DeviceName and ScanResult is something different than ‘new QualifiedName(“ScanResult”)’? – But how should the QualifiedName look like?
When I’m subscribing to this event using the UaExpert and checking the event fields ‘EventId, Message, DeviceName and ScanResult’, I can see that the DeviceName has some value and also the ScanResult cotains an Array of ExtensionObject containing RfidScanResult’s
9:29, EEST
Moderators
February 11, 2020
Hello,
When specifying QualifiedNames of EventFields, you must also consider the Namespace Indices. If the index is omitted when creating a QualifiedName instance, the index is assumed to be zero.
The specification of EventFilters (https://reference.opcfoundation.org/Core/Part4/v104/docs/7.17.3) states that “This structure requires the NodeId of an EventType supported by the Server and a path to an InstanceDeclaration. An InstanceDeclaration is a Node which can be found by following forward hierarchical references from the fully inherited EventType where the Node is also the source of a HasModellingRule reference.” Effectively this means that the Properties of EventType Nodes match the Fields of the Events of those types. Therefore, you can check the EventType to determine the Namespace of a Property/Field.
For the DeviceName and ScanResult EventFields, the index used when creating QualifiedNames should be the index of the http://opcfoundation.org/UA/AutoID/ Namespace.
Most Users Ever Online: 1919
Currently Online:
34 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: 734
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1523
Posts: 6449
Newest Members:
christamcdowall, redaahern07571, nigelbdhmp, travistimmons, AnnelCib, dalenegettinger, howardkennerley, Thomassnism, biancacraft16, edgardo3518Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1026, Jimmy Ni: 26, Matti Siponen: 346, Lusetti: 0
Administrators: admin: 1