Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Codegen fails with message A descriptor with default root element {http://opcfoundation.org/BinarySchema/}TypeDictionary was not found in the project
July 15, 2020
9:35, EEST
Avatar
francesco.sgaramella@rold.com
Member
Members
Forum Posts: 6
Member Since:
July 15, 2020
sp_UserOfflineSmall Offline

Hello everybody!
I am new on the technology. I am trying to generate java classes with the codegen. I’ve bought the license for the SDK and I’ve followed the tutorial given for the codegen.
So, I’ve created a codegenConfiguration that instructs the codegen to generate classes starting from the xml in the folder ${app-name}/recipe-model. In the folder there is the file BlenderOpcUa.xml , which I’ve attached below. Once I call the codegen via command line, it fails with the following error:

ERROR – Could not load model from file: /home/fsgaramella/prosys-opc-ua-sdk-for-java-4.3.0-1075-client-binary/codegen/commandline/recipe-model/BlenderOpcUa.xml
javax.xml.bind.UnmarshalException
– with linked exception:
[Exception [EclipseLink-25008] (Eclipse Persistence Services – 2.7.4.v20190115-ad5b7c6b2a): org.eclipse.persistence.exceptions.XMLMarshalException
Exception Description: A descriptor with default root element {http://opcfoundation.org/BinarySchema/}TypeDictionary was not found in the project]

I’ve tried to download and add the file TypeDictionary.xml in the folder, but the error persists. Could anybody help me, please?

July 15, 2020
10:38, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 1027
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

Please check that the file is a valid “NodeSet2.xml file”, they conform to the schema http://opcfoundation.org/UA/20…..odeSet.xsd.

The error messages could use some improvements. But basically it would seem you have tried to give it a “XXXTypes.bsd” or equivalent (or that is what those typically are called in https://github.com/OPCFoundation/UA-Nodeset. Basically the only input codegen accepts and needs is the XXX.NodeSet2.xml (naming convention in that foundation resources repo). In addition if you define a folder as a modelSource all xml files within that folder must be valid NodeSet2 XMLs, as we’ll try to load them all. If you define the modelSource as a single file, then only that is loaded.

Before NodeSet2 format there have been some other formats, but the nodeset2 in practice will contain all needed info and is the format used nowadays.

July 15, 2020
10:59, EEST
Avatar
francesco.sgaramella@rold.com
Member
Members
Forum Posts: 6
Member Since:
July 15, 2020
sp_UserOfflineSmall Offline

Thank you for your reply!
The file from which I need classes generation is not made by me, but it has been made by the company how constructs the blender which has an opc ua connection. I have to read and write data to this opc ua server inside the machinery. When I’ve asked for the file they sent me the one below. Should I ask for a different file format? Can they provide me a different file format?

opc:TypeDictionary xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns:tns=”http://wittmann-group.com/BlenderOpcUa/” DefaultByteOrder=”LittleEndian” xmlns:opc=”http://opcfoundation.org/BinarySchema/” xmlns:ua=”http://opcfoundation.org/UA/” TargetNamespace=”http://wittmann-group.com/BlenderOpcUa/”
opc:Import Namespace=”http://opcfoundation.org/UA/”/
opc:StructuredType BaseType=”ua:ExtensionObject” Name=”AnalogScalingInputDataType”
opc:Field TypeName=”opc:Double” Name=”MinVoltageVolumetric”/
opc:Field TypeName=”opc:Double” Name=”MaxVoltageVolumetric”/
opc:Field TypeName=”opc:Double” Name=”MinVoltageGravimetric”/
opc:Field TypeName=”opc:Double” Name=”MaxVoltageGravimetric”/
/opc:StructuredType
opc:StructuredType BaseType=”ua:ExtensionObject” Name=”AnalogScalingOutputDataType”
opc:Field TypeName=”opc:Int32″ Name=”MinMotorSpeed”/
opc:Field TypeName=”opc:Int32″ Name=”MaxMotorSpeed”/
opc:Field TypeName=”opc:Double” Name=”MinDosingCapacity”/
opc:Field TypeName=”opc:Double” Name=”MaxDosingCapacity”/
/opc:StructuredType
opc:StructuredType BaseType=”ua:ExtensionObject” Name=”DatabaseMaterialDataType”
opc:DocumentationA composition of all attributes that make up a particular database material/opc:Documentation
opc:Field TypeName=”tns:MaterialIdDataType” Name=”MaterialId”/
opc:Field TypeName=”tns:MaterialTemperaturesDataType” Name=”Temperatures”/
opc:Field TypeName=”opc:Int32″ Name=”NoOfCustomDescription”/
opc:Field LengthField=”NoOfCustomDescription” TypeName=”ua:LocalizedText” Name=”CustomDescription”/
/opc:StructuredType
opc:StructuredType BaseType=”ua:ExtensionObject” Name=”DosingUnitJobDataType”
opc:Field TypeName=”opc:Int32″ Name=”MotorSpeed”/
opc:Field TypeName=”tns:AnalogScalingOutputDataType” Name=”AnalogScalingOutput”/
/opc:StructuredType
opc:StructuredType BaseType=”ua:ExtensionObject” Name=”JobDataType”
opc:DocumentationDefines all prodcution – relevant parameters, which have no dependency to the recipe/opc:Documentation
opc:Field TypeName=”opc:CharArray” Name=”Name”/
opc:Field TypeName=”opc:CharArray” Name=”OrderNumber”/
opc:Field TypeName=”opc:Double” Name=”ShotWeight”/
opc:Field TypeName=”opc:Int32″ Name=”DosingDuration”/
opc:Field TypeName=”opc:Double” Name=”ExtruderThroughput”/
opc:Field TypeName=”tns:AnalogScalingInputDataType” Name=”AnalogScalingInput”/
opc:Field TypeName=”opc:Int32″ Name=”NoOfDosingUnits”/
opc:Field LengthField=”NoOfDosingUnits” TypeName=”tns:DosingUnitJobDataType” Name=”DosingUnits”/
opc:Field TypeName=”tns:RecipeDataType” Name=”Recipe”/
opc:Field TypeName=”tns:RecipeTypeEnum” Name=”RecipeType”/
opc:Field TypeName=”tns:RecipeDataType” Name=”HighLevelRecipe”/
opc:Field TypeName=”tns:RecipeDataType” Name=”LowLevelRecipe”/
/opc:StructuredType
opc:StructuredType BaseType=”ua:ExtensionObject” Name=”MaterialIdDataType”
opc:DocumentationAll attributes that uniquely identify a material in conjunction. Note that if you are using an OPC toolkit that does not support OPC complex datatypes you may alternatively choose to use the matching separately provided type MaterialIdType./opc:Documentation
opc:Field TypeName=”ua:LocalizedText” Name=”MaterialName”/
opc:Field TypeName=”ua:LocalizedText” Name=”ReferenceNumber”/
opc:Field TypeName=”opc:Int32″ Name=”NoOfCustomKey”/
opc:Field LengthField=”NoOfCustomKey” TypeName=”ua:LocalizedText” Name=”CustomKey”/
/opc:StructuredType
opc:StructuredType BaseType=”ua:ExtensionObject” Name=”MaterialTemperaturesDataType”
opc:DocumentationA set of temperatures suitable for a material/opc:Documentation
opc:Field TypeName=”opc:Double” Name=”ProcessTemperature”/
opc:Field TypeName=”opc:Double” Name=”ReturnTemperature”/
opc:Field TypeName=”opc:Int32″ Name=”PreDryingTime”/
opc:Field TypeName=”opc:Boolean” Name=”AutomaticReturnTemperature”/
/opc:StructuredType
opc:StructuredType BaseType=”ua:ExtensionObject” Name=”MixerParametersDataType”
opc:DocumentationThe set of parameters that allow for customizing the mixing process. Note that if you are using an OPC toolkit that does not support OPC complex datatypes you may alternatively choose to use the matching separately provided type MixerParametersType./opc:Documentation
opc:Field TypeName=”tns:MixingMode” Name=”MixingMode”/
opc:Field TypeName=”opc:Int32″ Name=”MainMixingDuration”/
opc:Field TypeName=”opc:Int32″ Name=”DrainMixingDuration”/
opc:Field TypeName=”opc:Boolean” Name=”PastMixing”/
opc:Field TypeName=”opc:Int32″ Name=”PastMixingDuration”/
opc:Field TypeName=”opc:Int32″ Name=”PauseTillPastMixing”/
/opc:StructuredType
opc:StructuredType BaseType=”ua:ExtensionObject” Name=”RecipeDataType”
opc:DocumentationAll information that makes up a recipe data set. Note that if you are using an OPC toolkit that does not support OPC complex datatypes you may alternatively choose to use the matching separately provided type RecipeType./opc:Documentation
opc:Field TypeName=”ua:LocalizedText” Name=”Name”/
opc:Field TypeName=”ua:LocalizedText” Name=”Description”/
opc:Field TypeName=”ua:LocalizedText” Name=”OrderNumber”/
opc:Field TypeName=”opc:Double” Name=”RelativeBatchSize”/
opc:Field TypeName=”opc:Boolean” Name=”EnableRegrindMode”/
opc:Field TypeName=”opc:UInt32″ Name=”NrOfBatchesTillRetryRegrindMaterial”/
opc:Field TypeName=”opc:Int32″ Name=”NoOfMaterials”/
opc:Field LengthField=”NoOfMaterials” TypeName=”tns:RecipeMaterialDataType” Name=”Materials”/
opc:Field TypeName=”tns:MixerParametersDataType” Name=”MixerParameters”/
/opc:StructuredType
opc:StructuredType BaseType=”ua:ExtensionObject” Name=”RecipeMaterialDataType”
opc:DocumentationNote that if you are using an OPC toolkit that does not support OPC complex datatypes you may alternatively choose to use the matching separately provided type RecipeMaterialType./opc:Documentation
opc:Field TypeName=”tns:MaterialIdDataType” Name=”MaterialId”/
opc:Field TypeName=”opc:Double” Name=”RelativeMaterialSize”/
opc:Field TypeName=”opc:Boolean” Name=”IsReference”/
opc:Field TypeName=”opc:UInt32″ Name=”FreeFallIndex”/
opc:Field TypeName=”opc:UInt32″ Name=”PulsingIndex”/
opc:Field TypeName=”opc:Int32″ Name=”NoOfHoppers”/
opc:Field LengthField=”NoOfHoppers” TypeName=”opc:UInt32″ Name=”Hoppers”/
opc:Field TypeName=”tns:MultiHopperUsage” Name=”MultiHopperUsage”/
opc:Field TypeName=”tns:MaterialType” Name=”MaterialType”/
opc:Field TypeName=”tns:FreefallDosingMode” Name=”FreefallDosingMode”/
opc:Field TypeName=”tns:PulsingDosingMode” Name=”PulsingDosingMode”/
opc:Field TypeName=”opc:Boolean” Name=”IsAuto”/
opc:Field TypeName=”opc:Double” Name=”OverDosingLimit”/
opc:Field TypeName=”opc:Double” Name=”UnderDosingLimit”/
opc:Field TypeName=”tns:MaterialForm” Name=”MaterialForm”/
/opc:StructuredType
opc:EnumeratedType LengthInBits=”32″ Name=”FreefallDosingMode”
opc:DocumentationAvailable modes for freefalling material/opc:Documentation
opc:EnumeratedValue Name=”NO_FREEFALL” Value=”0″/
opc:EnumeratedValue Name=”FREEFALL” Value=”1″/
opc:EnumeratedValue Name=”REGRIND_FREEFALL” Value=”2″/
/opc:EnumeratedType
opc:EnumeratedType LengthInBits=”32″ Name=”HopperMaterialTypeEnum”
opc:DocumentationThe selected material type dictates how absolute set values are calculated. Furthermore the device decides whether to favor throughput or accuracy./opc:Documentation
opc:EnumeratedValue Name=”UNUSED” Value=”0″/
opc:EnumeratedValue Name=”VIRGIN” Value=”1″/
opc:EnumeratedValue Name=”REGRIND” Value=”2″/
opc:EnumeratedValue Name=”COLOR” Value=”3″/
opc:EnumeratedValue Name=”ADDITIVE” Value=”4″/
/opc:EnumeratedType
opc:EnumeratedType LengthInBits=”32″ Name=”JobTransferResult”
opc:EnumeratedValue Name=”SET_JOB_OK” Value=”0″/
opc:EnumeratedValue Name=”JOB_NOT_WELL_FORMED” Value=”1″/
opc:EnumeratedValue Name=”INVALID_JOB” Value=”2″/
opc:EnumeratedValue Name=”SET_JOB_WRONG_STATE” Value=”3″/
opc:EnumeratedValue Name=”STORING_JOB_FAILED” Value=”4″/
/opc:EnumeratedType
opc:EnumeratedType LengthInBits=”32″ Name=”MaterialForm”
opc:DocumentationThe available material forms/opc:Documentation
opc:EnumeratedValue Name=”STANDARD” Value=”0″/
opc:EnumeratedValue Name=”MICRO” Value=”1″/
opc:EnumeratedValue Name=”POWDER” Value=”2″/
/opc:EnumeratedType
opc:EnumeratedType LengthInBits=”32″ Name=”MaterialType”
opc:DocumentationThe selected material type dictates how absolute set values are calculated. Furthermore the device decides whether to favor throughput or accuracy./opc:Documentation
opc:EnumeratedValue Name=”VIRGIN” Value=”0″/
opc:EnumeratedValue Name=”REGRIND” Value=”1″/
opc:EnumeratedValue Name=”COLOR” Value=”2″/
opc:EnumeratedValue Name=”ADDITIVE” Value=”3″/
/opc:EnumeratedType
opc:EnumeratedType LengthInBits=”32″ Name=”MixingMode”
opc:DocumentationThe available mixing modes/opc:Documentation
opc:EnumeratedValue Name=”NO_MIXING” Value=”0″/
opc:EnumeratedValue Name=”CONTINUOUS_MIXING” Value=”1″/
opc:EnumeratedValue Name=”CUSTOMIZE_MIXING” Value=”2″/
/opc:EnumeratedType
opc:EnumeratedType LengthInBits=”32″ Name=”MultiHopperUsage”
opc:DocumentationIf more than one hopper contains the same material this option allows to select how the device shall take advantage of this./opc:Documentation
opc:EnumeratedValue Name=”SEQUENTIAL” Value=”0″/
opc:EnumeratedValue Name=”PARALLEL” Value=”1″/
/opc:EnumeratedType
opc:EnumeratedType LengthInBits=”32″ Name=”PulsingDosingMode”
opc:DocumentationAvailable modes for pulsing material/opc:Documentation
opc:EnumeratedValue Name=”NO_PULSING” Value=”0″/
opc:EnumeratedValue Name=”PULSING” Value=”1″/
opc:EnumeratedValue Name=”REGRIND_PULSING” Value=”2″/
/opc:EnumeratedType
opc:EnumeratedType LengthInBits=”32″ Name=”RecipeTransferResult”
opc:DocumentationPossible return values when transfering a recipe to the device/opc:Documentation
opc:EnumeratedValue Name=”SET_RECIPE_OK” Value=”0″/
opc:EnumeratedValue Name=”RECIPE_NOT_WELL_FORMED” Value=”1″/
opc:EnumeratedValue Name=”INVALID_RECIPE” Value=”2″/
opc:EnumeratedValue Name=”SET_RECIPE_WRONG_STATE” Value=”3″/
opc:EnumeratedValue Name=”STORING_RECIPE_FAILED” Value=”4″/
/opc:EnumeratedType
opc:EnumeratedType LengthInBits=”32″ Name=”RecipeTypeEnum”
opc:DocumentationIdentifies the recipe type in use./opc:Documentation
opc:EnumeratedValue Name=”SINGLE_RECIPE” Value=”0″/
opc:EnumeratedValue Name=”HIGH_LOW_LEVEL_RECIPE” Value=”1″/
/opc:EnumeratedType
/opc:TypeDictionary

July 15, 2020
11:23, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 1027
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

This is a complicated topic, my answer is a greatly simplified version, thus some details might seem odd.

Note that as long as their server is made properly (and there is not some of few edge-cases) i.e. as a proper standard OPC UA Server that contains all of the typespace and metadata, you do not actually need the model at all, since OPC UA is “self-descriptive”. UaClient on connect will read all the metadata needed from the server when it connects.

You would need the model only to make a server using the model or in order to have a nicer API for the types. In SDK 4.x Structures can all (known codegen ones and unknown non-codegen ones) be handled dynamically with Structure.specification() returng StructureSpecification that has the metadata (that you can pass to other methods of the Structure). With codegen you would get more specific classes, but if they do not exist, SDK will use DynamicStructure instead. For the non-DataTypes all operations can be done via the UaNode API, though with codegen you will get helper methods based on types TypeDefinition nodes (which then internally use the UaNode API).

But yeah, it has to be the NodeSet2 file in order for us to generate anything. Therefore, if you want to do that, you will need to ask for that file

If you open that file you have, it most likely will like https://github.com/OPCFoundation/UA-Nodeset/blob/v1.04/DI/Opc.Ua.Di.Types.bsd (and seems you edited the post to show that). The file shown is only for the so called “DataTypeDictionary”, it is missing a lot of data needed. Basically this is an XML document that the server would give us, but in addition there is mapping nodes needed which will link the “XML type Names” to the “UA types NodeIds” (namely the encoding NodeIds are needed). This system is what I would call legacy nowadays, in OPC UA 1.04 an alternative was made in the form of DataTypeDefinition Attribute. Anyway the SDK StructureSpecification will abstract on both depending what the server has to offer.

P.S.
Just in case anyone else reads this sometime later, note that technically from a proper server it is possible to get almost identical NodeSet2 model just by Read/Browse the data, since it is self-descriptive. For example, UaExpert has a commercial view/plugin that can export that, with some limitations (https://www.unified-automation.com/products/development-tools/uaexpert.html). At least one limitation is that most of the time the model has any Value Attributes of Structures as XML, but usually no server will support any “XML connection procotol” which would use XML encoding for the Structures (as SOAP transport protocol in OPC UA has been deprecated for ages now), so you might only get the values as binary.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 1919

Currently Online:
78 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Heikki Tahvanainen: 402

hbrackel: 144

rocket science: 88

pramanj: 86

Francesco Zambon: 83

Ibrahim: 78

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

Member Stats:

Guest Posters: 0

Members: 739

Moderators: 7

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1524

Posts: 6453

Newest Members:

shaylamaggard4, rickyjuarez140, jonathonmcintyre, fannielima, kristiewinkle8, rust, christamcdowall, redaahern07571, nigelbdhmp, travistimmons

Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1027, Jimmy Ni: 26, Matti Siponen: 346, Lusetti: 0

Administrators: admin: 1