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: 88
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: 349
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: 1919

Currently Online:
32 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: 726

Moderators: 7

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1529

Posts: 6471

Newest Members:

gabriellabachus, Deakin, KTP25Zof, Wojciech Kubala, efrennowell431, wilfredostuart, caitlynfajardo, jeromechubb7, franciscagrimwad, adult_gallery

Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1032, Jimmy Ni: 26, Matti Siponen: 349, Lusetti: 0

Administrators: admin: 1