7:51, EET
January 30, 2014
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
8:27, EET
April 3, 2012
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
9:59, EET
January 30, 2014
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
11:21, EET
April 3, 2012
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.
6:32, EEST
January 30, 2014
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
Most Users Ever Online: 1919
Currently Online:
14 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: 731
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1529
Posts: 6471
Newest Members:
inilarythikibia, rickykennion, PromotionToold, HypromeImpupe, toneylapham544, rondawolinski7, Marypof5711, roycedelargie91, kourtneyquisenbe, ellis87832073466Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1032, Jimmy Ni: 26, Matti Siponen: 349, Lusetti: 0
Administrators: admin: 1