23:33, EET
February 8, 2014
8:25, EET
December 21, 2011
This sample is available in SampleConsoleServer.createStaticArrayVariable:
NodeId dataType, Object initialValue) throws StatusException {
final NodeId nodeId = new NodeId(complianceNamespaceIndex, dataTypeName);
UaType type = server.getNodeManagerRoot().getType(dataType);
UaVariableNode node = new CacheVariable(complianceNodeManager, nodeId,
dataTypeName, Locale.ENGLISH);
node.setDataType(type);
node.setTypeDefinition(type);
node.setValueRank(ValueRanks.OneDimension);
node.setArrayDimensions(new UnsignedInteger[] { UnsignedInteger
.valueOf(Array.getLength(initialValue)) });
node.setValue(new DataValue(new Variant(initialValue), StatusCode.GOOD,
new DateTime(), new DateTime()));
staticArrayVariableFolder.addReference(node, Identifiers.HasComponent,
false);
}
and it is called from createComplianceNodes, e.g.
new Boolean[] { true, false, true, false, false });
createStaticArrayVariable(
"ByteArray",
Identifiers.Byte,
new UnsignedByte[] { UnsignedByte.valueOf(1),
UnsignedByte.valueOf(2), UnsignedByte.valueOf(3),
UnsignedByte.valueOf(4), UnsignedByte.valueOf(5) });
18:24, EEST
June 29, 2017
Hello,
I am using the code above ( createStaticArrayVariable ) to generate a UaVariableNode but as an Identifiers.Int16 data type. When updating the value I can see that the value was changed, but subscribing (via UaExpert) doesn’t work (i.e. the initial value is shown but is not updated). Is this a general issue with array types or am I missing something? I tried UaVariableNode.setValue as well as UaVariableNode.updateValue.
16:03, EEST
April 17, 2013
Hello Sergej,
The above code should still work despite being 4 years old. And UaExpert should be able to create subscriptions to Array variables without issues.
How have you confirmed that the value was updated correctly on the server side?
Do you think you could compose an example project showing the issue so that we could reproduce this? I tested the above code snippets and UaExpert and I cannot find anything going wrong.
18:45, EEST
June 29, 2017
Most Users Ever Online: 1919
Currently Online:
10 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: 730
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1529
Posts: 6471
Newest Members:
rondawolinski7, Marypof5711, roycedelargie91, kourtneyquisenbe, ellis87832073466, zkxwilliemae, gabriellabachus, Deakin, KTP25Zof, Wojciech KubalaModerators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1032, Jimmy Ni: 26, Matti Siponen: 349, Lusetti: 0
Administrators: admin: 1