04/14/2020
After grabbing the latest ModelCompiler source code, my model file is fails.
The new method SetStaticNodeIdRanges has the following code in a loop over the dictionary items:
if (metadata == null)
{
metadata = node as ObjectDesign;
if (metadata != null && metadata.TypeDefinition != new XmlQualifiedName("NamespaceMetadataType", Namespaces.OpcUa))
{
metadata = null;
}
}
Since my model doesn't have any ObjectDesign objects with the TypeDefinition named "NamespaceMetadataType", metadata is set back to null, and a null reference exception is thrown on line 985:
if (metadata.Hierarchy.NodeList != null)
My model does have an ObjectDesign, but its TypeDefinition is named "BaseObjectType".
Is this a regression, or would the model be invalid in that case? Either way, it seems that the code should be checking for this case instead of throwing null reference exception?
Thanks for your help.
05/30/2017
It is a bug that should be fixed in:
https://github.com/OPCF-Member.....elCompiler
That said, every model needs a NamespaceMetadataType. You need to add it or report it as a defect to the model creator.
04/14/2020
Thank you Randy for your reply.
Sorry if this is a dumb question, but should I be seeing the actual string "NamespaceMetadataType" somewhere in my model, or just a "Namespace" element? I don't see "NamespaceMetadataType" in the tutorial model either:
https://github.com/Pro/opcua-a.....lModel.xml
Also, where can I pick up the fix for this bug? The link you posted gives me a 404 not found.
One more question: what branch should I be using for "production" code? Is the master branch considered "shipping", or should I be grabbing one of the version branches like "v1.04"?
Thanks again.
05/30/2017
You need to be an OPC-F member. The fix will be published in a couple weeks to the public repository.
See here: https://opcf-members.github.io/Help/
v1.04 in the public repository is the production code for UANodeSets.
master in the public repository is production code for UAModelCompiler.
pre-release and release candidates are in the member only repository.
Every model has have an Object with TypeDefinition NamespaceMetadataType
Here is an example:
https://reference.opcfoundatio...../docs/8.1/
1 Guest(s)