- Software Units: A new action allows the creation of user-modeled interfaces for Software Units.
- Multi-dimensional arrays: Support for arrays with multiple dimensions.
- Strings of length defined by Constant: Strings where the length is defined by a constant are now supported.
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.
Follow these steps to carry out the installation process:
- Download the repository to the local machine.
- Open Visual Studio, selecting the option: "Run as Administrator".
- 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.
- 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.
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:
-
Open a TIA Portal project and navigate to the Add-Ins tab on the right of the screen.
-
Activate the Add-In with the dropdown menu.
-
Once activated, right-click on a device.
-
Place the cursor over the Add-In. The two possible actions, "Create" and "Extend create," will appear.
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.
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.
The "Create server interface for SW Units" action allows the creation of user-modeled interfaces for Software Units. To launch this action, right-click on the desired Software Unit and select "Create server interface for SW Unit".
NOTE: This option can only be executed with the .dll from TIA Portal V19.
- "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.
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.
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:
- Imports an XML base template of the server interface as an XDocument.
- Scans through all system and user datatypes in the project and includes them in the XDocument as UADataTypes and UAObjects.
- Browses through the project's tag tables and adds all Tags to the server interface.
- Repeats the previous step with the Global and Instance data blocks that are accessible via OPC UA.
- Finally, the program exports the XDocument as an XML file, which is imported into TIA Portal to create the server interface.
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 file "Siemens.Engineering.Addin" 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 the content in the AddInPublisherConfig.xml file.
For TIA V19:
<PackageConfiguration xmlns="http://www.siemens.com/automation/Openness/AddIn/Publisher/V19"> <Author><SIEMENS AG - DI FA S SUP SPH COM></Author> <AddInVersion>V19</AddInVersion> <Description>Automatically create user modelled interfaces for OPC UA servers.</Description> <DisplayInMultiuser /> <Product> <Name>OPC UA - User modelled interface</Name> <Id>tia_add_in_opc_ua_interface</Id> <Version>1.1.0</Version> </Product> <FeatureAssembly> <AssemblyInfo> <Assembly>AddInOpcUaInterface.dll</Assembly> </AssemblyInfo> </FeatureAssembly> <AdditionalAssemblies> <AssemblyInfo> <Assembly>AddInOPCUAInterface.UI.dll</Assembly> </AssemblyInfo> </AdditionalAssemblies> <!--Please check required permissions--> <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> </PackageConfiguration>
For TIA V18:
<PackageConfiguration xmlns="http://www.siemens.com/automation/Openness/AddIn/Publisher/V18"> <Author><SIEMENS AG - DI FA S SUP SPH COM></Author> <AddInVersion>V18</AddInVersion> <Description>Automatically create user modelled interfaces for OPC UA servers.</Description> <DisplayInMultiuser /> <Product> <Name>OPC UA - User modelled interface</Name> <Id>tia_add_in_opc_ua_interface</Id> <Version>1.1.0</Version> </Product> <FeatureAssembly> <AssemblyInfo> <Assembly>AddInOpcUaInterface.dll</Assembly> </AssemblyInfo> </FeatureAssembly> <AdditionalAssemblies> <AssemblyInfo> <Assembly>AddInOPCUAInterface.UI.dll</Assembly> </AssemblyInfo> </AdditionalAssemblies> <!--Please check required permissions--> <RequiredPermissions> <TIAPermissions> <TIA.ReadWrite/> </TIAPermissions> <SecurityPermissions> <System.Security.Permissions.SecurityPermission.UnmanagedCode/> <System.Security.Permissions.FileDialogPermission/> <System.Security.Permissions.UIPermission/> <System.Security.Permissions.MediaPermission/> <System.Security.Permissions.FileIOPermission/> </SecurityPermissions> </RequiredPermissions> </PackageConfiguration>
For TIA V17:
<PackageConfiguration xmlns="http://www.siemens.com/automation/Openness/AddIn/Publisher/V17"> <Author><SIEMENS AG - DI FA S SUP SPH COM></Author> <AddInVersion>V17</AddInVersion> <Description>Automatically create user modelled interfaces for OPC UA servers.</Description> <DisplayInMultiuser /> <Product> <Name>OPC UA - User modelled interface</Name> <Id>tia_add_in_opc_ua_interface</Id> <Version>1.1.0</Version> </Product> <FeatureAssembly> <AssemblyInfo> <Assembly>AddInOpcUaInterface.dll</Assembly> </AssemblyInfo> </FeatureAssembly> <AdditionalAssemblies> <AssemblyInfo> <Assembly>AddInOPCUAInterface.UI.dll</Assembly> </AssemblyInfo> </AdditionalAssemblies> <!--Please check required permissions--> <RequiredPermissions> <TIAPermissions> <TIA.ReadWrite/> </TIAPermissions> <SecurityPermissions> <System.Security.Permissions.SecurityPermission.UnmanagedCode/> <System.Security.Permissions.FileDialogPermission/> <System.Security.Permissions.UIPermission/> <System.Security.Permissions.MediaPermission/> <System.Security.Permissions.FileIOPermission/> </SecurityPermissions> </RequiredPermissions> </PackageConfiguration>
OPC UA communication:
Openness API: