Avatar
Please consider registering
guest
sp_LogInOut Log Insp_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 RSSsp_TopicIcon
Array with size 1 possible?
June 15, 2016
10:35, EEST
Avatar
Ibrahim
Member
Members
Forum Posts: 78
Member Since:
August 20, 2014
sp_UserOfflineSmall Offline

Hi,
is it possible in OPC UA to read an array of size 1? We had the problem that a Siemens PLC was upgraded with the Simatic Server to OPC UA. Inside the PLC programm it is possible (and sometimes necessary) to create arrays of size 1. Those arrays were no longer arrays in OPC UA and the Java SDK didn’t recognize them as arrays, but as primitive variables.
Question: Is it even possible to read an arrays of size 1?

Thanks

Ibrahim

June 15, 2016
12:45, EEST
Avatar
Heikki Tahvanainen
Member
Members
Forum Posts: 402
Member Since:
April 17, 2013
sp_UserOfflineSmall Offline

Hello,

Yes, it’s possible to have arrays of size 1 in OPC UA.

In OPC UA, array data types are defined by DataType, ValueRank and ArrayDimensions attributes. As a first step, you should see what values these attributes contain.

June 15, 2016
15:03, EEST
Avatar
Ibrahim
Member
Members
Forum Posts: 78
Member Since:
August 20, 2014
sp_UserOfflineSmall Offline

Hi,
thanks for the quick answer.
I checked the mentioned variable again and its attributes. This are the values:
DataType: Int32
ValueRank: 1
ArrayDimensions: UInt32 Array[1] –> [0] 1

But the strange thing is, that if i call “…isArray()” on this NodeId, i get false… What could be the reason for this? I also tried to write a primitive int value into this NodeId and it worked fine.

Thanks
Ibrahim

June 15, 2016
16:07, EEST
Avatar
Heikki Tahvanainen
Member
Members
Forum Posts: 402
Member Since:
April 17, 2013
sp_UserOfflineSmall Offline

Hello,

Thank you for the reply. The node attributes have sensible values.

It seems like the server responds with scalar values even though array values should be used. This seems like a purely server side issue, the client SDK should not modify the received values in any way. Also, writing scalar value to this node should fail because the supplied value is not of the same type as the attribute’s value. This check should be done in the server application. You should inform the server vendor about these issues.

Please let us know if you have further comments or questions about this.

Forum Timezone: Europe/Helsinki
Most Users Ever Online: 1919
Currently Online:
Guest(s) 27
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Heikki Tahvanainen: 402
hbrackel: 144
rocket science: 90
pramanj: 86
Francesco Zambon: 83
Ibrahim: 78
Sabari: 62
kapsl: 57
gjevremovic: 49
Xavier: 43
Member Stats:
Guest Posters: 0
Members: 734
Moderators: 8
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1545
Posts: 6521
Newest Members:
wilfredoforeman, ptdenriqueta, basilpullman, Richardmip, mood edibles, LouieWreve, daniellabdx, janessan21, sammiebeak359, gena7127517
Moderators: Jouni Aro: 1029, Pyry: 1, Petri: 1, Bjarne Boström: 1047, Jimmy Ni: 26, Matti Siponen: 353, Lusetti: 0, Elias: 0
Administrators: admin: 1