Field Device Integration (FDI) – Part 6-100: Technology Mapping – .NET FCG TS62769-6-100 Edition 1.2.0 27 Jun 2019 RELEASED S P E C I F I C A T I O N Field Device Integration (FDI) –Part 6-100: Technology Mapping – .NET RELEASED FCG TS62769-6-100 , Ed. 1.2.0, 27 Jun 2019 Page 1 of 23 Document Distribution / Maintenance Control / Document Approval To obtain information concerning document distribution control, maintenance control, and document approval please contact FieldComm Group at the address shown below. Copyright © 2019 FieldComm Group, PROFIBUS Nutzerorganisation e. V., OPC Foundation, FDT Group FieldComm Group, PROFIBUS Nutzerorganisation e.V, OPC Foundation, and FDT Group are the joint publishers of this document. The information in this document is subject to change without notice and should not be construed as a commitment by the publishers. The publishers assume no responsibility for any errors that may appear in this document. In no event shall the publishers be liable for direct, indirect, special, incidental or consequential damages of any nature or kind arising from the use of this document. This document and parts thereof must not be reproduced or copied without written per-mission from the publishers, and the contents thereof must not be imparted to a third party nor used for any unauthorized purpose. All rights to copyrights, registered trademarks or applications, utility models and registered patents or applications reside with their respective owners. Trademark Information FieldComm Group ™ , F OUNDATION ™ Fieldbus and HART-IP ™ are trademarks, and HART ® , WirelessHART ® , ROM ® and SIF ® are registered trademarks of FieldComm Group, Austin, Texas, USA Any use of these terms hereafter in this document, or in any document referenced by this document, implies the trademark/registered trademark. All other trademarks used in this or referenced documents are trademarks of their respective companies. For more information, contact: FDT Group 5 Industrieweg 3001 Heverlee Belgium Phone: +32 (0)10 22 22 51 fdtgroup.org FieldComm Group 9430 Research Boulevard Suite 1-120 Austin, TX 78759, USA Phone: (512) 792-2300 Fax: (512) 792-2310 fieldcommgroup.org OPC Foundation Presidential Office 8455 Infirmary Rd., Ravenna, OH 44266 P.O. Box 808 (mailing address) Mantua, Ohio 44255 Phone: (330) 839-8718 opcfoundation.org PROFIBUS Nutzerorganisation e. V. (PNO) PROFIBUS & PROFINET International (PI) Haid-und-Neu-Str. 7 76131 Karlsruhe Germany Phone: +49 721 96 58 590 Fax: +49 721 96 58 589 profibus.com profinet.com Intellectual Property Rights The FieldComm Group (the Group) does not knowingly use or incorporate any information or data into the HART, F OUNDATION Fieldbus and FDI protocol standards, which the Group does not own or have lawful rights to use. Should the Group receive any notification regarding the existence of any conflicting private IPR, the Group will review the disclosure and either (A) determine there is no conflict; (B) resolve the conflict with the IPR owner; or (C) modify the standard to remove the conflicting requirement. In no case does the Group encourage implementers to infringe on any individual's or organization's IPR. Field Device Integration (FDI) –Part 6-100: Technology Mapping – .NET RELEASED FCG TS62769-6-100, Ed. 1.2.0, 27 Jun 2019 Page 2 of 23 Revision Log Version Date Change Note / History / Reason 1.1.0.1 07 June 2016 New document template, issues fixed, incorporated errata to issue 1813. 1.1.0.2 14 June 2016 Issues 1859, 1860, and 1861 solved; reworked section 4.9.2.3 with new rules to implement new security concept for UIP execution 1.1.0.3 04 July 2016 Issue 1863 solved; reworked section 4.9.2.1 to reflect new security concept for UIP execution. 1.1.0.4 19 Dec 2016 New document template 1.1.0.5 24 Feb 2017 New cover page and trademark information 1.2.0.4 17 Oct. 2018 Added reference to FCG TS10099. Specification of RuntimeIds moved to FCG TS10099. Editorial Changes 1.2.0.5 04 Dec. 2018 Modified sect. 4.1.2 FDI Type Library to reflect new deployment concept based Nuget packages (Balloting comment 874) 1.2.0.6 26 Feb. 2019 Added sect. 4.7.4 Backward compatibility, rephrased sect. 4.1.2 FDI Type Library (Balloting comment 874) 1.2.0.7 27 June 2019 Updated Fig. 1, replaced fdi.dll by fdi.nupkg, editorial changes (Balloting comments 856 - 862, 865 - 869, 872 - 874) Field Device Integration (FDI) –Part 6-100: Technology Mapping – .NET RELEASED FCG TS62769-6-100 , Ed. 1.2.0, 27 Jun 2019 Page 3 of 23 TABLE OF CONTENTS 1 Scope ........................................................................................................................................................... 5 2 Normative references .................................................................................................................................. 5 3 Terms, definitions, abbreviated terms, acronyms and conventions ............................................................... 5 3.1 Terms and definitions .................................................................................................................... 5 3.2 Abbreviated terms and acronyms .................................................................................................. 6 3.3 Symbols ........................................................................................................................................ 6 4 Technical concepts ....................................................................................................................................... 6 4.1 General ......................................................................................................................................... 6 Overview .................................................................................................................... 6 FDI Type Library ......................................................................................................... 6 4.2 UIP representation ........................................................................................................................ 7 4.3 UIP executable representation ...................................................................................................... 7 4.4 UIP executable compatibility rules ................................................................................................ 8 4.5 Allowed .NET CLR versions ............................................................................................................ 8 General ...................................................................................................................... 8 CLR compatibility strategy .......................................................................................... 8 How to identify the .NET target platform of a UIP ....................................................... 9 4.6 UIP Deployment ............................................................................................................................ 9 4.7 UIP Life-cycle .............................................................................................................................. 10 General .................................................................................................................... 10 UIP Assembly activation steps .................................................................................. 10 4.7.2.1 Load ..................................................................................................................... 10 4.7.2.2 Create .................................................................................................................. 10 4.7.2.3 Activate ................................................................................................................ 11 4.7.2.4 External libraries .................................................................................................. 11 4.7.2.4.1 General .............................................................................................. 11 4.7.2.4.2 Loading of external libraries .............................................................. 11 4.7.2.4.3 Loading of shared external libraries ................................................... 11 4.7.2.5 UIP Constructor invocation ................................................................................... 12 UIP Assembly deactivation steps............................................................................... 12 4.7.3.1 Deactivate ............................................................................................................ 12 4.7.3.2 Dispose ................................................................................................................ 12 Backward compatibility ............................................................................................ 12 4.8 Interaction between an FDI Client and a UIP................................................................................ 13 Handling of standard UI elements ............................................................................. 13 Non-blocking service execution ................................................................................ 13 4.8.2.1 FDI Client internal functions ................................................................................. 13 4.8.2.2 UIP internal functions ........................................................................................... 13 4.8.2.3 Non-blocking service execution sequence ............................................................. 14 Field Device Integration (FDI) –Part 6-100: Technology Mapping – .NET RELEASED FCG TS62769-6-100, Ed. 1.2.0, 27 Jun 2019 Page 4 of 23 Blocking service execution ........................................................................................ 14 Cancel service execution .......................................................................................... 15 Threading ................................................................................................................. 16 4.8.5.1 Implementation rules ........................................................................................... 16 Timeout .................................................................................................................... 16 Exception handling ................................................................................................... 17 Type safe interfaces ................................................................................................. 18 Globalization and localization ................................................................................... 18 WPF Control handling ............................................................................................... 18 Win Form handling ................................................................................................... 18 4.9 Security ....................................................................................................................................... 18 General .................................................................................................................... 18 Access permissions ................................................................................................... 19 4.9.2.1 General ................................................................................................................ 19 4.9.2.2 Technology specific UIP permissions and restrictions ............................................ 19 4.9.2.3 Implementation rules ........................................................................................... 19 Code identity concept............................................................................................... 19 5 Interface definition .................................................................................................................................... 20 Figure 1 – FDI Type Library structure.................................................................................................................... 7 Figure 3 – .NET surrogate process ........................................................................................................................ 9 Figure 4 – Identification of Run-time Version ....................................................................................................... 9 Figure 5 – Example snippet of a UIP host config file for the binding redirect ...................................................... 13 Figure 6 – IAsyncPattern based asynchronous service execution example .......................................................... 14 Figure 7 – Blocking service execution example using IAsyncResult based pattern ............................................... 15 Figure 8 – Cancel service processing sequence example ..................................................................................... 15 Figure 9 – Exception source ............................................................................................................................... 17 Table 1 – Base Property Services ........................................................................................................................ 20 Table 2 – Device Model Services ........................................................................................................................ 20 Table 3 – Access Control Services ....................................................................................................................... 20 Table 4 – Direct Access Services ......................................................................................................................... 21 Table 5 – Hosting Services .................................................................................................................................. 21 Table 6 – UIP Services ........................................................................................................................................ 22 Table 7 – Base Data Types .................................................................................................................................. 22 Table 8 – Special Types ...................................................................................................................................... 22 Field Device Integration (FDI) –Part 6-100: Technology Mapping – .NET RELEASED FCG TS62769-6-100 , Ed. 1.2.0, 27 Jun 2019 Page 5 of 23 1 Scope This part of FCG TS62769 specifies the technology mapping for the concepts described in the Field Device Integration (FDI) standard. The technology mapping focuses on implementation regarding the components FDI Client and User Interface Plug-in (UIP) using the Runtime .NET. This runtime is specific only to the WORKSTATION platform as defined in FCG TS62769-4. 2 Normative references The following documents, in whole or in part, are normatively referenced in this document and are indispensable for its application. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies. FCG TS61804 (all parts), Function blocks (FB) for process control and Electronic Device Description Language (EDDL) FCG TS10099, Field Device Integration (FDI) – Technology Management FCG TS62769-1, Field Device Integration (FDI) – Part 1: Overview FCG TS62769-2, Field Device Integration (FDI) – Part 2: FDI Client FCG TS62769-4, Field Device Integration (FDI) – Part 4: FDI Packages FCG TS62769-5, Field Device Integration (FDI) – Part 5: FDI Information Model FCG TS62769-6, Field Device Integration (FDI) – Part 6: Technology Mappings IEC 62541 (all parts), OPC Unified Architecture ISO/IEC 19505-1, Information technology – Object Management Group Unified Modeling Language (OMG UML) – Part 1: Infrastructure ISO/IEC 29500, (all parts) Information technology - Document description and processing languages - Office Open XML File Formats 3 Terms, definitions, abbreviated terms, acronyms and conventions 3.1 Terms and definitions For the purposes of this document, the terms and definitions given in FCG TS62769-1, FCG TS62769-6, as well as the following apply. Application Domain isolated environment where applications execute Assembly reusable, version information providing, and self-describing building block of a CLR application Global Assembly Cache machine-wide code cache that stores Assemblies specifically designated to be shared by several applications Field Device Integration (FDI) –Part 6-100: Technology Mapping – .NET RELEASED FCG TS62769-6-100, Ed. 1.2.0, 27 Jun 2019 Page 6 of 23 Windows Registry system-defined database in which applications and system components store and retrieve configuration data 3.2 Abbreviated terms and acronyms For the purposes of this document, the abbreviated terms and acronyms given in FCG TS62769-1, FCG TS62769- 6, as well as the following apply. MSI Microsoft Installer WPF Windows Presentation Foundation UML Unified Modeling Language 3.3 Symbols Figures in this document use the graphical symbols according to ISO/IEC 19505-1, (UML 2.0). 4 Technical concepts 4.1 General Overview In 4.1.2, 4.2, 4.3, 4.4, and 4.5, this document describes the technology base for UIP implementation based on the runtime .NET Framework CLR4, the hardware and software environment including the related implementation rules. Clause 4 follows a lifecycle (use case) oriented approach. Subclause 4.6 describes the copy deployment procedures and related implementation rules for the UIP and the FDI Client. UIP executable instantiation and termination is described in 4.7. Subclause 4.8 defines the rules about interaction between the FDI Client and the UIP. Security related definitions are written in 4.9. The service interface definitions for the FDI Client and the UIP are found in Clause 5. FDI Type Library The Device Access Services and the UIP Services can be modelled as .NET interfaces passing .NET data type arguments. These interfaces and data types are used for the data exchange and interaction between the UIP and the FDI Client. For runtime error handling purposes during interface method calls .NET exceptions classes are defined. The FDI .NET interfaces, data types, and exception classes are defined in a single FDI Type Library. The FDI Type Library is provided within a Nuget Package, which contains one or more strong named assemblies. The file name of this Nuget Package shall be Fdi.<version>.nupkg. The FDI Type Library shall be versioned as per FCG TS62769-1 – section 8.1. The FDI Type Library is part of the FDI Core Technology as per FCG TS62769-1 – section 8.3.2.1. Therefore, it directly influences the FDI Technology Version. All compatible changes of the FDI Type Library lead to an increase of the minor portion of the FDI Technology Version. Incompatible changes lead to an increase of the major portion of the FDI Technology Version (see FCG TS62769-1 – section 8.3.2.2). The version information of the FDI Type Library can be found in FCG TS10099. The FDI Type Library is signed with a single unique key by the issuer of the file. The FDI Type Library shall be installed separately as part of every FDI Client installation. User Interface Plug-Ins (UIP) and the FDI Client Application shall use this instance of the FDI Type Library. UIPs shall not carry or deploy the FDI Type Library. The FDI Client is responsible to provide means to allow updates of this type library over time. Field Device Integration (FDI) –Part 6-100: Technology Mapping – .NET RELEASED FCG TS62769-6-100 , Ed. 1.2.0, 27 Jun 2019 Page 7 of 23 Figure 1 shows the FDI Type Library structure. Figure 1 – FDI Type Library structure NOTE The composite structure diagram shows only the core interfaces that implement the interfaces defined in FCG TS62769-2. 4.2 UIP representation The UIP Variant can contain either a single or multiple runtime modules (.NET Assembly) and their related supplementary files (for example: resource files). The runtime module of the UIP Variant is called UIP executable. The supplementary file(s) of the UIP Variant is/are called UIP supplement(s). UIP supplement(s) is/are stored under (a) subfolder(s) of the UIP executable installation directory EXAMPLE Examples of UIP supplementary data files include resource files and application configuration data. The supported RuntimeIds and .NET Framework versions for a specific FDI Technology Version are specified in FCG TS10099 FDI Technology Management. The UIP Variant shall be self-contained. All UIP required libraries (.NET Assemblies) required by a UIP Variant are stored within the same Folder. 4.3 UIP executable representation The implementation of the UIP depends on the type of user interface elements that can be embedded into the user interface hosting environment of the FDI Client. UIP shall be implemented as a .NET System.Windows.Forms class UserControl or a WPF System.Windows.Controls class UserControl . UIP executables and their required libraries shall have strong names. The signing of a strong named Assembly can be done using a self-generated key. NOTE The identity of strong named Assemblies consists of a name, version, culture, public key token and digital signature. UIP executables and their required libraries shall be shipped with file containing the public key in order to enable Assembly verification. Field Device Integration (FDI) –Part 6-100: Technology Mapping – .NET RELEASED FCG TS62769-6-100, Ed. 1.2.0, 27 Jun 2019 Page 8 of 23 4.4 UIP executable compatibility rules The compatibility rules for different versions of the UIP component are specified in FCG TS62769-4. The compilation target platform for the UIP shall be “anyCPU”. If this is not feasible the UIP shall be shipped in two variants. One UIP variant shall be compiled for target platform “x86”. The second UIP variant shall be compiled for target platform “x64”. The compilation platform target shall be described in the catalog.xml file which is defined in FCG TS62769-4. This catalog.xml file contains an xml element “CpuInformation” that describes the User Interface Plug-in variant. The allowed values that shall be used in the xml element “CpuInformation” are “anyCPU”, “x86” or “x64”. 4.5 Allowed .NET CLR versions General Specific CLR versions are released for the execution of software components built with specific .NET Framework versions. The .NET CLR version 4.0 is used to execute software components built with .NET Framework 4.0. .NET Components are built for one CLR version only but can be capable to run also under a newer CLR version. FDI Clients can be built based on CLR version 4.0 or future versions. An FDI Client has to realize the following situations when starting a UIP. • When the UIP to be started was built for the same run-time, the UIP can be started in the FDI Client as usual. • When the UIP to be started was built with another CLR version and is not compiled for the current running CLR version, the FDI Client shall start the UIP in a surrogate process with the adequate CLR version. (More details are described in 4.5.2.) Taking this behavior in account, a UIP shall be developed for CLR version 4.0 or any future version. In case the CLR versions do not match, the UIP shall be started in a separate process. The UIP will then not be displayed as an integrated module within the FDI Client. It is up to the FDI Client to realize the surrogate process. CLR compatibility strategy In the future, FDI Clients and UIPs will be permitted to be built on different incompatible versions of the CLR. If an FDI Client detects that a UIP requires a CLR that is not compatible with the FDI Client, the FDI Client can use a proxy class that enables interaction with the UIP built using a different version of the CLR. The FDI Client loads a proxy UIP executable, creates an instance of the proxy class, and delegates the execution of the UIP to this proxy. The proxy starts a process with the required CLR and executes the UIP in this surrogate process. The proxy classes provide the standard FDI interfaces. The FDI Client can use these interfaces to interact with the UIP executed in the surrogate process. Next >