Skip to content

TIA Portal Add-In to replicate the “Default SIMATIC Server Interface” as a user modelled interface using Openness.

License

Notifications You must be signed in to change notification settings

tia-portal-applications/tia-addin-opc-ua-modelled-interface

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OPC UA - User modelled interface - V1.0.0

Description

This Add-In has been developed to streamline the creation of user-modeled interfaces for OPC UA servers. By browsing through the TIA Portal project, it incorporates all variables that are accessible via OPC UA and arranges them in a structured manner, eliminating the need for manual configuration and significantly reducing the time and effort required.

The main goals of the Add-In are:

  • Enhanced performance: Replace the default SIMATIC server interface with modelled interfaces that offer improved performance. With modelled interfaces, OPC UA clients can create monitored items and access data (using read or write services) up to 6 times faster.
  • Automatic interface generation for S7-1200 and S7-1500 R/H PLCs: Create server interfaces for S7-1200 and S7-1500 R/H PLCs, which do not support the default SIMATIC server interface.
  • Customization to fit project needs: Provide flexibility by allowing customization of the server interface to meet specific project requirements. With the "Extend create" option, users can modify certain parameters of the server interface and adapt it to their needs.

Table of contents

  1. Installation
  2. Usage
  3. Features
  4. How it works
  5. Tia Portal version

Installation

Follow these steps to carry out the installation process:

  1. Download the repository to the local machine.
  2. Open Visual Studio, selecting the option: "Run as Administrator".
  3. Ensure that all necessary references are included in the project AddinOpcUaInterface. If any references are missing, select the Openness DLL files from TIA Portal version V19 as your reference source.
  4. Build the solution. The post-build event command will automatically transfer the .addin file to the C:\Program Files\Siemens\Automation\Portal V19\AddIn directory.

NOTE: If TIA Portal version V17 or V18 is being used, please refer to the instructions described in Chapter 4.

Usage

To use the Add-In in TIA Portal, make sure that the OpcUa-UserModelledInterface.addin file is located in the following directory: C:\Program Files\Siemens\Automation\Portal V19\AddIns.

Then, proceed with the following steps:

  1. Open a TIA Portal project and navigate to the Add-Ins tab on the right of the screen.

  2. Activate the Add-In with the dropdown menu.

    Activate Add-In
  3. Once activated, right-click on a device.

  4. Place the cursor over the Add-In. The two possible actions, "Create" and "Extend create," will appear.

    Run Add-In

Create

The "Create" option enables users to recreate the default SIMATIC server interface. This means that all configuration parameters are pre-set, and the user only needs to specify the name of the server interface, namespace URI, and a file path to store the XML file.

Create GUI

Extend create

The "Extend create" option allows users to customize the interface according to their specific requirements. Some of the options offered by this action include:

  • Setting filters to define the access levels of nodes within the server's AddressSpace.
  • Optimizing the server interface: Exclude children nodes from UDTs, structs, arrays, etc. In large projects, the number of nodes can be significantly reduced to fit the server's maximum node limit. - There are currently some limitations regarding this feature.
  • Choosing between strings or numeric identifiers for node identification: While the default SIMATIC server interface uses strings, numeric identifiers offer improved performance in terms of server storage and communication. - There are currently some limitations regarding this feature.
  • Removing empty data blocks: This option enables the removal of data blocks that do not contain any accessible variables via OPC UA, thus reducing the number of nodes in the server's AddressSpace.
  • Preserving the folder structure of the project: Folders present in the project can be included in the server interface. Maintaining the folder structure allows for easier browsing of the AddressSpace, although it increases the number of nodes.
Extend create GUI

Features

Features included in this version of the Add-In

  • "Create" and "Extend create" actions have been implemented.
  • Access level filters: Safety parameters are set to read-only by default.
  • Optimization of the server interface: The Add-In currently operates in "optimize" mode by default, excluding children nodes from UDTs, structs, arrays, etc.
  • Removal of empty data blocks: To reduce the number of nodes.
  • Folder structure management: Users can choose to keep or exclude the folder structure of the project.
  • Log file: Maintains a record of nodes that have not been added to the server interface.

