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
Currently failing to decode the ExtensionObject into the expected UDT using the following code
varsession= Session.Create(config,new ConfiguredEndpoint(null, selectedEndpoint, EndpointConfiguration.Create(config)),false,"",60000,null,null).GetAwaiter().GetResult();varcomplexTypeSystem= InitializeComplexTypeSystem(session);foreach(var type in complexTypeSystem.GetDefinedTypes()){
Console.WriteLine($"Type Loaded: {type}");}varresult= session.ReadValue("ns=3;s=\"H35dispenser\".\"ID\".\"ElectricalVersion\"");
Console.WriteLine(result);if(result.Value is ExtensionObject extObject){
Console.WriteLine(extObject.Body.ToString());varcustomType= extObject.Body as UDT_SemVer;if(customType!=null){
Console.WriteLine($"Successfully read custom UDT: {customType}");}else{
Console.WriteLine("Failed to decode ExtensionObject into the expected UDT.");}}else{
Console.WriteLine("The result is not an ExtensionObject.");}
Type of issue
Current Behavior
Currently failing to decode the ExtensionObject into the expected UDT using the following code
I have the defined the UDT_SemVer as follows:
The structure looks as follows on the PLC:
And the type that got loaded from the complexTypeSystem = Opc.Ua.ComplexTypes.simatic-s7-opcua.3.UDT_SemVer
I hope this is enough info in order to help me out
Expected Behavior
I expect the extObject.Body to be able to be cast to a UDT_SemVer
Steps To Reproduce
No response
Environment
Anything else?
No response
The text was updated successfully, but these errors were encountered: