Problem with new dynamic Type #1373
Replies: 2 comments 1 reply
-
I don't know what's wrong by just the description. You'll have to give me some error messages or something that can reproduce. I'm able to read the similarly (I assume) defined client.connect();
// synchronous read request via VariableNode
UaVariableNode node =
client
.getAddressSpace()
.getVariableNode(new NodeId(2, "HelloWorld/CustomStructTypeVariable"));
logger.info("DataType={}", node.getDataType());
// Read the current value
DataValue value = node.readValue();
logger.info("Value={}", value);
Variant variant = value.getValue();
ExtensionObject xo = (ExtensionObject) variant.getValue();
assert xo != null;
DynamicStructType decoded = (DynamicStructType) xo.decode(client.getDynamicEncodingContext());
logger.info("Decoded={}", decoded); yields:
|
Beta Was this translation helpful? Give feedback.
-
Hello Kevin, i have for example the same custom structure as in [(https://github.com//discussions/1345#discussion-7553929)] |
Beta Was this translation helpful? Give feedback.
-
Hello,
in response to :
#1130 (comment)
it is as you suggested i want to read custom structs defined in milo server with milo client. Milo client only can decode when i remove from
public static final ExpandedNodeId BINARY_ENCODING_ID = ExpandedNodeId.parse(String.format("nsu=%s;s=%s", ApplicationStrings.TOXCOMUA.getStr(), "\"Root\".\"Types\".\"DataTypes\".\"BaseDataType\".\"Structure\".\"XYPointStruct\".BinaryEncoding"));
the .BinaryEncoding on the end otherwise the custom struct couldn't be decoded by the milo client. But UaExpert is able to decode anyways. why is this the case? Greetings JohannBeta Was this translation helpful? Give feedback.
All reactions