Skip to main content

Object: OPC UA Information Model

Symbol: _cds_icon_cloud.png

The OPC UA Information Model object is added to the Communication Manager in the application. When added, an OPC UA publishing object _cds_icon_cloud.png and below that an information model object _cds_icon_information_model.png as a child object are also added.

In the Add OPC UA Information Model dialog, specify a name for the information model and select the OPC UA information model. The selection includes the OPC UA information models which are installed in the OPC UA Information Model Repository.

For more information see: Using OPC UA Information Models

OPC UA information model editor

Symbol: _cds_icon_information_model.png

The editor is used to select the object types and data types of the OPC UA information model which you want to use in the open CODESYS project. The selected OPC UA types are converted to IEC types in the editor.

For more information see: Mapping of OPC UA Types to IEC Types

Browse Information Model

List box

The currently used information model and the information models which are referenced by the current model are displayed. The dependencies depend on the respective information model. The OPC UA base model is always displayed.

Generate IEC declarations

Generates an IEC declaration for all OPC UA types converted into an IEC type

The generated IEC types are saved in a folder (example: OPC Objects) in the Devices view and can be used in the implementation of the IEC code. When implementing the CODESYS project, you can select them in the Input Assistant dialog.

When the IEC declarations are generated, the suitable attributes are automatically added to the generated POUs (example: 'opcua.mapping.type','opcua.mapping.member.accesslevel').

Note: The user should not change the attributes which have been added by the system.

When the IEC type cannot be created, the entry UNKNOWN_TYPE is displayed in the declaration instead of the data type. The user should delete this variable because in this case it is almost always an OPC UA feature which is not supported yet. OPC UA features which are not supported yet are grayed out in the left area.

Data Model

Left area: OPC UA data model

Types

Display of the OPC UA data types and object types in a tree structure

When you drag an OPC UA type to the right area, CODESYS converts the OPC UA type into the corresponding IEC type which can be used in the implementation of the CODESYS project. In this case, only the root node of an OPC UA type can be dragged to the right area.

For a detailed description of the assignment of individual OPC UA types to the corresponding IEC types in the mapping operation, see the chapters "Mapping of OPC UA Types to IEC Types" and "Mapping of Reference Types".

Element Type

OPC UA element type

Reference Type

OPC UA reference types

Example: HasComponent, HasProperty

For a description of these reference types, see the chapter "Mapping of OPC UA Types to IEC Types".

Modelling Rule

  • Mandatory: For the corresponding OPC UA type, the respective members are generated in the project when the Generate IEC declarations command is executed. In the right area, the Generate member field is activated and cannot be deactivated.

  • Optional: Generating an IEC member for this OPC UA type is optional.

  • Optional placeholder: in the right, you can drag another IEC type for this placeholder.

    For an example in the form of a screenshot, see the chapter: “Use OPC UA Companion information models

Right area: Object types and data types of the OPC UA information model which are mapped to IEC types

Name

Name of the IEC POU or data type in the project

By default, the name of the type is displayed in the OPC UA information model. OPC UA also supports names which are invalid in IEC. In these cases, CODESYS automatically generates a valid IEC name.

You can change the name.

IEC Type

IEC type to which the OPC UA type was mapped (example: BOOL, Method).

OPC UA Type

Corresponds to the Element Type displayed in the left area

Generate member

  • standard icon: When the Generate IEC declarations command is executed, a corresponding member or a placeholder is generated in the project. Only the interfaces are automatically generated here, and the implementation still has to be manually created later in a POU.

    When the Modelling Rule is Mandatory for the OPC UA type in the right area, this option cannot be deactivated.

  • _cds_icon_option_deactivated.png: When the Generate IEC declarations command is executed, a corresponding member is not generated in the project. Click this option to activate it.

OPC UA publishing editor

Symbol: _cds_icon_cloud.png

In the editor, the instances (OPC UA objects) of the OPC UA types are configured which should be available to the OPC UA Clients via the controller.

Search for Mapped Instances

Searches in GVLs and PRGs below the current application for instances of the mapped OPC UA types which have already been declared

The search result is displayed in the list.

Note: Instances in the POUs view and in libraries are not taken into consideration.

Create New Instance

Opens the Create New Instance dialog to select the IEC type for which a new instance should be generated

Instances can be generated for the POUs which have been created in the OPC UA information model editor from OPC UA types. These instances can be used in POUs in the application.

Requirement: In the OPC UA information model editor, the Generate IEC declarations command has been executed after mapping the OPC UA types to the IEC types.

Root Node

Selection of directories or the object instance of the server which is displayed on the OPC UA Client for publishing the instances

The list box depends on the applied OPC UA companion specification.

Tabular list of generated instances:

OPC UA Variable

Variable which has been generated as an instance of an OPC UA type

This variable can be published in an OPC UA Client.

You can edit the displayed name.

OPC UA Type

OPC UA type of the OPC UA Variable

Map or Generate

  • _cds_icon_map_to_existing_variable.png: The OPC UA Variable has been mapped to an existing variable.

  • _cds_icon_create_new_variable.png: The OPC UA Variable has been generated as a new instance.

IEC Variable

Full variable name

IEC Type

IEC type of the IEC variable

Access Rights

Note that an OPC UA Client may have read/write access the OPC UA variable.

In the function blocks, the access rights to the variables can be changed by attributes which can also be read from the XML file if necessary.

Reading and writing

Maximal

Maximum possible permissions for the OPC UA variable