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
Moderators
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: 518
Currently Online:
27 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
hbrackel: 135
pramanj: 86
Francesco Zambon: 81
rocket science: 77
Ibrahim: 76
Sabari: 62
kapsl: 57
gjevremovic: 49
Xavier: 43
fred: 41
Member Stats:
Guest Posters: 0
Members: 681
Moderators: 16
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1467
Posts: 6261
Newest Members:
graciela2073, sagarchau, elviralangwell4, Donnavek, Eddiefauth, DonaldPooma, fidelduke938316, Jan-Pfizer, DavidROunc, fen.pang@woodside.comModerators: Jouni Aro: 1010, Otso Palonen: 32, Tuomas Hiltunen: 5, Pyry: 1, Petri: 0, Bjarne Boström: 983, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Jimmy Ni: 26, Teppo Uimonen: 21, Markus Johansson: 42, Niklas Nurminen: 0, Matti Siponen: 321, Lusetti: 0, Ari-Pekka Soikkeli: 5
Administrators: admin: 1