Aller au contenu principal

Main Structure

Sterfive OPCUA Modeler relies on the YAML (YAML Ain't Markup Language) format for describing OPC UA Models. This article will provide an overview of the general structure of the YAML file used in this context.

The given example represents a basic layout of a YAML file utilized by the OPCUA Modeler:

# yaml-language-server: $schema=https://support.sterfive.com/nodeset2.schema.json
namespaceUri: http://acme.com/UA/TemperatureSensor/
version: 1.0.0
publicationDate: 2019-01-01T00:00:00Z
namespaces:
dataTypes:
referenceTypes:
objectTypes:
variableTypes:
instances:

Here's a rundown of the elements found in this file:

  • # yaml-language-server: The first line of the YAML file specifies a schema URL. This URL points to a JSON schema that dictates the structure and validation rules of the YAML file. The yaml-language-server prefix implies that the schema URL is recognized by the YAML Language Server, which provides IntelliSense, linting, and other language features for YAML files. The JSON schema that describes the structure of the YAML file is publicly available at $schema=https://support.sterfive.com/nodeset2.schema.json

  • namespaceUri: This refers to the namespace of the OPC UA information model. It's a unique identifier used for distinguishing different namespaces, preventing naming conflicts. In this case, the namespaceUri is "http://acme.com/UA/TemperatureSensor/".

  • version: This field denotes the version of the OPC UA model described by the YAML file. It follows semantic versioning principles (MAJOR.MINOR.PATCH).

  • publicationDate: This field represents the date when the version of the OPC UA model described in the file was published. The format used for the date is the ISO 8601 format: "YYYY-MM-DDTHH:MM:SSZ".

  • namespaces: This section is used to define any additional namespaces that are imported or referenced by the OPC UA model.

  • dataTypes: This section describes custom data types used in the OPC UA model.

  • referenceTypes: This section defines any custom reference types utilized within the OPC UA model.

  • objectTypes: Here, users can describe the object types in the OPC UA model.

  • variableTypes: This section is used to define custom variable types in the OPC UA model.

  • instances: This section is used to define instances of the above types.

The YAML file structure provided by the Sterfive OPCUA Modeler makes the process of creating, maintaining, and sharing OPC UA models simple and effective. Each section serves a specific purpose in detailing various aspects of the model, ensuring a comprehensive description that can be easily interpreted and manipulated.