Support of subscription queue in client

59 views
Skip to first unread message

Евгений Хорев

unread,
Oct 1, 2021, 10:50:16 AM10/1/21
to open62541
Hi!

I'm struggling to receive the whole queue, but receiving just one value.

I'm using UA_Client_MonitoredItems_createDataChange function to create monitored items, but callback, which is being set here, is triggered only once on publish interval, and the value received in its arguments is scalar.

Am I doing something wrong?

Here is what I am doing:

UA_MonitoredItemCreateRequest mon_request = UA_MonitoredItemCreateRequest_default(node_id);

mon_request.requestedParameters.samplingInterval = sampling_interval;

mon_request.requestedParameters.queueSize = queue_size;

UA_MonitoredItemCreateResult mon_response = UA_Client_MonitoredItems_createDataChange(client, subscriptionId, UA_TIMESTAMPSTORETURN_NEITHER, mon_request, nullptr, variable_value_changed, nullptr);

Евгений Хорев

unread,
Oct 1, 2021, 11:31:08 AM10/1/21
to open62541
I'm using open62541 v1.1.2

пятница, 1 октября 2021 г. в 16:50:16 UTC+2, Евгений Хорев:

Julius Pfrommer

unread,
Oct 1, 2021, 3:33:43 PM10/1/21
to open62541
Hey Jevgenij,

so that we can help you, please name

  • sampling interval of the MonitoredItem
  • publishing interval of the Subscription
  • the queue size of the MonitoredItem

Regards, Julius

Евгений Хорев

unread,
Oct 2, 2021, 10:12:17 AM10/2/21
to open62541
Hey Julius,

for testing purposes I'm setting
  • sampling interval of the MonitoredItem to 1000 ms
  • publishing interval of the Subscription to 3000 ms
  • the queue size of the MonitoredItem to 3
So I expect to get 3 values on every 3000 ms.
пятница, 1 октября 2021 г. в 21:33:43 UTC+2, julius....@gmail.com:

Julius Pfrommer

unread,
Oct 2, 2021, 10:53:06 AM10/2/21
to open62541
That depends. How often do you update the variable?
Only changes are reported. And you configured to not include timestamps.
So only "actual value changes" are reported.

Евгений Хорев

unread,
Oct 2, 2021, 12:40:44 PM10/2/21
to open62541
Ok, I checked the monitoring items settings and found a hardly noticible typo in my code.
Thanks for the point!
Now I'm receiving the values for the whole queue.

But some other difficulties have emerged,
since I need to split the incoming data stream into rows of records in the database.
Which was easy while queueSize was set to 1.

1. How to understand which received variable values belong to which sample (row in the queue)?
My variables have changed 3 times and I am getting values sequentially for variables v1, v2, v1, v2, v1, v2.
This situation is simple, the data obtained can be easily divided into samples: v1, v2 | v1, v2 | v1, v2.
But imagine that the values of some variables change only occasionally: v1, v2, v3, v1, v2, v1, v2.
Now the division into samples is ambiguous:
v1, v2, v3 | v1, v2 | v1, v2
or
v1, v2 | v3, v1, v2 | v1, v2.
Is a timestamp what is needed to solve this problem?

2. Is it possible to somehow know where the end of the data transfer is? Which of the callback triggers is the last one for the publishing interval?

Thanks for your answers!
суббота, 2 октября 2021 г. в 16:53:06 UTC+2, julius....@gmail.com:
Reply all
Reply to author
Forward
0 new messages