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
Subscribing to EventNotifier
August 29, 2018
15:23, EEST
Avatar
Frank Schäckermann
New Member
Members
Forum Posts: 2
Member Since:
August 29, 2018
sp_UserOfflineSmall Offline

Hi!
I am trying to use the OPC Foundation Java implementation to subscribe to an event on the OPC UA Simulation server using it’s service CreateMontioredItems with ReadValueId objects where the attribute is set to Attributes.EventNotifier and without any filters.
Unfortunately I receive the following ServiceFaultException:

Bad_InternalError (0x80020000) “An internal error occurred as a result of a programming or configuration error.” for operation CreateMonitoredItems:
ServiceFault: Bad_InternalError (0x80020000) “An internal error occurred as a result of a programming or configuration error.”
Diagnostic Info: ServiceFault: Bad_InternalError (0x80020000) “An internal error occurred as a result of a programming or configuration error.”
Diagnostic Info: java.lang.IllegalArgumentException: addItem called with EventNotifier, use addEventItme instead

Is there something else I need to do to get this working? According to the specifications there is no special service for event subscriptions.
Thanks, Frank

August 29, 2018
15:58, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 1032
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

The error could be a bit better.

Anyway, you must always define an EventFilter. Making a monitored item (for EventNotifier) without one would not make any sense as it could not return any data, since the returned data is mapped 1:1 to the fields requested in the EventFilter (and only the data i.e. no headers, it is in same order as requested).

Please see spec v1.04 Part 4 section 7.17.3 for the EventFilter usage.

October 12, 2018
11:45, EEST
Avatar
Frank Schäckermann
New Member
Members
Forum Posts: 2
Member Since:
August 29, 2018
sp_UserOfflineSmall Offline

Hi Bjarne!

Sorry for the long delay to get back to you… other things got in the way.

You are right, in 7.17.3 it states, that at least one selectClause must be specified in the EventFilter structure.

But in the description of the MonitoringParameters (7.16) for the “filter” field in the structure it states:

A filter used by the Server to determine if the MonitoredItem should generate a
Notification. If not used, this parameter is null. The MonitoringFilter parameter type
is an extensible parameter type specified in 7.17. It specifies the types of filters that
can be used.

Therefore it should be possible to use MonitoringParameters WITHOUT an EventFilter, since there is no specific reference to event subscriptions REQUIRING a filter – at least not that I found one.
And that is exactly what I have been trying: not using a filter at all. Without success due to above mentioned error message.

Regards, Frank

October 12, 2018
12:47, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 1032
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

The specification is always not that clear on things or might even contradict itself (even more if you do not look at all the points that indirectly refer the same point; also this sometimes affects us as well and is a source of bugs, another is that the text might evolve between spec versions).

It’s maybe easier if I ask this way: What is the end result/data you are expecting to see if you would/could make monitoreditem for EventNotifier Attribute without an EventFilter?

1.04 Part 4
Section 5.12.1.1
“Objects and views can be used to monitor Events. Events are only available from Nodes where the
SubscribeToEvents bit of the EventNotifier Attribute is set. The filter defined in this standard (see
7.17.3) is used to determine if an Event received from the Node is sent to the Client. The filter
also allows selecting fields of the EventType that will be contain ed in the Event such as EventId,
EventType, SourceNode, Time and Description.”

Section 5.12.1.4
“Each time a MonitoredItem is sampled, the Server evaluates the sample using the filter defined for
the MonitoredItem. The filter parameter defines the criteria that the Server uses to determine if a
Notification should be generated for the sample. The type of filter is dependent on the type of the
item that is being monitored. For example, the DataChangeFilter and the AggregateFilter are used
when monitoring Variable Values and the EventFilter is used when monitoring Events. Sampling
and evaluation, including the use of filters, are described in this standard. Additional filters may be
defined in other parts of this series of standards.”

Section 7.17.3
“The EventFilter provides for the filtering and content selection of Event Subscriptions.
If an Event Notification conforms to the filter defined by the where parameter of the EventFilter,
then the Notification is sent to the Client.
Each Event Notification shall include the fields defined by the selectClauses parameter of the
EventFilter.”

Section 7.20.3 for the event notification format
“EventNotificationList structure Event Notification data.
events [] EventFieldList The list of Events being delivered. This structure is defined in-line with the
following indented items.
clientHandle IntegerId Client-supplied handle for the MonitoredItem. The IntegerId type is defined in
7.14.
eventFields [] BaseDataType List of selected Event fields. This shall be a one to one match with the fields
selected in the EventFilter.
7.17.3 specifies how the Server shall deal with error conditions.”

i.e. it is impossible to provide the event notification data without the filter (as it determines what is sent and in which order, this info is not repeated in the notification, it is just data in the same order), and thus it is required.

P.S. For others Attributes null works, also the above explains the 2 other filters only work on Value Attribute, for others than Value/EventNotifier, it must be null.

P.S.2. In one sense this is an issue that the error message given could be better

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 1919

Currently Online:
15 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: 728

Moderators: 7

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1529

Posts: 6471

Newest Members:

ellis87832073466, zkxwilliemae, gabriellabachus, Deakin, KTP25Zof, Wojciech Kubala, efrennowell431, wilfredostuart, caitlynfajardo, jeromechubb7

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

Administrators: admin: 1