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
Subscription for a MonitoredDataItem Query
July 21, 2017
10:53, EEST
Avatar
Sumit
Member
Members
Forum Posts: 9
Member Since:
July 11, 2017
sp_UserOfflineSmall Offline

I am novice in this world, so please excuse for any question which may have an obvious simple answers.

I have an OPC Client Java App based on ProSys and it is initiating connection to the OPC UA server by ProSys. I have attached a UAClientListener with the client and also added subscription by providing MonitoredDataItem for items lets say Counter1 ( simulated on server). Also while creating Subscription a SubscriptionNotificationListener also attached.

Few questions:
1) What would be the data flow for subscribed data ? Currently after looking into logs, it looks OPC UA Client sending frequent PublishRequest to Server for probably subscribed data and once PublishingInterval reaches, client receives response as part of request sent to Server. Though request not reaching to server as per Server Logs so may be Client just logging it and not sending to server until PublishingInterval reaches. So please provide input on this analysis as well. Also I used to think, Server would automatically send data back to Client once PublishingInterval reaches like a call back mechanism instead of Client requesting server. Please clarify.

2) In continuation of point 1, data is being processed by UaClientListener::validatePublishResponse method. This is again a surprise to me as it should have been processed by SubscriptionNotificationListener (probably by onNotificationData method). Please guide.

Thanks in advance !
-Sumit

July 21, 2017
11:21, EEST
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1026
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

Thanks for good questions.

1. OPC UA does not implement direct call backs in practice, because that would require another network connection to be opened from the server to the client, which complicates the security settings, for example, too much.

Instead, there is a “polling” mechanism that actually provides the same results. The client application is sending PublishRequest messages to the server, which the server can then use whenever it needs to send a NotificationMessage (with data change or event notifications) back to the client. At that point, the server will send a PublishResponse corresponding to one of the PublishRequests sent earlier by the client.

2. UaClientListener.validatePublishResponse enables your client application to verify the PublishResponse message, in case there is something that you wish to do. In normal circumstances, you can ignore this and simply use the SubscriptionNotificationListener or MonitoredDataItemListener (or MonitoredEventItemListener) to handle the data changes (or events). MonitoredDataItemListener is plugged into individual MonitoredDataItem instances (but you can use the same listener) and provides you even simpler way to handle the individual data changes than SubscriptionNotificationListener.

July 21, 2017
12:25, EEST
Avatar
Sumit
Member
Members
Forum Posts: 9
Member Since:
July 11, 2017
sp_UserOfflineSmall Offline

Thanks for clarifying 1st point.
On 2nd point, Does this mean if i remove UaClientListener from UAClient, SubscriptionNotificationListener or MonitoredDataItemListener will start come into play ?

July 21, 2017
14:40, EEST
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1026
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

They are totally independent of each other. Except, of course, that if you return ‘false’ from the UaClientListener.validatePublishResponse()-method, you will not get any notifications to the other listeners.

July 22, 2017
15:32, EEST
Avatar
Sumit
Member
Members
Forum Posts: 9
Member Since:
July 11, 2017
sp_UserOfflineSmall Offline

Thanks i got my mistake. I am returning false validatePublishResponse() method due to which it is not getting processed by any other listener. Copy paste mistakes 🙂 .

Forum Timezone: Europe/Helsinki

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: 730

Moderators: 7

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1529

Posts: 6471

Newest Members:

toneylapham544, rondawolinski7, Marypof5711, roycedelargie91, kourtneyquisenbe, ellis87832073466, zkxwilliemae, gabriellabachus, Deakin, KTP25Zof

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

Administrators: admin: 1