-
Notifications
You must be signed in to change notification settings - Fork 955
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BinaryDecoder ServiceResultException with complex types #1079
Comments
Hi @symarchand, to analyze this I need to look at the decode function of MeasIdDataType. It may not properly implement the decode of the optional fields parameter. Is the code created with ModelCompiler from the VDMA spec? |
Hi @mregen yes the code was created by the model compiler but as i understand the model compiler and the model design XSD format can't handle optional fields. Am I wrong? The wrong idea is to manually modify the generated source code, the right idea is to modify the model compiler |
@mregen, Of course another solution is to use the complex types client to avoid compiling vdma specifications on the client side. What we are looking for is a version of the aggregation server which is able to load the types of the connected servers without requiring to load the DLL which contain the compiled code from the model compiler. |
Hi @eoursel and @symarchand, could you provide the ModelCompiler input file for the VDMA spec (per email if there is (c) issues). I'd like to understand whats going wrong and what needs to be done in ModelCompiler. Did you open a Mantis issue for fixing ModelCompiler? |
Hi @mregen No i did not opened a MANTIS issue for the model compiler but have opened a github issue OPCFoundation/UA-ModelCompiler#48. I raised the question during the last TAC meeting. There will be no official support from OPC Foundation to fix the model compiler. I generated the ModelDesign XML file from the MachineVision NodeSet by using ASMD from @mpostol, but not with the last version, i should try again with the last version he published recently. We are still missing a NodeSet2 to ModelDesign generator knowing that most companion specifications working groups only provide the NodeSet2 file. |
Hi @eoursel, You can also check out UAModelDesign Export. Description is here: Address Space Prototyping Tool (asp.exe). |
Thanks Mariusz @mpostol , I tried UAModelDesign Export. I notice some validation errors when parsing the Machine Vision NodeSet. The problem is that we don't have the description of the source of the error. Most important question is what is the meaning of:
Regards |
Hi @mpostol I have some questions about the generated ModelDesign file. i will open an issue on your repository. |
Hi @eoursel, I have noticed and scheduled your issue |
Let's take the very simple example
where Y and Z are optional. This is approximately the kind of structures we find in machine vision. The problem is that the modelCompiler completely ignores the BitMask attribute. The following code is generated
In the NodeSet2 generated file the IsOptional attribute is missing on Fields Y and Z. Also according to part 6 the way encoding/decoding is done result in decoding errors if the encoding is done correctly according to Part 6 which is the case for node-opcua. Honestly, i am not comfortable to fix the model compiler but if someone has an idea. Refer to issue #48 in model compile project. Thanks. |
This is unfortunate but the latest modelcompiler doesn't seem to produce the proper code for encoding/decoding structure with optional fields. From my understanding this is the modelcompiler input that should produce the EncodingMask:
but out is shown --> OPCFoundation/UA-ModelCompiler#92 not having an Encodingmask field |
due to the dependency on modelcompiler, removed milestone |
Please check recent ModelCompiler updates. Complex types have been improved in 1.4.371. Please reopen if there are still issues. |
Hello,
We have an issue while using complex types with optional fields. It works fine for complex types with only mandatory fields.
The problem happens when decoding values using a BinaryDecoder. The read variable's type is MeasIdDataType (from machine vision companion specification).
When we call a method returning complex types, the decoding of the output arguments throws an Opc.Ua.ServiceResultException: 'MaxStringLength 65535 < 190296809'. The source of the excpetion is in Opc.Ua.BinaryDecoder.ReadString.
Here are 2 relevant methods we use.
Let me know if you need more precisions.
The text was updated successfully, but these errors were encountered: