High Performance OPC UA Server SDK
1.5.0.296
|
The xml2bin
tool can be used to generate binary information model files from XML NodeSet files. This is explained in more detail in section Address Space Generation.
The possible command line arguments can be listed by calling the tool with the option -h
as usual: ./xml2bin -h
. The help also gives you one simple example.
Important Notes:
-i
select this namespace to be exported. The namspaces are normally numbered that way:-i
. It will print the namespace table.Important here is the SDK Index, which is the index that will be used in the SDK and must be unique. The column XML Index, shows the numeric index used in the XML file which is not unique across files. Prefix is used only for code generation. URI is the unique URI of the information model. Instead of selecting the SDK Index using -i
you can also select the model using the option -u
and the URI string.
Even though the OPC UA Binary File Format supports multiple languages like the XML Nodesets, the xml2bin
currently can only extract one locale.
The XML parsing code of xml2bin
is the same as in xml2c
. Please see Locale Handling for more information on this topic.
XML NodeSet files can contain extensions. xml2bin
can convert known extensions into a binary version of this extension. The extension UA_EXTENSION_RUNTIMEADDRESS is such an extension. See Tagfile Server Example for a detailed example on this topic.
Unknown XML extensions can also be converted into the binary extension UA_EXTENSION_XML, which keeps all XML contents as-is. This allows application to load such custom extensions and parse the XML code at runtime.
By default all known Unified Automation extension will get converted, others will be ignored. You can influence this using the option -e <value>
:
Option Value | Description |
---|---|
none | Don't export any extensions. |
default | Export all known Unified Automation extensions like e.g. UA_EXTENSION_RUNTIMEADDRESS. |
all | Export all extensions. |