Avatar

Please consider registering
guest

sp_LogInOut Log In sp_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 RSS sp_TopicIcon
EventFields - QualifiedName for ScanResult of RfidScanEventType
July 31, 2023
16:46, EEST
Avatar
rocket science
Member
Members
Forum Posts: 77
Member Since:
March 16, 2017
sp_UserOfflineSmall Offline

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

August 1, 2023
9:29, EEST
Avatar
Matti Siponen
Moderator
Members

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

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.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
12 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 135

pramanj: 86

Francesco Zambon: 81

rocket science: 77

Ibrahim: 76

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

fred: 41

Member Stats:

Guest Posters: 0

Members: 683

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1467

Posts: 6261

Newest Members:

digitechroshni, LouieWreve, Kickbiche, karrimacvitie5, graciela2073, sagarchau, elviralangwell4, Donnavek, Eddiefauth, DonaldPooma

Moderators: Jouni Aro: 1010, Otso Palonen: 32, Tuomas Hiltunen: 5, Pyry: 1, Petri: 0, Bjarne Boström: 983, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Jimmy Ni: 26, Teppo Uimonen: 21, Markus Johansson: 42, Niklas Nurminen: 0, Matti Siponen: 321, Lusetti: 0, Ari-Pekka Soikkeli: 5

Administrators: admin: 1