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: 1009
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: 1009
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: 518

Currently Online:
18 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 135

pramanj: 86

Francesco Zambon: 81

rocket science: 75

ibrahim: 75

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

fred: 41

Member Stats:

Guest Posters: 0

Members: 709

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1465

Posts: 6252

Newest Members:

christi10l, ahamad1, Flores Frederick, ellenmoss, harriettscherer, shanonhumphreys, KupimotoblokfuB, tamhollander5, paulinafcf, bridgette18l

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

Administrators: admin: 1