12:31, EEST
June 2, 2019
Hello,
So I am testing an OPC UA server with the testing application written using prosys SDK. in java.
We have the server address space modelled in a way, that all the analog signals( moving signals) are placed under a sepcific folder.
Currently, we have 32 such signals. We monitor all of them and add them all under a subscription Sampling period is 250ms.
Now if i start subscription and pause for 5 seconds, and then have a count of the listener values it shows 428.
I am not undestanding how is it happening. Especially the math,
Conisdering 32 signals == 32*4(1second)*5(for seconds sleeping) = 640
This was confusing, so I added al those signals to the UAExpert data view,I see only 22 signals are changing. So, even if I do 22*20 = 440.
Is the mathematical approach correct with subscriptions? Queue Size= 2, discardOld = True.
Also I get ‘Got Bad_NoSubscription as a PublishResponse, although we have connected Subscriptions’. How do I go about this?
13:21, EEST
April 3, 2012
Hi,
It is in practice not possible to mathematically/deterministically know how many datachanges there will be (without knowing the server internals and how often the data changes for the server etc.), since the notifications are only sent if it matches a configured filter (or a default logic defined in the OPC UA Specification, if none set).
For example, if the data would not change on the server, you wouldn’t get any notifications (other than the initial values + keepalive-notifications after that). There is not a filter that would always send the data even if it would not change.
The following things (+others, but can be ignored here, at least for now) influence the number of notifications:
– PublishInterval of the Subscription
– SamplingInterval of the items added to Subscription
– Queue size of the items
– DataChangeFilter of the items
– How often and how/when the actual data on the server changes
– Timings when of adding the Subscription and items might influence a bit, depending on the server.
– In what way the server does sampling internally
– How often and how many PublishRequests the client sends (in general, this should be ignoreable in most cases related to our SDK; since we send one more immediatel when we receive one and we do send few of them at the start; but not immediately if an error was received i.e. the Bad_NoSubscription _might_ affect)
UaExpert data view would seem to use PublishInterval of 1000 (ms) and SamplingInterval of 250 (ms) for the items (and the default queuesize is 1). The Default DataChangeFilter is “not set”, which means the Trigger will be Status or Value change (but not timestamp).
Our (java) SDK’s defaults (the 0-args constructor) for Subscription is also 1000ms PublishInterval. For MonitoredDataItem SamplingInterval is -1, which means the PublishInterval setting is used for that (so 1000ms). The DataChangeFilter is null, thus the same as in UaExpert.
A PublishInterval of 1000 and queuesize 2 would mean only 2 changes at max per interval could be sent. Did you also set the PublishInterval to 250ms?
Thus I would need to know most of the above in more details to say any better. Also did you check with UaExpert the same exact time as the client made with our SDK? Because like, maybe the data did change differently (e.g. internal value was the same and no timestamp in the datachange trigger thus no change was sent since the default trigger only sends if status or value changes)?
Also, what were the MaxKeepAlive and LifetimeCount parameters of the Subscription?
Also, I would need to know the SDK version, since e.g. the Bad_NoSubscription logging conditions have changed. But assuming you have at least 3.2.0, that INFO level log appears if a PublishResponse has that as service level error code AND in the client side we have at least one Subscription that has not been considered keepalive-timeouted. Did you see this when disconnecting the client or removing a Subscription or in some other situation?
13:50, EEST
April 3, 2012
I should also add, that the PublishInterval, MaxKeepAlive and LifetimeCount of a Subscription + the SamplingInterval of MonitoredItems are requests to the server, it is allowed to revise them to other values: https://reference.opcfoundation.org/Core/docs/Part4/5.12.2/ https://reference.opcfoundation.org/Core/docs/Part4/5.13.2/. While most likely most servers should accept e.g. 1000 and 250, some might not, if they would have e.g. fixed publishinterval + samplinginterval “loops of fixed time” (like e.g. a µController interupts with timers etc.).
14:44, EEST
June 2, 2019
Hi Bjarne,
First of all, thank you so much for the detailed explanation. I really appreciate it.
Answering your questions: 1) yes the publishing interval is same as sampling interval.(250 ms)
2)MaxKeepAlive and LifetimeCount parameters have not been modified at all. They should be the default
3)Using the prosys-opc-ua-sdk-client-4.1.0-868 version.
4) Log is seen when I remmove the subscription
15:32, EEST
April 3, 2012
1. Ok, I guess then I need to know if the server is made with our (java) SDK or is it something else (per your 3. answer I think it is not). Anyway, the way our server side handles things might differ a bit what might be generally done, but we pretty much emulate what should happen (i.e. we do not exactly “really sample” there, since the data is typically in the UaNode objects, so we instead calculate to which sampling interval a value change should be).
Thus then we would need to know how often the data really changes in the server and can it change to the same value (e.g. let’s say the data would be a temperature sensor, it could be constant for long times). For the default/null only-status-and-value-changed trigger, you would only get a single notification of that (the initial value). If you want the notifications also from status-value-and-timestamp changes, use code explained in https://forum.prosysopc.com/forum/opc-ua-java-sdk/datachange-notification-when-value-doesnt-change/#p4265 and put that to the item (preferably before adding it to the subscription).
2. Hmm.. maybe here it wont matter, but in general the MaxKeepAliveCount and LifetimeCounts typically should change if the PublishInterval is changed. Or like, it depends, in this case with 250 it might not matter. The periods for keepalive sending and lifetimecount (after which the server deletes the subscription if no PublishRequest has arrived which could be used to send a keepalive if no data has changed) are multiples of the publishinterval. So e.g. if the PublishInterval was set to 100 while keeping our default 20 for the maxkeepalive it would be only 2 seconds before a keepalive would be sent. And with 60 then the lifetime would be 6s. If connection is stable etc. no problem, but if there is a connection break then basically if it would be larger than ~6 seconds the subscription would have been deleted on the server.
3. Ok, then there shouldn’t be anything affecting this directly in the newer versions: https://downloads.prosysopc.com/opcua/Prosys_OPC_UA_SDK_for_Java_4_Release_Notes.html, but in general we do of course recommend updating to the latest version.
4. Then I think you can ignore that error code. It might be a race condition, but basically that is what server would most likely send back for the remaining PublishRequest we have queue’d there. It is possible that it returned them faster than we could locally handle the remove operation. Technically we do call the DeleteSubscriptions service call before we remove the Subscription from local list and the responses are handled in a separate thread, thus most likely the response arrived before we did the remove. Should most likely be done better, but shouldn’t impact anything (other than the log).
Most Users Ever Online: 1919
Currently Online:
29 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_galleryModerators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1032, Jimmy Ni: 26, Matti Siponen: 349, Lusetti: 0
Administrators: admin: 1