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 createMonitoredItems not performant
March 22, 2024
2:15, EET
Avatar
ahamad1
Member
Members
Forum Posts: 5
Member Since:
March 22, 2024
sp_UserOfflineSmall Offline

I’m extending SubscriptionServiceHandler and overriding the following ,method
protected void createMonitoredItems(ServiceContext sc, CreateMonitoredItemsRequest cmiReq,
CreateMonitoredItemsResponse cmiRes, List readValueIds, List moniterDataItems)
throws ServiceException

The problem is when I call super (before I extend its functionality further) it takes long time to finish and hence I see timeouts on the client (around 10 seconds per 50 items)

Is there a specific reason for that and how can I fix it?

March 22, 2024
10:53, EET
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 983
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

What version of the SDK you are using?

Extending the XXXServiceHandlers would typically be a very advanced use-case (basically if nothing else works). May I ask what are you trying to do? In general if you are just starting to use the SDK I would not recommend overriding anything protected unless instructed by us.

That being said, by default the items get their initial value via read. If that takes too long (but I would say 10 seconds is sort of on the low side for a timeout, our UaClient has by default 30s), that can be changed by overriding com.prosysopc.ua.server.IoManager.initializeMonitoredDataItem(ServiceContext, MonitoredDataItem, DataValue) and making the method body empty (do not call super). And yes, in this case you would need to extend IoManager or IoManagerUaNode (if NodeManagerUaNode) and set it via NodeManager.setIoManager(IoManager). After this it is probably a lot faster, though the clients will then see Bad_WaitingForInitialData StatusCode in the first notification (which in general clients should be able to handle).

Alternatively you can try to see if there are bottlenecks when value is read for the items.

March 22, 2024
18:23, EET
Avatar
ahamad1
Member
Members
Forum Posts: 5
Member Since:
March 22, 2024
sp_UserOfflineSmall Offline

Hi,

I use 4.5.4-1405

When new items are added we subscribe to live data from a socket service and when we receive data we send it the client. We need to do that in batches otherwise we get performance issues. So we extend SubscriptionServiceHandler and override createMonitoredItems

As far as I have seen, the timeout logs appear in the client after 10 seconds from calling super.createMonitoredItems.

The solution you suggested works perfectly. I don’t need to read initial value because our socket will send it after subscribe. Thanks for the help.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
10 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: 682

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1467

Posts: 6261

Newest Members:

karrimacvitie5, graciela2073, sagarchau, elviralangwell4, Donnavek, Eddiefauth, DonaldPooma, fidelduke938316, Jan-Pfizer, DavidROunc

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