15:23, EEST
August 29, 2018
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
15:58, EEST
April 3, 2012
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.
11:45, EEST
August 29, 2018
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
12:47, EEST
April 3, 2012
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
Most Users Ever Online: 1919
Currently Online:
17 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: 735
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1523
Posts: 6449
Newest Members:
rust, christamcdowall, redaahern07571, nigelbdhmp, travistimmons, AnnelCib, dalenegettinger, howardkennerley, Thomassnism, biancacraft16Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1026, Jimmy Ni: 26, Matti Siponen: 346, Lusetti: 0
Administrators: admin: 1