The HART Module 750-482 on the WAGO ETHERNET Controller Application Note, English Version 1.0.0
2 General Copyright 2015 by WAGO Kontakttechnik GmbH & Co. KG All rights reserved. WAGO Kontakttechnik GmbH & Co. KG Hansastraße 27 D-32423 Minden Phone: +49 (0) 571/8 87 0 Fax: +49 (0) 571/8 87 1 69 Email: Web: info@wago.com http://www.wago.com Technical Support Phone: +49 (0) 571/8 87 5 55 Fax: +49 (0) 571/8 87 85 55 Email: support@wago.com Every conceivable measure has been taken to ensure the accuracy and completeness of this documentation. However, as errors can never be fully excluded, we always appreciate any information or suggestions for improving the documentation. We wish to point out that the software and hardware terms, as well as the trademarks of companies used and/or mentioned in the present manual, are generally protected by trademark or patent.
Contents 3 TABLE OF CONTENTS 1 Important Notes 4 1.1 Legal Principles 4 1.1.1 Copyright 4 1.1.2 Personnel Qualification 4 1.1.3 Intended Use 4 1.2 Scope of Validity 5 1.3 Symbols (erase symbols that are no longer required) 5 2 Description 6 2.1 Components 6 3 Execution of Local HART Commands 7 4 Device-specific HART Commands 11 5 Parameter Setting using FDT/DTM 14 5.1 HART Module on the WAGO ETHERNET Controller 14
4 Important Notes 1 Important Notes 1.1 Legal Principles 1.1.1 Copyright To ensure fast installation and start-up of the units, we strongly recommend that the following information and explanations are carefully read and adhered to. This document, including all figures and illustrations contained therein, is subject to copyright. Any use of this document that infringes upon the copyright provisions stipulated herein is prohibited. Reproduction, translation, electronic and phototechnical filing/archiving (e.g., photocopying), as well as any amendments require the written consent of WAGO Kontakttechnik GmbH & Co. KG, Minden, Germany. Non-observance will entail the right of claims for damages. WAGO Kontakttechnik GmbH & Co. KG reserves the right to make any alterations or modifications that serve to increase the efficiency of technical progress. WAGO Kontakttechnik GmbH & Co. KG owns all rights arising from granting patents or from the legal protection of utility patents. Third-party products are always mentioned without any reference to patent rights. Thus, the existence of such rights cannot be excluded. 1.1.2 Personnel Qualification 1.1.3 Intended Use The use of the product described in this document is exclusively geared to specialists having qualifications in PLC programming, electrical specialists or persons instructed by electrical specialists who are also familiar with the appropriate current standards. WAGO Kontakttechnik GmbH & Co. KG assumes no liability resulting from improper action and damage to WAGO products and third-party products due to non-observance of the information contained in this document. For each individual application, the components are supplied from the factory with a dedicated hardware and software configuration. Modifications are only admitted within the framework of the possibilities documented in this document. All other changes to the hardware and/or software and the nonconforming use of the components entail the exclusion of liability on part of WAGO Kontakttechnik GmbH & Co. KG. Please send your requests for modified and new hardware or software configurations directly to WAGO Kontakttechnik GmbH & Co. KG.
Important Notes 5 1.2 Scope of Validity This application note is based on the stated hardware and software from the specific manufacturer, as well as the associated documentation. This application note is therefore only valid for the described installation. New hardware and software versions may need to be handled differently. Please note the detailed description in the specific manuals. 1.3 Symbols (erase symbols that are no longer required) DANGER Always observe this information to protect persons from injury. NOTICE Always observe this information to prevent damage to the device. NOTE Guidelines that must always be observed to ensure smooth operation. ESD (Electrostatic Discharge) Warning of damage to the components through electrostatic discharge. Observe precautionary measures for handling components at risk of electrostatic discharge. Note Routines or advice for efficient use of a device and software optimization. Additional Information References to additional literature, manuals, data sheets and INTERNET pages.
6 Description 2 Description This application note describes the connection of any HART sensor to the WAGO ETHERNET Controller 750-841 using the TH102 from ABB, for example. The connection is made via the HART Module 750-482 and Wago- LibHART_03.lib CODESYS library. In addition to function blocks for local execution of HART commands, the WagoLibHART_03.lib library contains a program that works together with the WAGO Modbus TCP DTM and that allows parameterization of the HART sensor from any FDT/DTM frame applications. Section 3 describes the creation of a PLC program that reads and processes data from the HART sensor cyclically. Section 4 describes the execution of device-specific HART commands, e.g., Promag23 from Endress&Hauser. Section 5 describes the parameterization of the HART sensor from the FDT/DTM frame application WAGOframe. 2.1 Components The application note is created and tested based on the use of the listed components. Designation Item No. Version Manufacturer CODESYS: WAGO-I/O-PRO CAA 759-2.3.9.3 WAGO Library: WagoLibHART_03-3.1 WAGO ETHERNET Controller 750-841 FW: 02.12.02(14) WAGO HART module: 2AI 4-20mA HART 750-482 FW:(19) WAGO HART sensor: TH102 TH102 SW:1.10 ABB HART sensor: Promag 23 Promag 23 Endress&Hauser FDT frame: WAGOframe 759-1.0.1 WAGO Communication DTM: WAGO Modbus TCP DTM 759-1.0.0 WAGO Gateway DTM: WAGO 075x-08xx Modbus TCP/HART Gateway 759-1.0.0 WAGO Device DTM: ICS Generic HART DTM - 3.1.10 ICS
Execution of Local HART Commands 7 3 Execution of Local HART Commands This section describes the creation of a PLC program step by step that executes Universal HART Command 3 (Reed all variables) cyclically and displays the data read in a visualization. Open the example project WagoLibHART03_Example01.pro. Alternatively, proceed as follows: 1.) Open CODESYS V2.3. 2.) In the File menu, select the New menu item to create a new project. 3.) Select WAGO_750-841_(FW12-..) as the target system. 4.) Select FUP as the programming language for PLC_PRG. 5.) Open the library manager via the menu Window -> Library Management. 6.) From the background menu of the window (top left), select the Other Library menu item and navigate to the Application folder in the file dialog. Select WagoLibHART_03.lib and close the dialog by clicking the Open button. 7.) Double-click PLC_PRG in the Modules window to open the FUP Editor to input the PLC program. 8.) Open the background menu of the instruction window and select the Mod-
8 Execution of Local HART Commands ule entry. As a result, an AND module is added in Network 1. Overwrite the module name with HART_INFO to add the program call for identification and access management of up to eight HART modules to your PLC program. 9.) Add the following variables to the project in the declaration window: (* Identification of HART modules and access synchronization*) xinforeset : BOOL; dwinfoerror: DWORD; sinfostatus: STRING; 10.) Apply the inputs and outputs of the HART_INFO module to the variables just declared. Set the xstart input to TRUE directly. To apply dwerror to the output, first select the Assignment entry from the background menu. 11.) Now add other networks and modules according to the example. 12.) Initialization of the bmodule and bchannel depends on your node structure. The bmodule parameter corresponds to the position of the 2- channel analog input modules (750-482) after the fieldbus coupler. 13.) In the Project menu, select the Clear all entry to clear all temporary data. In the same menu, then select the Compile all entry. As a result, 0 errors, 0 warnings should be output in the output window Any errors in the project are displayed in red and described in the output window. Double-click the respective error message to display the relevant line of code in the instruction window. Correct the lines of code as required and compile the project again. 14.) To transfer the PLC program to the controller 750-841, select Communication parameters in the Online menu. Click the New... button in the dialog that opens. Enter a name for the new connection and select Tcp/Ip(3S Tcp/Ip driver) as the device. Apply the entries by clicking OK. In the Value column, doubleclick in the Address row and overwrite localhost with the IP address of your controller 750-841. Make sure that you exit the input field before applying the changes by clicking OK. 15.) To load the PLC program in the controller (750-841) select the Login entry in the Online menu. You are prompted to confirm that you really want to load the program in the controller. Click Yes to confirm. After the program has been loaded in the controller, the editor also switches to online mode and displays current process values. 16.) Select the Start entry in the Online menu to execute the PLC program. 17.) Select the Boot Project entry in the Online menu to write the program permanently to the controller. 18.) To launch the PLC program at PowerOn, move the slide switch of the service interface to the top position. If successful, the example project should appear as follows:
Execution of Local HART Commands 9 A central components of each PLC program that operates with the HART Module 750-482 is the HART_INFO program. The HART_INFO program identifies the connected HART sensors and synchronizes execution of the individual HART commands. The dwerror and sstatus outputs show the current status. In the start-up phase or after a reset, the program searches the node structure for HART modules. The Device ID of the connected sensors is determined for each channel of all modules found with HART Command 0 (Read unique identifier and stored in the g_athartmodules global variables of the library. The Device ID is required to execute all other HART commands. After completing the start-up phase, the program switches to the OPERATIONAL status and enables execution of HART_CMD3.
10 Execution of Local HART Commands In the example, the data read via HART_CMD3 is displayed in a visualization. The visualization also displays the status of the HART_INFO program and statistics of the executed HART-CMD3s. The TH102(ABB) used provides only three HART variables; it declares the specific values of the fourth HART variable. A rising edge at the xstart input is required to execute a HART command. The function block resets xstart after execution. It is recommended to check the dwerror output for the falling edge of xstart. The data in stdata are only valid when dwerror = 0. Access to the individual data in the stdatacmd3 structure occurs with the dot operator (e.g., rmytemp := stcmd3data.rvarsecondary;). The next section will help if you add other HART commands to the program and if a command is not in the library..
Device-specific HART Commands 11 4 Device-specific HART Commands To provide additional functions that go beyond the Universal and Common- Practice Commands, device manufacturers add their own HART commands. Using HART sensor Promag23 from Endress&Hauser as an example, this section shows how to reproduce and execute any HART commands using the HART_CMDCustom function block from the WagoLibHART_03. The starting point is the sensor manual, command number and reference parameters. Specifically: CMD Function Request Data Response Data 174 Read BYTE 0-2 Address (B) 0-2 3 4 174 Read REAL 0-2 Address (B) 0-2 3 4-7 175 Write BYTE 0-2 3 4 175 Write REAL 0-2 3 4-7 Address 0xFB (constant) Value Address 0xFB (constant) Value (B) 0-2 3 4 5 (B) 0-2 3 4-7 8 Address 0xFB (constant) Value Address 0xFB (constant) Value Address 0xFB (constant) Value Checksum Address 0xFB (constant) Value Checksum The listed commands are general access functions to memory locations. Additionally, the memory map is needed to trigger targeted actions in the HART sensor. For Promag23: (B) (B) (F) (B) (B) (F) Memory Map Address Value Access Upper-range value volume flow (value for 20 ma) 16#606701 REAL Read/ Write Unit identification: Volume flow 16#1C6601 BYTE Read/ Write Counter 1 (forward) Address Value Access Unit identification: Mass 16#2C6501 BYTE Read/ Write Unit identification: Volume 16#2C6601 BYTE Read/ Write Counter value 16#2C6E01 REAL Read No. of overruns 16#2C6F01 REAL Read Clear counter value and overruns 16#2C6B01 BYTE Write Counter 2 (backward) Address Value Access Unit identification: Mass 16#2D6501 BYTE Read/ Write Unit identification: Volume 16#2D6601 BYTE Read/ Write Counter value 16#2D6E01 REAL Read No. of overruns 16#2D6F01 REAL Read Clear counter value and overruns 16#2D6B01 BYTE Write
12 Device-specific HART Commands Now, only the encoding map for unit identification is missing: Volume flow: Unit Seconds [s] Minutes [min] Hours [h] Days [day] [cm 3 ] [dm 3 ] [m 3 ] Milliliter [ml] Liter [l] Hectoliter [hl] Megaliter [Ml] 16#00 16#04 16#08 16#0C 16#10 16#14 16#18 16#01 16#05 16#09 16#0D 16#11 16#15 16#19 16#02 16#06 16#0A 16#0E 16#12 16#16 16#1A 16#03 16#07 16#0B 16#0F 16#13 16#17 16#1B Mass: Unit Code Gram [g] Kilo [kg] Tonne [t] 16#00 16#01 16#08 Volume: Unit Code [cm 3 ] [dm 3 ] [m 3 ] Milliliter [ml] Liter [l] Hectoliter [hl] Megaliter [Ml] 16#00 16#01 16#02 16#03 16#04 16#05 16#06 If the unit identification of the volume flow is set to Liters per minute [l/min], for example, HART command 175 (WriteByte) is used to write the value 16#11 for [l/min] to memory location 16#1C6601. CMD Function Request Data Response Data 175 Write BYTE 0-2 3 4 0x1C6601(Address) 0xFB (constant) 0x11Value [l/min] (B) 0-2 3 4 5 Address 0xFB (constant) Value Checksum (B) The example WagoLibHART03_Example03.pro shows how you trigger this task using the HART_CMDCustom function block. The project uses the program HART_INFO to identify all connected HART modules and to synchronize access to the process image of the mailbox. The HART_CMDCustom function block can be used to execute any HART command. The sequence: 1.) Create HART command number and Request Data at the module. 2.) Execute command with xstart := TRUE. 3.) Wait until xstart := FALSE and check dwerror. 4.) Evaluate Response Data.
Device-specific HART Commands 13 The abdata and bdatacount inputs declared as VAR_IN_OUT must be parameterized before execution with the Request Data and its byte count. After execution, abdata contains the Response Data and bdatacount contains the number of bytes received. To execute the HART command, go online and set the xdoit variable to TRUE using Write values [Ctrl]+[F7]. In cases like these, where the same HART command can be used for a variety of tasks, it is expedient to create your own function blocks for the basic function. The WagoLibHART03_Example04.pro example provides its own function blocks for Endress&Hauser-specific HART commands 174 and 175. The next step would be the creation of an EH_Promag.lib. For this purpose, only save the project as an Internal Library.
14 Parameter Setting using FDT/DTM 5 Parameter Setting using FDT/DTM Most HART device manufacturers use the FDT/DTM standard for parameterization of their devices. The aim of FDT/DTM is to provide a single application for diagnostics and parameterization of devices from any manufacturer. Such applications are also called FDT containers or FDT frames. WAGO has its own FDT frame with WAGOframe. The FDT frame operates with Device Type Managers (DTMs). 3 groups of DTMs are specified: - Device DTMs - Gateway DTMs - Communication DTMs The device manufacturers provide Device DTMs for their devices, which include the graphical user interface for configuration and diagnostics. Gateway DTMs function as mediators, e.g., between two bus systems such as HART and Modbus TCP. A communication DTM provides a protocol-specific driver, e.g., for Modbus TCP. 5.1 HART Module on the WAGO ETHERNET Controller This section describes how you expand your PLC application with FDT/DTM support using the WagoLibHART_03.lib library. If the HART module 750-482 is on a WAGO ETHERNET controller, communication between the FDT frame and controller occurs via the Modbus TCP protocol. A PLC program is required on the ETHERNET controller that receives the MODBUS requests, extracts the HART commands and forwards to the HART sensor. The WagoLibHART_03.lib library contains the HART_FDT program for this task. In the FDT frame, a Modbus TCP communication DTM and HART/Modbus TCP gateway DTM are required. You can get both DTMs on the WAGO homepage under item number 759-359. Specifically, that is the WAGO_Modbus_TCP_DTM and WAGO_075x- 08xx_DTM. Any HART device DTM can be connected below the HART/Modbus TCP gateway DTM.
Parameter Setting using FDT/DTM 15 The WagoLibHART03_Example05.pro example shows the HART_FDT program in use. The PLC program only functions as a Modbus TCP/HART gateway. The only input parameter is ttimeout that you use to specify when the FDT request is discarded. The bmsgid output displays the ID of the FDT request being processed. If additional local HART commands are executed, then add the required HART_CMD function blocks to the program. Note the polling interval of the local HART commands as they compete with the FDT requests, which can lead to timeouts in the DTM. In other words, make sure that there is enough time for requests from the FDT/DTM. WagoLibHART03_Example06.pro is an example of this application. How to access HART sensors behind a WAGO ETHERNET controller with the FDT/DTM frame application is described separately in Application Note A116101.
WAGO Kontakttechnik GmbH PO Box 2880 D-32385 Minden Hansastraße 27 D-32423 Minden Phone: +49 (0) 571/8 87 0 Fax: +49 (0) 571/8 87 1 69 Email: info@wago.com Online: http://www.wago.com