Siemens SIMATIC S7-1200 Manual

Siemens SIMATIC S7-1200 Manual

Controlling several fans (ebm-papst) via modbus rtu
Hide thumbs Also See for SIMATIC S7-1200:

Advertisement

Quick Links

Controlling
several fans
(ebm-papst)
via Modbus RTU
SIMATIC S7-1200
https://support.industry.siemens.com/cs/ww/en/view/109476801
Siemens
Industry
Online
Support

Advertisement

Table of Contents
loading

Summary of Contents for Siemens SIMATIC S7-1200

  • Page 1 Controlling several fans (ebm-papst) via Modbus RTU Siemens SIMATIC S7-1200 Industry Online https://support.industry.siemens.com/cs/ww/en/view/109476801 Support...
  • Page 2: Legal Information

    The foregoing provisions do not imply any change in the burden of proof to your detriment. You shall indemnify Siemens against existing or future claims of third parties in this connection except where Siemens is mandatorily liable.
  • Page 3: Table Of Contents

    Table of Contents Table of Contents Legal information ..................... 2 Task......................... 5 Overview ................... 5 Solution......................6 Overview ................... 6 Description of the core functionality ............ 7 Hardware and software components ..........9 2.3.1 Validity ....................9 2.3.2 Components used ................9 Mode of Operation ..................
  • Page 4 Table of Contents Diagnostics ..................45 Settings ................... 45 5.8.1 System time/PLC ................46 System time ..................46 PLC operating state ................. 46 FB “EbmPapst” ................47 5.8.2 Brightness ..................47 5.8.3 User display..................47 5.8.4 System .................... 47 Appendix ....................... 48 Service and Support ................
  • Page 5: Task

    1 Task Task Overview Introduction ebm-papst offers fans with an integrated RS485 interface that can be controlled via the Modbus RTU protocol. These fans are to be connected to a SIMATIC PLC, monitored and controlled. Overview of the automation task The figure below provides an overview of the automation task.
  • Page 6: Solution

    Modbus fans Configuration A SIMATIC S7-1200 CPU with firmware V4.2.1 is used as the controller. It exchanges the motor data with up to 32 ebm-papst fans sequentially using the serial communication board CB 1241 RS485 via the Modbus RTU data protocol.
  • Page 7: Description Of The Core Functionality

    2 Solution Description of the core functionality The application example's core functionality is the operation of the ebm-papst fan using the HMI. Overview and description of the user interface Figure 2-2 The application example can be operated using the following 2 displays: ...
  • Page 8 (see chapter 6.3). Assumed knowledge Basic knowledge and experience with the following subjects are required for this application example:  SIMATIC S7-1200 controller family  TIA Portal engineering interface  MODBUS-RTU communication protocol Controlling several fans (ebm-papst) via Modbus RTU Entry ID: 109476801, V2.0,...
  • Page 9: Hardware And Software Components

    Validity This application example is valid for  STEP 7 V15 or higher (TIA Portal)  SIMATIC S7-1200 with firmware V4.2.1 or higher 2.3.2 Components used The application example has been created with the following components: Hardware and software components...
  • Page 10: Mode Of Operation

    3 Mode of Operation Mode of Operation General overview Figure 3-1 shows the chronological sequence of the block calls in the control part of the TIA Portal project. Figure 3-1 Register Send_ Config [FB611] Modbus_ MAIN Comm_Load EbmPapst [OB 1] [FB640] Receive_ Config...
  • Page 11: Tab

    3 Mode of Operation  “SERIALIZE” [FB890] to convert words into an array of bytes and subsequent output as a string The FB "LGF_Impulse" is from the general function library (\4\) and updates the register entries of the fan to be displayed in the “fan view" HMI display in the specified interval.
  • Page 12: Input Register

    3 Mode of Operation Address Length Designation Write Reset Password required required hex. dec. D150 53584 Shedding function D151 53585 Max. starting modulation level D152 53586 Number of start attempts D153 53587 Relay drop-out delay D15B 53595 Emergency operation running direction D15C 53596...
  • Page 13: Plc Data Types

    3 Mode of Operation PLC data types 3.3.1 "typeCyclic" The PLC data type “typeCyclic” includes the order of the data to be exchanged. Table 3-3 Name Data type Description last Last field element to be edited data Order of the data to exchange Array[0..9] of "typeData"...
  • Page 14: Typehmi

    3 Mode of Operation 3.3.4 "typeHMI" The PLC data type “typeHMI” contains information about the visibility display in the HMI. Table 3-6 Name Data type Description unit "typeUnit" Includes information about the correct representation of the setpoint unit (“1/min” or “%”) buttonInvisible Bool Hides the write and “read all”...
  • Page 15: Typeproductiondata

    3 Mode of Operation 3.3.6 "typeProductionData" The PLC data type “typeProductionData” includes the fan's manufacturing data. Table 3-8 Name Data type Description serialNumber String[4] Fan serial number (consecutive number) productionDate "typeProductionDate" PLC data type with the fan's production date (year/week) fanType String[12] Fan type (designation)
  • Page 16: Fb "Ebmpapst

    3 Mode of Operation FB “EbmPapst” This function block was especially developed for serial communication with several fans from ebm-papst via the Modbus RTU data protocol (based on the MODBUS parameter specification for “ebm-papst series 84 / 112 / 150 / 200” V5.00). It is called in the cyclic organization block “Main”.
  • Page 17 3 Mode of Operation Name P type Data type Comment lastFan IN_OUT USInt Last fan to be addressed (is limited by the FB: 1 ≤ lastFan ≤ FAN_MAX) read IN_OUT "typeRead" PLC data type to read a register write IN_OUT "typeWrite"...
  • Page 18 3 Mode of Operation Program workflow shows the schematic structure of the FB “EbmPapst”. Figure 3-3 Figure 3-3 read Index Cyclic readAll Index Acyclic read write mode Index write Read Register mode write Index = 104 Index The sequence for reading the input registers of each fan is processed cyclically as a function of the running index “IndexCyclic”.
  • Page 19 3 Mode of Operation With read access, the read data are successively (“RegisterIndex”) written into the corresponding register file (“Index”) of the addressed fan depending on the access mode:  Interface parameter “holding” for the holding registers (“mode” = 0) ...
  • Page 20: Fc "Readwrite

    3 Mode of Operation FC “ReadWrite” This function gives individual access to all registers of an ebm-papst fan. To operate the block, you have to be familiar with the MODBUS parameter specification for “ebm-papst series 84 / 112 / 150 / 200” V5.00. The FC “ReadWrite is only functional in connection with the FB “EbmPapst”.
  • Page 21: Mode Of Operation

    3 Mode of Operation Name P type Data type Comment FC “ReadWrite” was completed with errors (active for one error Bool cycle) Status evaluation (error code) of FC “ReadWrite” errorStatus Word fanNumber IN_OUT USInt Fan to be addressed (is limited by the FC: 1 ≤ fanNumber ≤ lastFan) Request of manual access via FC “ReadWrite”...
  • Page 22 3 Mode of Operation The task is transmitted to the FC “ReadWrite” via the following input parameters:  "fanNumber" = 2  “holding” = “TRUE” (register type: holding register)  “write” = “FALSE” (access type: read)  “addr” = 53512 (corresponds to 16#D108) ...
  • Page 23 3 Mode of Operation Figure 3-6 Controlling several fans (ebm-papst) via Modbus RTU Entry ID: 109476801, V2.0, 09/2018...
  • Page 24: Sequential Call Of Fc "Readwrite

    3 Mode of Operation Sequential call of FC “ReadWrite” 3.5.2 To execute several register accesses successively, the parameters have to be handed to the FC “ReadWrite” in the form of a sequencer. In the OB “Main” this is presented in networks 4 through 7. Task The following actions are to be performed successively: 1.
  • Page 25 3 Mode of Operation Figure 3-8 Start/Stop Network 4 start fanNumber := 1 holding := FALSE write := FALSE addr := 16#D015 len := 1 Network 7 Req := TRUE done Processing received data fanNumber := 2 holding := TRUE write := FALSE addr := 16#D108 len := 6...
  • Page 26: Installation And Commissioning

    4 Installation and Commissioning Installation and Commissioning The application example was set up using a CPU 1214C and a 1241 RS485 communication board. If you are using a different CPU, please follow the instructions in chapter 4.3.1. Instead of the CB 1241 RS485 communication board you can also use the CM 1241 RS422/485 communication module to communicate with the ebm-papst fan (here: "VarioDrive C") (\3\).
  • Page 27: Network Connections

    4 Installation and Commissioning Network connections To configure the controller and the HMI, the LAN network card of the programming unit needs a static IP address. The configuration of the LAN connection is described in the following. Table 4-2 Action Remark Click “Start >...
  • Page 28: Setting The Pg/Pc Interface

    4 Installation and Commissioning Action Remark  Choose “Use the following IP address”.  Select an IP address in the CPU's subnet mask.  Confirm the settings with “OK” and “Close”. 4.2.1 Setting the PG/PC interface Table 4-3 Action Remarks Open the PG/PC interface settings via “Start >...
  • Page 29: Configuration Instructions

    4 Installation and Commissioning Configuration instructions 4.3.1 Adjusting the device configuration Table 4-4 Action Remarks Network the S7-1200 controller with your Configuring the CPU for communication: programming unit. S7-1200 manual (\8\)→ Chapter 6.9 Assign the IP addresses specified in Figure Open the project file (ap15) with STEP 7 V15.
  • Page 30: Downloading The Controller Project Part

    4 Installation and Commissioning Action Remarks Open the “User constants” register and increase “FAN_MAX” to the maximum number of fans to be operated. This expands the array "fan" and therefore also the RAM usage of the CPU project. Note: When decreasing “FAN_MAX” (<...
  • Page 31: Hmi Project Part

    4 Installation and Commissioning HMI project part Expanding the “Overview” display 4.4.1 In the “Fan view” display, the data of the fan to be displayed are copied to the Register".fan[0] placeholder by selecting the respective fan. In doing so, you can visualize the data of each fan.
  • Page 32 4 Installation and Commissioning Action Remarks The “Find and replace” option of the “Jobs” task card opens.  Enter the following: – Find: [4] (existing fan reference) – Replace: [5] (new fan reference)  Confirm with “Replace all”. The entries will now reference the PLC tags of the new fan (prerequisite: The user constant "FAN_MAX"...
  • Page 33 4 Installation and Commissioning Figure 4-2 Table 4-8 Object Reference TextField_FanNumber_x Properties > General > Tag: x I/Ofield_Warning_x Properties > General > Process > Tag: Register_fan{x}_input{53266}_uint Properties > Animations > Display > Layout > Tag: Register_fan{x}_input{53266}_uint I/Ofield_MotorStatus_x Properties > General > Process > Tag: Register_fan{x}_input{53265}_uint Properties >...
  • Page 34: Configuring The Hmi

    4 Installation and Commissioning Object Reference I/Ofield_SetValue_x Properties > General > Process > Tag: Register_fan{x}_input{53274}_real SymbolicI/Ofield_Unit_x Properties > General > Process > Tag: Register_fan{x}_input{53274}_calc SymbolicI/Ofield_ParamSet_x Properties > General > Process > Tag: Register_fan{x}_input{53277}_uint I/Ofield_Power_x Properties > General > Process > Tag: Register_fan{x}_input{53281}_real I/Ofield_SensorValue1_x Properties >...
  • Page 35: Downloading The Hmi Project Part Into The Ktp900 Basic

    4 Installation and Commissioning Action Remarks  Disable the option “DHCP”.  Enter the network setting from Figure 4-1 for the HMI: – IP address: 192.168.0.2 – Subnet mask = 255.255.255.0 “Default gateway” is irrelevant. –  Select “Auto negotiation” in the Ethernet parameters to automatically determine the speed transmission.
  • Page 36: Starting The Pc Runtime

    4 Installation and Commissioning Action Remarks  If necessary, activate the option “Overwrite all”.  Click the “Load” button.  Depending on the operator panel settings, you may have to trigger the transfer by clicking the “Transfer” button in the Start Center of the KTP900 Basic.
  • Page 37: Operating The Application Examples

    Intro (home screen) The home screen provides information about the current topic. It presents the control of several fans from ebm-papst with the SIMATIC S7-1200 product family using Modbus RTU. The used system functions “Modbus_Comm_Load” and “Modbus_Master” V3.1 are available in the SIMATIC S7-1200 controller from CPU firmware V4.2 in connection with STEP 7 (TIA Portal)
  • Page 38 5 Operating the Application Examples Figure 5-2  takes you to the home screen (this display).  takes you to the overview of fans screen (Figure 5-6).  takes you to the fan view (Figure 5-7).  takes you to the alarm buffer (Figure 5-9).
  • Page 39: Recurrent Display Elements

    5 Operating the Application Examples Recurrent display elements The following subchapters describe the recurrent display elements available both in the “Overview” and in the “Fan view” display: 5.2.1 Cyclically retrieved values (input registers) The upper part of the display shows the most important input registers (in green) which are read cyclically.
  • Page 40: Writing To The Holding Registers

    5 Operating the Application Examples 5.2.2 Writing to the holding registers The holding registers (purple font) are written according to the selection of the corresponding register in the drop-down menu. Depending on the selected display, you can access all writable registers from in the “Fan view”...
  • Page 41: Default Settings To Operate The Application Example

    5 Operating the Application Examples Default settings to operate the application example Starting from the factory settings of the interface parameter settings, Table 5-1 Address Designation Value D100 Fan address D149 Transfer rate 19200 bit/sec D14A Parity configuration the following default settings of the holding registers have to be made for the application example to run smoothly: When operating several fans, make sure that only one fan with Modbus address 1 can be reached by the S7-1200 at once.
  • Page 42: Overview

    5 Operating the Application Examples Table 5-3 Code Text Cause 16#80C8 The slave does not respond Disturbed connection to the fan (e.g. within the set time missing voltage supply of fan) 16#8388 Error in the response of the Missing password authorization to write slave to a write request the selected holding register “Modus RTU Instructions”...
  • Page 43 5 Operating the Application Examples Figure 5-7 The drop-down menu in the dialog for writing to the holding registers provides access to all writable holding registers (see Table 3-1). Additionally, you can read all other non-writable registers (blue background) of all fans to be addressed (1 to "Tags".ebmPapst.lastFan) using the button: ...
  • Page 44: Alarm Buffer

    5 Operating the Application Examples Alarm buffer This display lists the following alarm messages including time stamp and status in text form as alarm buffer:  System alarms (marked by a prefixed “$”)  Motor status of the individual fans (input register D011 – marked by a prefixed “!”...
  • Page 45: Diagnostics

    5 Operating the Application Examples Diagnostics The “System diagnostics” display shows the system diagnostics buffer of the S7-1200 controller. Figure 5-10 Settings The settings menu contains the dialogs  System time / PLC  Brightness  User  System Controlling several fans (ebm-papst) via Modbus RTU Entry ID: 109476801, V2.0, 09/2018...
  • Page 46: System Time/Plc

    5 Operating the Application Examples Figure 5-11 The user currently logged-on is displayed: to select “German” as the display language. Click to select “English” as the display language. Click Click to exit the HMI runtime. 5.7.1 System time/PLC System time The application example has a time synchronization between PLC and HMI.
  • Page 47: Fb "Ebmpapst

    5 Operating the Application Examples In the PLC mode , the header and side bar alternately flash orange: FB “EbmPapst” Click the button to reset the sequencer of the function block “EbmPapst”. 5.7.2 Brightness Allows you to regulate the brightness in percent (setting range: 30 to 100%) of the operator panel (only possible when using a real HMI).
  • Page 48: Appendix

    Industry Online Support Do you have any questions or need support? Siemens Industry Online Support offers access to our entire service and support know-how as well as to our services. Siemens Industry Online Support is the central address for information on our products, solutions and services.
  • Page 49: Links And Literature

    Link to the entry page of the application example https://support.industry.siemens.com/cs/ww/en/view/109476801 How can you read input words in the address range from 9999 to 65535 with the SIMATIC S7-1200 via Modbus RTU? https://support.industry.siemens.com/cs/ww/en/view/109474481 Library with general functions for (LGFP) for STEP 7 (TIA Portal) and S7-1200 / S7- 1500 https://support.industry.siemens.com/cs/ww/en/view/109479728...

Table of Contents