You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my example I have the following code to load in the dynamic structs:
let type_tree = DataTypeTreeBuilder::new(|f| f.namespace <= 4)
.values_per_read(100)
.build(&session)
.await?;
println!("{:?}", type_tree);
let loader = Arc::new(DynamicTypeLoader::new(Arc::new(type_tree)));
session.add_type_loader(loader);
From my limited testing and debugging I see that it can load the types and encoders for dynamic types registered by the OPCUA server when the NodeId of the types (and perhaps the variables) are Numeric.
However in our CODESYS generated OPCUA Server, the custom types are created with NodeId Identifier: String.
The above code example prints the type_tree, and I can see that for the dynamic_client.rs example, it can populate the struct_types, enum_types and encoding_to_data_type fields correctly.
When I repeat the same code against the CODESYS server, it iterates through the data type nodes such as:
NodeId { namespace: 4, identifier: String(UAString { value: Some("|type|CODESYS Control for Linux SL.Application.extractionAPI") }) }
But the type_tree contains empty struct_types, enum_types and encoding_to_data_type fields.
I wonder if this is a known limitation of dynamic type loader, or is expected behaviour according to OPCUA spec, and whether CODESYS is doing something unique with their server.
At the minimum, it would be great if types that do not have a registered encoder can still return the raw binary, rather than panicking.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I have been experimenting with custom dynamic structures via the example code in the samples: https://github.com/FreeOpcUa/async-opcua/blob/master/samples/custom-structures-client/src/bin/dynamic_client.rs
In my example I have the following code to load in the dynamic structs:
From my limited testing and debugging I see that it can load the types and encoders for dynamic types registered by the OPCUA server when the NodeId of the types (and perhaps the variables) are
Numeric
.However in our CODESYS generated OPCUA Server, the custom types are created with NodeId Identifier:
String
.The above code example prints the
type_tree
, and I can see that for thedynamic_client.rs
example, it can populate thestruct_types
,enum_types
andencoding_to_data_type
fields correctly.When I repeat the same code against the CODESYS server, it iterates through the data type nodes such as:
But the
type_tree
contains emptystruct_types
,enum_types
andencoding_to_data_type
fields.I wonder if this is a known limitation of dynamic type loader, or is expected behaviour according to OPCUA spec, and whether CODESYS is doing something unique with their server.
At the minimum, it would be great if types that do not have a registered encoder can still return the raw binary, rather than panicking.
Beta Was this translation helpful? Give feedback.
All reactions