The HMI Server can be extended with so-called server extensions like an alarms & events system or a recipe management system. Server extensions can also be developed in .NET with a software development kit, which allows users to develop their own logic and implement additional communication protocols.
Many existing server extensions are available via the NuGet package manager. To load your custom server extension or one of the sample extensions contained in this repository, please follow these steps:
-
Open the Visual Studio solution file (.sln) of the server extension sample project
-
Build the server extension project by right-clicking the project
-
Add a TwinCAT HMI project to the solution
-
Add reference of the server extension by right-clicking of the "References" node of the HMI project
-
Activate the server extension by enabling the checkbox
-
Check status of the extension by unfolding the "Server" node of the HMI project
- A green arrow is displayed if the extension is loaded
- A red arrow is displayed in case of an error. For more information, check the error list of Visual Studio and the server configuration page.
There are two ways to attach to the extension process to debug your .NET server extension.
-
Right-click on the active server extension and select "Attach to Extension":
-
You can now place breakpoints and debug the extension
This way also works if the extension project is not in the current solution or if you want to debug an extension that is running in a remote server.
-
Attach to the "TcHmiExtensionContainer" process:
-
You can now place breakpoints and debug the extension
The HMI server generates a configuration page for every server extension. It can be used to edit the persistent configuration variables. There are several ways to access the configuration page of an extension.
-
Find the HMI server icon in the taskbar notification area:
-
Open the configuration page in a web browser:
-
Go to the respective tab to open the configuration page of your extension:
The package management in TwinCAT HMI version 1.12 is based on the NuGet package management system. This makes it possible to export the TwinCAT HMI components into a NuGet package.