Limitations

Some of the Add-In's current limitations are listed below:

  • It is not possible to use the Add-In without the "optimize" mode.
  • NodeIDs cannot be configured with numeric identifiers.
  • Function Blocks instantiated within other Function Blocks are modelled as "UAObjects" instead of "UAVariables". Therefore, the variables contained inside nested FBs are not accessible via the generated interface.

DISCLAIMER: This Add-In is designed to serve as a starting point for users to build upon. Users are encouraged to expand upon this basic version by implementing additional functionalities according to their specific requirements.

How it works

The Add-In utilizes the Openness API to access information stored in the TIA Portal project. To create a user-modelled interface, the Add-In follows these steps:

  1. Imports an XML base template of the server interface as an XDocument.
  2. Scans through all system and user datatypes in the project and includes them in the XDocument as UADataTypes and UAObjects.
  3. Browses through the project's tag tables and adds all Tags to the server interface.
  4. Repeats the previous step with the Global and Instance data blocks that are accessible via OPC UA.
  5. Finally, the program exports the XDocument as an XML file, which is imported into TIA Portal to create the server interface.
Flowchart of the Add-In

TIA Portal version

The Add-In is designed to run on TIA Portal V19, but it can be adapted to run on TIA Portal version V17 and V18. To do so:

  • Update the references of the project AddinOpcUaInterface. Use the Openness DLL files from TIA Portal versions V17 or V18 as your reference source.

    NOTE: Openness has backward compatibility. This means that an Add-In built with the DLL files from TIA Portal V17 can also run on TIA Portal V18, V19 and future versions.

  • Change the post-build event command to:

    copy "$(ProjectDir)AddInPublisherConfig.xml" "$(TargetDir)AddInPublisherConfig.xml" /Y 
    "C:\Program Files\Siemens\Automation\Portal V1X\PublicAPI\V1X.AddIn\Siemens.Engineering.AddIn.Publisher.exe" -f "$(TargetDir)AddInPublisherConfig.xml" -l "$(TargetDir)PostBuildLog.txt" -v -c -o "C:\Program Files\Siemens\Automation\Portal V1X\AddIns\OpcUa-UserModelledInterface.addin"
    

    NOTE: Replace the placeholder "Portal V1X" with the specific version of TIA Portal installed on your machine. For example, if TIA Portal V18 is installed, replace "Portal V1X" with "Portal V18". Similarly, update "V1X.AddIn" to match the version of the Openness DLL files selected in the previous step. If the selected DLL files are those from TIA Portal V17, change "V1X.AddIn" to "V17.AddIn".

  • Replace "UnrestrictedPermissions" with "SecurityPermissions" in the AddInPublisherConfig.xml file.

    Before:

      <RequiredPermissions>
          <TIAPermissions>
              <TIA.ReadWrite/>
          </TIAPermissions>
          <UnrestrictedPermissions>
              <System.UnrestrictedAccess>
                  <JustificationComment>
                      Needed for the execution of the "OPC UA - User Modelled Interface" Add-In
                  </JustificationComment>
              </System.UnrestrictedAccess>
          </UnrestrictedPermissions>
      </RequiredPermissions>
    

    After:

      <RequiredPermissions>
          <TIAPermissions>
              <TIA.ReadOnly/>
          </TIAPermissions>
          <SecurityPermissions>
              <System.Security.Permissions.UIPermission/>
              <System.Security.Permissions.FileIOPermission/>
              <System.Security.Permissions.SecurityPermission.UnmanagedCode/>
          </SecurityPermissions>
      </RequiredPermissions>
    

Reference links

OPC UA communication:

Openness API:

About

TIA Portal Add-In to replicate the “Default SIMATIC Server Interface” as a user modelled interface using Openness.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages