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
HistoryManagerListener onReadEvents
May 8, 2023
13:50, EEST
Avatar
Francesco Zambon
Member
Members
Forum Posts: 83
Member Since:
December 20, 2021
sp_UserOfflineSmall Offline

Good morning,

Please i need clarification regarding the method

HistoryManagerListener
public Object onReadEvents(ServiceContext serviceContext, Object operationContext, NodeId nodeId, UaNode node,
Object continuationPoint, DateTime startTime, DateTime endTime, UnsignedInteger numValuesPerNode,
EventFilter filter, HistoryEvent historyEvent) throws StatusException

Can an OPC UA client make multiple requests at the same time?
Is it possible to identify the client’s request?

Thanks,
Francesco.

May 8, 2023
14:55, EEST
Avatar
Matti Siponen
Moderator
Members

Moderators
Forum Posts: 346
Member Since:
February 11, 2020
sp_UserOfflineSmall Offline

Hello,

It is possible for an OPC UA Client to make multiple requests at the same time.

What do you mean with “Is it possible to identify the client’s request?”? Can you provide some context for this question? What type of identifying information are you expecting and what would you do with that information?

May 10, 2023
15:42, EEST
Avatar
Francesco Zambon
Member
Members
Forum Posts: 83
Member Since:
December 20, 2021
sp_UserOfflineSmall Offline

Dear Matti,

I’ll answer your questions below:

“Can you provide some context for this question?”
I would like to save the results of the search that the user has done to a cache.
For example, if the results of the search performed are 1000 records and if the maximum number of results that can be returned is 100 (numValuesPerNode), the client will have to perform 10 requests, according to continuationPoint.
I cannot use “continuationPoint” and “numValuesPerNode” as sql parameters (LIMIT, OFFSET).

“What type of identifying information are you expecting and what would you do with that information?”
I need the ID of the “transaction”. The session identifier is not unique because multiple event history requests could be made for the same session at the same time.

This improvement is not urgent, I would like to know if it was possible to identify the client requests.

Thanks,
Francesco.

May 10, 2023
17:48, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 1026
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

If you can hold the values in memory, you can store them in the continuation point. The continuationpoint you give (return) is NOT the one the SDK will give to the Client. SDK will give a numeric one to the client and internally tracks the continuationpoint and gives it back to you (the parameter) when the client continues. If it still continues, modify the continuationpoint (return new one) with this info so you know then new starting point for the 3rd call.

Thus, if you are not given a continuationpoint by the SDK, it is a “new” HistoryRead call by the client and it should start from the first value. If there is a continuationpoint, then it continues. And technically you can have more than one “HistoryRead” active at the same time. There is a limit of concurrent continuationpoints and client can see this, but skipping rest of the details for now. So in short the continuationpoint (a custom java object, anything you like) must contain all the info to continue the HistoryRead.

Or maybe we missed/misunderstood something? If you meant the literal “what to return”, then it is the EventFilter that tells which data should be returned (you can look at the sampleconsoleserver, but it is somewhat simple example and we do not have any complex ones).

May 10, 2023
17:53, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 1026
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

So, for example you can make a java object with 2 fields and have them be the LIMIT, OFFSET (of the next call) and return this from the method.

May 12, 2023
12:46, EEST
Avatar
Francesco Zambon
Member
Members
Forum Posts: 83
Member Since:
December 20, 2021
sp_UserOfflineSmall Offline

Dear Bjarne,

Thank you very much.
I figured out that I can exploit the object ContinuationPoint

@Override
public ->Object<- onReadEvents(ServiceContext serviceContext, Object operationContext, NodeId nodeId, UaNode node,
->Object continuationPoint<-, DateTime startTime, DateTime endTime, UnsignedInteger numValuesPerNode,
EventFilter filter, HistoryEvent historyEvent) throws StatusException {

to save search results that have not yet been sent to the client.

Best regards,
Francesco.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 1919

Currently Online:
22 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: 734

Moderators: 7

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1523

Posts: 6449

Newest Members:

christamcdowall, redaahern07571, nigelbdhmp, travistimmons, AnnelCib, dalenegettinger, howardkennerley, Thomassnism, biancacraft16, edgardo3518

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

Administrators: admin: 1