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
Cannot use the individual elements of the array
December 13, 2022
14:57, EET
Avatar
Oleksandr
Member
Members
Forum Posts: 22
Member Since:
February 14, 2020
sp_UserOfflineSmall Offline

Hello.
On an OPC UA server, the arrays are displayed when browsing, but I cannot use the individual elements of the array, only the entire, completely array.
Is it on the OPC UA server settings or can I set it on the client side?

Thanks in advance for the support
Oleksandr

December 13, 2022
16:30, EET
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 877
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

Can you be more exact in how they “cannot be used”? Preferably give the answer as code using the SDK instead of a more written explanation.

This is a topic that can be confusing because some servers have their custom logic, e.g. some servers have String-NodeIds that have the “array brackets” i.e. ‘[‘ ‘]’ as part of the NodeId, but in there they are just normal characters (like ‘a’) of a String as part of a NodeId, not any “special array accessor syntax” like you would use in code (basically it is a separate node, with linked data, how exactly it is done in the server implementation it is outside of the spec).

OPC UA does have an array-accessor logic, but it is made to the main, “full-array-node” by specifying an IndexRange as part of the Read/Write call.

December 16, 2022
11:22, EET
Avatar
Oleksandr
Member
Members
Forum Posts: 22
Member Since:
February 14, 2020
sp_UserOfflineSmall Offline

Thanks for the answer.
This is an OPC UA KepServer.
In UA Expert I can only read and write the entire array, but I cannot read individual elements.
Although with the other OPC UA server I can read and write both the entire array and the individual elements of the array.

December 16, 2022
13:23, EET
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 877
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Please explain how you do access “…the individual elements of the array..” on this “other server”? And would this other server happen to be made by Siemens?

December 16, 2022
14:09, EET
Avatar
Oleksandr
Member
Members
Forum Posts: 22
Member Since:
February 14, 2020
sp_UserOfflineSmall Offline

yes that is exactly PLC OPC UA Server Siemens.
I can click and drag some array element to Date Access View and read/write there.

December 16, 2022
14:35, EET
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 877
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Basically that is a custom logic made by Siemens, not part of the OPC UA Specification. Like it is OK per se: no specification rules are broken via this logic, but it is not something you should expect from any server by default. I do not know if KepServerEX supports this, you must ask them.

Our own SDKs do not support this automatically either (you could make such somewhat with manual work though).

Any server is free to expose the array elements as nodes, but the spec doesn’t specify how. There exists an ExposesItsArray ModellingRule, https://reference.opcfoundation.org/Core/Part3/v105/docs/6.4.4.4.3, but it specifically even states: “The BrowseNames of those instances are not defined by the ModellingRule. In general, it is not possible to get a Variablerepresenting a specific entry in the array (e.g. the second). Clientswill typically either get the array or access the Variablesdirectly, so there is no need to provide that information.”

Technically nodes can do the exposing without the modelling rule (it is just data and nodes), but the point was to basically say there is no specified rules that how it is to be done, if at all (though, for a node using the modellingrule ExposesItsArray it must be done, but it is unspecified how). I suspect one reason is that the OPC UA Diagnostic model has a weird array node whose exposed elements are nodes that are part of a larger TypeDefinition, thus their BrowseNames are locked by the TypeDefinition already thus they cannot be changed (so every array element has identical BrowseName, this too is allowed).

So basically Siemens have just chosen to use String NodeIds, and make subnodes whose NodeId is the “parent+[index]”, or something like that, but OPC UA wise the NodeId there is just raw String characters data i.e. a NodeId with e.g. “parent[idx” (without closing ‘]’) would be as valid of a NodeId as this one is, i.e. it is purely server side implementation specific how it interprets the NodeId.

The only “OPC UA Way” to access a subselection of an array is to use an IndexRange, but I do not know if that is possible with UaExpert. Our Browser application doesn’t support it (though maybe we should add it at some point). With the SDK you can set it as part of Read/Write and MonitoredDataItem (call setIndexRange before adding the item to the Subscription), though this will only work if the server supports this.

P.S.
Also, there might be some additions in 1.05 regarding Structures, but I will look that later.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
8 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 124

pramanj: 86

ibrahim: 74

rocket science: 65

kapsl: 57

Sabari: 51

gjevremovic: 49

Xavier: 43

fred: 41

TimK: 41

Member Stats:

Guest Posters: 0

Members: 684

Moderators: 15

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1335

Posts: 5711

Newest Members:

daniel.boada@soprasteria.com, Ratheesh, Dustingen, janessawhittell, ravi_prabhakar, dustyy137676428, Douglasabibe, DonaldWibip, kennithmazza4, Heiko Geissler

Moderators: Jouni Aro: 963, Otso Palonen: 32, Tuomas Hiltunen: 5, Pyry: 1, Petri: 0, Bjarne Boström: 877, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Jimmy Ni: 25, Teppo Uimonen: 21, Markus Johansson: 42, Niklas Nurminen: 0, Matti Siponen: 230, Lusetti: 0

Administrators: admin: 1