11:50, EET
January 30, 2014
15:59, EET
December 21, 2011
client.readValue(arrayVariableId, new NumericRange(1));
// Read elements #1-#3 of the one-dimensional array
client.readValue(arrayVariableId, new NumericRange(1, 3));
// Read elements #1-#2/#2-#3 of the two-dimensional array
client.readValue(arrayVariableId, new NumericRange(new int[] { 1, 2 },
new int[] { 2, 3 }));
I think the spec. defines that indexes start from 1.
15:17, EET
January 30, 2014
8:37, EET
December 21, 2011
Yes, it was improved – or written properly in SDK 2. Also the server side is properly supporting array indexing now.
The server should provide only the elements that are requested, if you use an IndexRange. The array elements can also be provided as individual variables with specific NodeIds, if you wish.
9:51, EET
November 18, 2014
Hi,
I have an OPC UA Server that has nodes with arrays of Int16 elements.
When I try to use SDK 2 and method from UaClient with signature writeValue(NodeId nodeId, Object value, NumericRange indexRange),
I get an error stated below:
at com.prosysopc.ua.client.UaClient.a(Unknown Source)
at com.prosysopc.ua.client.UaClient.writeAttribute(Unknown Source)
at com.prosysopc.ua.client.UaClient.writeValue(Unknown Source)
My code had an intention to update values of some range of elements in an array:
NumericRange range = new NumericRange(1, 2); // second and third element in an array
Short[] newValues= new Short[2];
newValues[0] = 21;
newValues[1] = 22;
client.writeValue(nodeId, newValues, range);
Is there a solution for this problem (updating values of some elements in an array)?
11:32, EET
December 21, 2011
15:26, EET
November 18, 2014
Jouni Aro said
That sounds more like a problem in the server, which is giving the error.
I understand that the server is not able to process the request, but there are two more things that are strange:
1. Through UaExpert client it is possible to change the values for arbitrary elements in array on problematic server.
2. Using Prosys OPC-UA and the same code I am able to write values in array’s elements, on OPC UA C++ Demo Server (from Unified Automation).
3. I am able to write other simple data type values with no problem, on both demo server and the other one.
Is it possible that Prosys library (version 2.0.2), in its implementation, does not send correct Write request for arrays for every type of server?
16:03, EET
December 21, 2011
Yes, it is definitely an interoperability issue, but what I actually mean is that it is probably easier to examine the server, why it rejects the write. The value is written as DataValue, which does get a timestamp and quality by default. The server should just ignore those, in my opinion. But if you could find out why the server rejects the write and what it actually requires for this to work, it will be easier to modify the client code respectively.
Which server is this?
7:40, EET
November 18, 2014
9:32, EET
December 21, 2011
I just discussed with the Beckhoff developer (we are currently at the Interoperability Workshop) and he told me that index ranges are not yet supported by the Twincat server.
If you want to write to sub elements, you can enable ArraySubItemLegacySupport for the arrays, as described at
http://infosys.beckhoff.com/co…..spaces.htm
That will, of course increase the size of the namespace, but should help you with the issue at the moment.
10:44, EET
November 18, 2014
Thank You.
I know about the legacy and non-legacy mode on TwinCAT 3 server, but I really need to know how to write values of arrays when ArraySubItemLegacySupport is disabled.
What bothers me now is that I am able to write values in array in this mode when I use UaExpert client and not able when I use Prosys’ library in Java.
Could be that UaExpert uses another stack (bulit in C) and that Unified Architecture’s Java stack does not sen something that Beckhoff’s server is demanding? (Timestamps or something else).
I will repeat what I said about successful and failed scenarios while testing different servers and client programs:
1. Through UaExpert client it is possible to change the values for arbitrary elements in array on TwinCAT 3 server.
2. Using Prosys OPC-UA and the same code I am able to write values in array’s elements, on OPC UA C++ Demo Server (from Unified Automation).
3. I am able to write other simple data type values with no problem, on both demo server and TwinCAT 3 server.
Best Regards,
Darko
13:02, EET
December 21, 2011
Most Users Ever Online: 1919
Currently Online:
28 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