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
Method call order not respected
April 10, 2018
12:14, EEST
Avatar
Xavier
Member
Members
Forum Posts: 43
Member Since:
March 26, 2014
sp_UserOfflineSmall Offline

Hi,

I created nodes using UaModeler and the Codegen tool. Some nodes have methods.
I call these methods using a C++ SDK.

I have noticed that if the methods are called in synchronous mode, it’s working well.
If I call the same methods in asynchronous mode and fast, then the method implementations are not always called in the right order. For instance if my node has 3 methods A, B and C and If I call them in this order almost at the same time, in the server implementation it can be B, C then A.

Using Wireshark I can see that the method are called in the right order on the network, but also that all the calls are in the same OPC-UA packet.

I believe this is multithreaded for performance reasons but is there a way for me to keep the calling order?

Thanks,

April 10, 2018
15:38, EEST
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1010
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

Yes, the Java stack uses the internal thread pool to handle each service request separately. And this in practice makes it probable that the order of the actual handling time in your application is random, if the messages arrive at the same time.

I assume that you are making a separate CallRequest for each method from the client application. If you would make a single CallRequest, containing all methods in the order that you wish them to be executed, it should work better: in this case the server should handle the request in one thread and execute the method calls in the original order.

That said, I am not quite sure how you should make a CallRequest with several method calls in it with the Unified Automation C++ SDK. UaSession.beginCall seems to take just one method as an argument…

April 10, 2018
17:03, EEST
Avatar
Xavier
Member
Members
Forum Posts: 43
Member Since:
March 26, 2014
sp_UserOfflineSmall Offline

Thank you for the confirmation and the suggestion, I think I will try this in the future.

But I also found out that in the server side the “serviceContext.getTimestamp()” is set somewhere, I believe in the caller stack, and it seems to be really precise. I can make 300 async calls in less than 4 ms but they all have a different (and right) timestamp.

This allows me to be OK in my use case (I can just ignore older requests).

So in this case if I receive B A C, I know I can ignore A because its timestamp is older than the one of B.

April 10, 2018
17:52, EEST
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1010
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

Very good.

Actually, there is UaSession.callList, which can call several methods at the same time – but there is no async version of that available at the moment.

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

Ibrahim: 76

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

fred: 41

Member Stats:

Guest Posters: 0

Members: 681

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1467

Posts: 6261

Newest Members:

graciela2073, sagarchau, elviralangwell4, Donnavek, Eddiefauth, DonaldPooma, fidelduke938316, Jan-Pfizer, DavidROunc, fen.pang@woodside.com

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

Administrators: admin: 1