Infosys在阅读器中打开 / AI 翻译

TE2000 | HMI Engineering · 0 次阅读

Version 1.14

This is the documentation of the new TwinCAT HMI server extension API for .NET.

It's written in C# and targets the .NET Standard 2.0 framework, so it can be referenced in TwinCAT HMI server extensions targeting the classic .NET Framework (version 4.7.2 or higher) as well as .NET Core (version 2.0 or higher) and .NET.
Although it is possible to develop TwinCAT HMI server extensions that use a .NET target framework version that is no longer supported by Microsoft, we do not recommend this because we cannot guarantee that these TwinCAT HMI server extensions will work properly. For more information, see the .NET target framework version support policy.

Important notes

Please pay attention to these notes in order to avoid unnecessary errors when developing and running TwinCAT HMI server extensions:

  • Depending on the .NET target framework (.NET Framework or .NET Core) and platform for which a TwinCAT HMI server extension is built and the type of the operating system (OS) it runs on, the TwinCAT HMI server extension is loaded into different instances of the TcHmiExtensionContainer according to the following table:
  • Target platformAnyCPUx64x86OS type64-bitTcHmiExtensionContainer[.Core]TcHmiExtensionContainer[.Core]TcHmiExtensionContainer[.Core](x86)32-bitTcHmiExtensionContainer[.Core](x86)Running x64 applications on a 32-bit OS is not possibleTcHmiExtensionContainer[.Core](x86)
  • Because your TwinCAT HMI server extensions are loaded into the TcHmiExtensionContainer[.Core][(x86)] process, some assembly references or NuGet packages cannot be updated to a higher or lower version if they are also used by the TcHmiExtensionContainer (e.g. Newtonsoft.Json).
    If you really need a specific version of such an assembly in your TwinCAT HMI server extension, you need to provide the corresponding assembly binding redirection in the application configuration file of the TcHmiExtensionContainer. It is located in the same folder and has the same name as the executable file of the TcHmiExtensionContainer or the DLL (.NET Core) and has the additional file extension .config. Please also pay attention to the notes on the assembly binding redirection section in that application configuration file.
  • To debug your TwinCAT HMI server extension the debugger has to be attached to the TcHmiExtensionContainer[.Core][(x86)] process.
    Release configurations can be debugged by replacing "dotNetConfiguration": "Release" with "dotNetConfiguration": "Debug" in the '*.Config.json' of your TwinCAT HMI server extension.

Getting Started

A reference to TcHmiSrvExtNet.Core.dll will be automatically added to your project if you create a new TwinCAT HMI server extension for .NET.

If you have already created TwinCAT HMI server extension using TwinCAT HMI release 1.10 you may be interested in the API Differences between the former TwinCAT HMI server extension API TcHmiSrvExtNet and TcHmiSrvExtNet.Core.
Or you can take a look at the guide, which will help you How to migrate from TcHmiSrvExtNet to TcHmiSrvExtNet.Core.

Other Resources

.NET target framework version support policy Version History API Differences How to migrate

Copyright © Beckhoff Automation GmbH & Co. KG

Further Information