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
Element of array as MonitoredDataItem
March 24, 2015
7:51, EET
Avatar
gjevremovic
Member
Members
Forum Posts: 49
Member Since:
January 30, 2014
sp_UserOfflineSmall Offline

Hi,

is it possible to create MonitoredDataItem for each array’s element?
This question is related to non-legacy mode for arrays. I don’t have NodeId of each array’s element
which is necessary for MonitoredDataItem constructor.
The goal is to read array’s elements via
onDataChange(Subscription subscription, MonitoredDataItem item, DataValue newValue)

BR,
Goran

March 24, 2015
8:27, EET
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 983
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

What you mean by non-legacy mode for arrays?

You can call MonitoredDataItem.setIndexRange before adding the MonitoredDataItem to Subscription (it should work after also, but then the server needs to change it’s own items so safer to do before). You need to know which indexies to monitor though.

Another question is how wise this is. If the array is small and fixed size, then it should be ok, but I wouldn’t do this for just the sake of knowing the index to item mapping instead of checking the new value for changes to specific indexies (Since each item creates server side items also, depending of course on server implementation but still).

– Bjarne

March 24, 2015
9:59, EET
Avatar
gjevremovic
Member
Members
Forum Posts: 49
Member Since:
January 30, 2014
sp_UserOfflineSmall Offline

Thanks for answer.
If opcua server is in legacy mode than each array element has its own NodeId. In non-legacy mode we don’t have NodeId of elements, only NodeId for array.
That is how I see arrays in Beckhoff OPCUA server. I guess it is general concept at server side for arrays.
Yes, my plan is to do setIndex before subscription.
I am not sure that I understood well “If the array is small and fixed size, then it should be ok, but I wouldn’t do this for just the sake of knowing the index to item mapping instead of checking the new value for changes to specific indexies”.
Do I have another solution if I want to listen value changes of one array’s element?
BR,
Goran

March 27, 2015
11:21, EET
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 983
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hmm this is the first time I have heard the term legacy mode. However there is an ExposesItsArray ModelllingRule in UA which indicates that each array element should be exposed as a single value/node as a sub-node for the node having the array. If the VariableType has that rule, then there should be subnodes – otherwise not (or at least there is no guarantee)

“I am not sure that I understood well “If the array is small and fixed size, then it should be ok, but I wouldn’t do this for just the sake of knowing the index to item mapping instead of checking the new value for changes to specific indexies”.
Do I have another solution if I want to listen value changes of one array’s element?”
The answer to that depends on a number of factors:
Is the array fixed or changing size?
How big the array is?
How big is an individual value in the array (i.e. is it int32 or Structures)
Are you interested in every index or just some?
Do all indexies change at the same time or independent of each other?
Do you want to save server memory / processing power / network bandwith or code complexity?

But I would start e.g. by subscribing to the whole array and then checking onDataChange events if the indexies you are interested in have changed.

April 1, 2015
6:32, EEST
Avatar
gjevremovic
Member
Members
Forum Posts: 49
Member Since:
January 30, 2014
sp_UserOfflineSmall Offline

Hi Bjarne,
thanks, I got the point for pros and cons of subscribing to known array element. Related to server side questions I don’t have answers as my client should connect to many kinds of opcua servers not particular one. And client side (HMI) is pretty locked with reading concept. So I guess for some servers will work ok and for some will have slight performance downgrade. But if downgrade is significant than client side will need optimization for that target.
BR,
Goran

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
17 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

TimK: 41

Member Stats:

Guest Posters: 0

Members: 682

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1467

Posts: 6261

Newest Members:

digitechroshni, LouieWreve, Kickbiche, karrimacvitie5, graciela2073, sagarchau, elviralangwell4, Donnavek, Eddiefauth, DonaldPooma

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