You are on page 1of 62

SIMATIC S7 - OPEN MODBUS / TCP Communication via the integrated PN interface of the PLC

Manual

Preface, Table of Contents Product Description Getting Started

1 2 3 4 5 6 7 8

SIMATIC S7
Commissioning

S7 OPEN MODBUS / TCP Communication via the integrated PN interface of the PLC
Manual

Parameterization Licensing FB MODBUSPN Diagnosis Sample Application Appendices Literature Glossary

Edition 2.1

Safety Precautions and Warnings

This manual contains warnings, which you should note for your own safety as well as for the prevention of damage to property. These warnings are indicated by means of a warning triangle and are displayed as follows in accordance with the level of danger: __________________________________________________________________
Danger indicates that loss of life, severe personal injury or substantial damage will result if proper precautions are not taken.

__________________________________________________________________ __________________________________________________________________
Warning indicates that loss of life, severe personal injury or substantial damage can result if proper precautions are not taken.

__________________________________________________________________ __________________________________________________________________
Caution indicates that minor personal injury or property damage can result if proper precautions are not taken.

__________________________________________________________________ __________________________________________________________________
Note represents an important information especially significant to the product, handling of the product or a specific part of this documentation.

__________________________________________________________________
Qualified Personnel The start-up and the operation of the device may only be carried out by qualified personnel. Qualified personnel in the sense of the security advices of this manual are any persons authorized to commission, ground and label devices, systems and electric circuits. Please note: _________________________________________________________________________ Warning This device may only be used for applications as prescribed in the catalogue and the technical description. Furthermore, they may only be used in conjunction with third-party devices and components recommended and authorized by Siemens. A successful and safe operation of this product is depends on proper transport, and correct storage, installation and assembly as well as careful operation and maintenance.

Use as prescribed

SIMATIC and SIMATIC NET are registered trademarks of SIEMENS AG. Trademarks Since any other brand names in this manual may refer to trademarks, the use of these names by third parties for their own purposes may infringe the rights of the owner.

®

®

Copyright © Siemens AG 2008 All Rights Reserved
Passing on and reproducing this document as well as using and disclosing its contents is prohibited unless an explicit permission is given. Offenders will be liable for damages. All rights reserved, especially in the case of patent grant or registration of a utility model or design. Siemens AG Industry Sector Engineering and Construction I IS IN E&C P.O. Box 3240, D- 91050 Erlangen IT4.Industry@siemens.com

Exclusion of Liability
We have checked the contents of this document with regard to its conformity with the described hardware and software. Deviations, however, cannot be excluded. Therefore, we cannot guarantee its complete conformity. The information in this document is checked regularly and necessary corrections are contained in subsequent versions. We will be grateful for any suggestions for improvement. Technical data subject to change.

The manual contains the following topics: • Production description • Getting Started • Commissioning • Parameterization • Licensing • Function block MODBUSPN • Diagnosis • Sample application Contents of the Manual Scope of this Manual This manual is valid for the following software: Product OPEN MODBUS/TCP FB 102 “MODBUSPN” FB 103 “TCP_COMM” FB 104 “MOD_CLI“ FB 105 “MOD_SERV“ Identification number 2XV9 450-1MB02 From version 2. Manual edition 2. commissioning etc.1 1 .0 1.1 3.1 3.1 1.Preface Preface Purpose of the Manual The information in this manual allows you to set up and put in operation the connection between a PLC with integrated PN interface and a device that supports the Open MODBUS/TCP protocol. Additional Sources of Information All additional information concerning PN PLCs and IM 151-8 PN/DP CPU (Startup.0 Note This manual contains the FB description valid at the time of publication.) can be found in the manuals SIEMENS SIMATIC S7-300 CPU 31xC and CPU 31x: Installation Operating Instructions A5E00105491-07 MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02. This manual describes the function of the Modbus function block and its parameterization.

1 2 .. CPU Specifications Manual A5E00850746-06 SIEMENS SIMATIC Distributed I/Os ET 200S Interface Module IM151-8 PN/DP CPU Manual A5E02049033-01 SIEMENS Product Information on CPU315-2 PN/DP. 6ES7317-2EK13-0AB0 CPU317F-2 PN/DP. SIEMENS SIMATIC Software System software for S7-300/400 System and standard functions Reference manual C79000-G7000-C503-02 MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02. 6ES7317-6FF03-0AB0 CPU319-3 PN/DP. Manual edition 2.Preface SIEMENS SIMATIC S7-300 CPU 31xC and CPU 31x. 6ES7317-2AJ10-0AB0 CPU317F-2 DP. 6ES7318-3EL00-0AB0 CPU319F-3 PN/DP. 6ES7318-3FL00-0AB0 A5E01103134-03 Additional information concerning STEP7 can be found in the following manuals: SIEMENS SIMATIC Software Base software for S7 and M7 STEP7 user manual C79000-G7000-C502-. 6ES7315-2EH13-0AB0 CPU315F-2 PN/DP. 6ES7317-2FK13-0AB0 CPU317-2 DP. Technical Specifications Manual A5E00105474-07 SIEMENS SIMATIC S7-400 Automation System S7-400 Hardware and Installation Operating Instructions A5E00850740-01 SIEMENS SIMATIC S7-400 S7-400 Automation System. 6ES7315-2FH13-0AB0 CPU317-2 PN/DP.

319. 317. The descriptions apply to PN PLCs of series 315. The function block described in this manual establishes a connection between a PN PLC and third-party MODBUS devices.1 3 .Preface Additional Questions For further questions regarding the use of the FBs described in this manual. please contact your Siemens partner who provided you with this function block. Terminology Scope of Application MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02. 414 and 416 as well as IM 151-8 PN/DP CPU. This document uses the term PN PLC. Manual edition 2.

........... 6-15 Renaming Standard Functions ......... 7-12 Diagnosis Messages of SFC24 .... 3-2 Insertion of the Function Blocks into the Program......................................................................................... Manual edition 2.............................. 1-1 Hardware and Software Prerequisites................................5 Diagnosis via the Display Elements of the PLC ..... 3-1 PLC – Assigning the IP Address .................................1 4.......................................................Table of contents Table of Contents 1 Product Description......... 3-4 4 Parameterization of the Modbus Communication ................................................4 7............................................................................................................5 Functionality of the FB ................................2 2 3 Field of Applications............. 8-1 Literature..............................2 Parameterization with the Wizard...............................................................................................................................................................................................................................................................3 6.................................. 6-1 6............ 7-1 7........... 7-6 Diagnosis Messages of Called Blocks ........... 7-3 Diagnosis Messages of the FB MODBUSPN.................................... 5-1 Function Block MODBUSPN .......................................................................................................... 6-5 Example of Address Mapping..................................................................................................................2 3....... 6-16 7 Diagnosis .......................... 1-1 Getting Started ........1 6. 4-2 Editing the Parameterization ....................................................................... 3-1 3................................................................... 4-1 4............. 7-12 8 A Sample Application............................................................... 4-3 5 6 Licensing .................. 1-1 1.......................................... 6-1 Parameters of the Function Block MODBUSPN ........................................1 3......................................... 2-1 Commissioning .......................2 6....................................3 7..................... 1 i MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02.............................................1 .......... 7-2 Verification by the FB MODBUSPN...........................................................1 1................................................1 7........4 6............................................................ 6-12 Data and Standard Functions used by the FB ...........................................................................2 7................................................................................................................................................................3 Installing the Library on the STEP7 PG/-PC .....

the protocol uses the port 502. Use of Port Number 502 In general.4 SP4 or higher. 1. The SIMATIC S7 can act as both. Therefore the PLC/FB cannot be addressed simultaneous from different devices on the same port number. You can find further information about the released port numbers in the relevant manual of your PLC. This port number has not been released for all PN PLCs yet and is only possible when using a 319 CPU. S7-400 and IM 151-8 PN/DP CPU.1 1-1 . a client and a server.siemens. during the data transmission.2 Hardware and Software Prerequisites The function blocks have been tested on the PLCs with the product identifications CPU315-2 PN/DP CPU317-2 PN/DP CPU319-3 PN/DP CPU414-3 PN/DP CPU416-3 PN/DP IM151-8 PN/DP 6ES7315-2EG10-0AB0 6ES7317-2EK13-0AB0 6ES7318-3EL00-0AB0 6ES7414-3EM05-0AB0 6ES7416-3FR05-0AB0 6ES7151-8AB00-0AB0 Usable Modules You can find the latest hardware prerequisites on the internet: www. Data transmission is carried out in accordance with the client-server principle. MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02.1 Field of Applications The function block described here is a software product for PLCs with integrated PN interface of Simatic S7-300. Software Versions The usage of the FB MODBUSPN is possible with STEP7 Version 5.com/s7modbus. communication link is established between a Simatic PLC with integrated PN interface and a device that supports the Open MODBUS/TCP protocol.Product description 1 Product Description 1. Placement in the System Environment Function of the FBs With these function blocks. a 414 CPU or a 416 CPU with the corresponding firmware version. The PLC only allows a one-time use of a specific port number. Manual edition 2. an IM 151-8 PN/DP CPU.

Manual edition 2. The FB MOD_CLI requires 11184 byte work memory and 12054 byte load memory. The FB TCP_COMM requires 1880 byte work memory and 2224 byte load memory. The FB MOD_SERV requires 10660 byte work memory and 11452 byte load memory.1 1-2 .Product description Memory requirements The FB MODBUSPN requires 6048 byte work memory and 7294 byte load memory. MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02.

register numbers.). connect at start-up.2 3. Load the user program into the PLC and license the Modbus block for this CPU.2 6. => Section 6.1 5. Parameterize the Parameter-DBs MODBUS_PARAM regarding your requirements (client/server. => Section 4. Call the Modbus block FB102 in the required OBs.1 to 3. DB numbers.1 2-1 . Procedure MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02. etc.3 2.). Parameterize the Modbus block for initialization and runtime. => Section 6. => Section 3. port number.Getting started 2 Getting Started 1. => Section 4. => Section 5 .1 and 4. Install “OpenModbusTCP PN CPU“ and insert the Modbus function blocks into your SIMATIC project. Manual edition 2. etc. Parameterize the connection parameters regarding your requirements (IP-address.1 and 4.2 4.

In the Windows Explorer. use the browse function of the “Open” dialog for libraries. The manuals are also available as PDF files on CD. Knowledge of AWL and basic knowledge of STEP7 and PLC is required. the sample projects and the manuals in English and German in the corresponding STEP7 directories. What We Provide Requirements Installation STEP7 has to be installed. Follow the step-by-step the instructions which are displayed by the installation program. Double-click on the setup directory and then on Setup.1 Installing the Library on the STEP7 PG/-PC The attached CD contains a setup which installs the library “Modbus_PN_CPU”. \Program Files\Siemens\Step7\S7manual\S7Comm. please proceed as follows: 1.4 SP4. In later versions. Now you can find • the library in • the manual in \Program Files\Siemens\Step7\S7libs. MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02. the sequences. If the installation program does not start automatically. Manual edition 2.Commissioning 3 Commissioning The information below on STEP7 refers to Version 5. To initially access the Modbus library.EXE to start the installation. • the software registration form in \Program Files\Siemens\Step7\S7libs\Modbus_PN_CPU. names and directories might be different.1 3-1 . 2. The manual can be accessed via short cut under \Program Files \Siemens\ Documentation as well. navigate to the CD ROM drive. Insert your Modbus CD into the CD ROM drive and follow step-by-step the instructions which are displayed automatically by the installation program. General Information Requirements 3. • the sample project in \Program Files\Siemens\Step7\Examples.

Introduction Procedure Before the configuration. Following the steps below. a PLC 317-2 PN/DP is inserted. This so-called MAC address is preset by the manufacturer and cannot be changed.2 PLC – Assigning the IP Address Each node on the Ethernet network is identified by an internationally unique address. you can assign an IP address in the Ethernet to this physical address. Ethernet. A double click on line X2 opens the object properties dialog of Ind. 1. Manual edition 2.Commissioning 3. Open HWConfig The PLC 317-2 PN/DP is inserted in slot 2 and the properties dialog box of the PN-IO interface X2 is mapped. In this example. MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02. 2. it is necessary to create a new S7 project with STEP7.1 3-2 .

Result: You created a new Industrial Ethernet subnet.1 3-3 . 5. Click on the "OK" button. Result: The properties window of Ethernet interface X2 for PLC 317-2 PN/DP closes. To establish a connection via a router. Enter the IP address and the subnet mask. Confirm your entries with "OK". 4. MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02. enter the address of the router as well.Commissioning 3. Click on "New" to assign a name for a new Industrial Ethernet subnet. Manual edition 2.

2 or higher V2. You can find this function in „Standard Library IEC Function Blocks“.1 3-4 . Additionally.1 or higher V2.Commissioning 3.1 or higher Furthermore the block FC10 EQ_STRNG is necessary.3 or higher V2. They have to be inserted into your project. You can find these blocks in Standard Library Communication Blocks. the library contains the parameter data block MODBUS_PARAM as a draft. Please note that the following versions of the FBs are a prerequisite for the faultless function of the FB MODBUSPN: TSEND TRCV TCON TDISCON V2. They can be inserted into your project for assistance purposes. Blocks of the Standard Library The following blocks are required for the Modbus communication: • • • • TSEND (FB63) TRCV (FB64) TCON (FB65) TDISCON (FB66). Manual edition 2. MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02.3 Insertion of the Function Blocks into the Program The following blocks are required for the Modbus communication: • • • • MODBUSPN MOD_CLI MOD_SERV TCP_COMM Content of the MODBUS library The blocks have to be copied from the library into your project.

Parameterisation of the Modbus Communication 4 Parameterization of the Modbus Communication For the communication via the integrated PN interface of the PLC.0 Connection 2: Connection parameters Connection 2: Modbus parameters END_STRUCT . subsequently. . The parameter data block can contain parameter information of all defined connections..1 4-1 . General Information Connection Description DB MODBUS_PARAM The parameters to establish a connection and to execute the Modbus communication are defined as a structure in a parameter DB called MODBUS_PARAM.. The connections are established and terminated by means of the function blocks TCON (FB65) und TDISCON (FB66). Manual edition 2. STRUCT 650*i 650*i+64 Connection i+1: Connection parameters (65+i) Connection i+1: Modbus parameters END_STRUCT MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02. a network configuration in NetPro is not necessary. For each logical connection.0 +714. A prepared structure is part of the library “MODBUS_PN_CPU” and can be used as a sample. a separate structure is required. Structure of DB MODBUS_PARAM: Address Name STRUCT +0. Several connections to different communication partners can be parameterized and established at the same time.0 +64.. At first the connection parameters are defined. For each additional connection.0 Connection 1: Connection parameters Connection 1: Modbus parameters END_STRUCT STRUCT +650. This structure contains the connection parameters of both communication partners and the Modbus parameters. the Modbus parameters are defined.. It is also possible to use a separate parameter data block for each connection. The maximal number of coexistent connections depends on the PLC. the parameter data block must be expanded by or a new data block created with the structure for connection parameters and the Modbus parameters.

com/WW/view/en/31535566.1 Parameterization with the Wizard With the wizard Modbus TCP Wizard you can easily parameterize the connection parameters as well as the Modbus parameters in the parameter data block MODBUS_PARAM. The two opportunities are described in detail in the following sections 4.1 and 4.1 4-2 .siemens. e. Otherwise it becomes impossible to set up a connection.2. MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02. Manual edition 2. which offers an easy way to setup the connection parameters.automation. A detailed structure can be found in section 4.2. General Information You can find the wizard at http://support. Modbus Parameters The Modbus parameters define the mode of communication and the address reference. The second possibility is to edit the parameters in the structure in the data block with the editor of STEP7. The structure of the parameter DB has to remain unchanged to ensure proper communication. e.g. There are two alternatives for a parameterization of the connection and Modbus parameters. It is recommended to use the wizard for the parameterization of the block MODBUS_PARAM. The structure of the connection parameter block is obligatory und may not be changed.g. The functions TCON and TDISCON can establish and terminate a connection by means of these parameters.Parameterisation of the Modbus Communication Connection Parameters The parameters of the connection are defined in the first block. . The complete structure (connection parameters and Modbus parameters) is created. how many register or bit areas are mapped to which DB or the differentiation between the S7 acting as server or as client. the used local interface and the IP address of the communication partner. Alternatives for Parameterization 4. The first one is to use a Wizard.

rename the DB. TSEND. Manual edition 2. This ID must be unique within the complete parameter data block and has to be parameterized during the call of FB MODBUSPN. TRCV and TDISCON). The parameter of data block MODBUS_PARAM must not be changed during runtime.2 Editing the Parameterization Copy DB2 of the library Modbus_PN_CPU and insert them in your project. It is necessary to restart the PLC after the modification of MODBUS_PARAM. Fixed value: W#16#40 id A connection ID is assigned to each logical connection.1 4-3 . Value range: W#16#1 to W#16#FFF MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02. Procedure Structure of and Adaption of Connection Parameters For each logical connection one structure is required. block_length This parameter describes the length of the connection parameters and must not be changed. It is used for the internal calls of the T blocks (TCON. If the number is already used.Parameterisation of the Modbus Communication 4.

It is recommended that the Modbus client performs an active connection establishment while the Modbus server establishes passive connections.1 4-4 . Please assign the value B#16#0. Active connection establishment: Passive connection establishment: local_device_id TRUE FALSE The local_device_id defines the IE interface of the used PN PLC. If an unspecified connection is to be used. The length of rem-staddr.automation. The value depends on the PLC.3 B#16#11 with CPU315 and 317 >= FW V2. The following values are necessary with the different PLC types. Active connection establishment: Passive connection establishment: 2 0 next_staddr_len This parameter defines the length of next_staddr as the distinction between the communication running via an external CP or via the integrated PN interface of the PLC. It is used by the function TCON when establishing the connection. i.4. You can find further information on the internet: http://support. CPU 414 and CPU416 The values vary depending on the used firmware. is defined here. CPU 319. TCP (compatibility mode): TCP: B#16#01 with CPU315 and 317 <= FW V2. Active connection establishment: Passive connection establishment: 0 2 rem_subnet_id_ len rem_staddr_len This parameter is currently not used.siemens. PN interface of the PLC: B#16#0 MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02.Parameterisation of the Modbus Communication connection_type The structure of the connection is defined here. the port number of the remote communication partner. Manual edition 2.e. IM 151-8 PN/DP CPU. the IP address of the communication partner. Unspecified connection: Specified connection: B#16#0 B#16#4 rem_tsap_id_len This parameter defines the length of rem_tsap_id. no IP address is required for the partner. IM 151-8 PN/DP CPU CPU315 or 317 CPU319 CPU414 or CPU416 B#16#1 B#16#2 B#16#3 B#16#5 local_tsap_id_len The length of the parameter local_tsap_id (= local port number) is defined here.com/WW/view/en/24294554 active_est This parameter defines the way the connection is established (active or passive).

rem_staddr[4] = B#16#01 (1). The value range depends on the PLC. The representation depends on the parameter connection_type.Parameterisation of the Modbus Communication local_tsap_id This parameter defines the local port number. The representation depends on the parameter connection_type. When using the integrated PN interface of the PLC. rem_staddr[5-6]= B#16#00 (reserved) rem_tsap_id This parameter defines the remote port number. rem_staddr[2] = B#16#00 (0). The port number has to be unique within the PLC. rem_staddr[5-6]= B#16#00 (reserved) With connection_type B#16#11 rem_staddr[1] = B#16#C0 (192). The value range depends on the PLC. rem_staddr[3] = B#16#00 (0). assign 0 to this parameter. the IP address of the remote communication partner is defined.0. no IP address has to be entered. Example: IP address 192.1: With connection_type B#16#01 rem_staddr[1] = B#16#01 (1). assign 0 to this parameter. rem_staddr[4] = B#16#C0 (192). With connection_type B#16#01 local_tsap_id[1] low byte of the remote port number in hexadecimal local_tsap_id[2] high byte of the remote port number in hexadecimal local_tsap_id[3-16] B#16#00 With connection_type B#16#11 local_tsap_id[1] high byte of the remote port number in hexadecimal local_tsap_id[2] low byte of the remote port number in hexadecimal local_tsap_id[3-16] B#16#00 next_staddr This parameter defines rack and slot of the corresponding CP. In this array of bytes. rem_staddr[3] = B#16#A8 (168). Manual edition 2. Please assign the value B#16#0. With connection_type B#16#01 local_tsap_id[1] low byte of the local port number in hexadecimal local_tsap_id[2] high byte of the local port number in hexadecimal local_tsap_id[3-16] B#16#00 With connection_type B#16#11 local_tsap_id[1] high byte of the local port number in hexadecimal local_tsap_id[2] low byte of the local port number in hexadecimal local_tsap_id[3-16] B#16#00 rem_subnet_id rem_staddr This parameter is currently not used. When an unspecified connection is used. MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02. next_staddr[1-6] B#16#00 spare Reserved. The representation depends on the parameter connection_type. rem_staddr[2] = B#16#A8 (168).1 4-5 .168.

server_client TRUE: S7 is server FALSE: S7 is client In operating mode “S7 is client” and single_write = TRUE write requests with length 1 are carried out with the function codes 5 and 6. Manual edition 2.Parameterisation of the Modbus Communication Adaption of the Modbus Parameters The Modbus parameters in the block MODBUS_PARAM define the mode of operation of the Modbus communication and the address reference of Modbus addresses and SIMATIC addresses.1 4-6 . single_write MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02. With single_write = FALSE all write requests use the function codes 15 and 16.

FALSE: establish connection when ENQ_ENR=TRUE TRUE: establish connection immediate after PLC start-up When connect_at_startup = TRUE. db_x DB-Number 1 .Parameterisation of the Modbus Communication connect_at_ startup This parameter defines the point in time at which the connection is being established. only one DB can be accessed. Depending on the type of request. data_type_x The parameter data_type_x defines the MODBUS data type which is to be mapped with this definition. This has to be taken into account during the parameterization. With one request. this data area is not used Identifier 0 1 2 3 4 Data type Area not used Coils Inputs Holding Register Input Register Bit Bit Word Word Size db_x The parameter db_x defines the number of the data block in which the consecutively defined MODBUS registers or bits are mapped. two requests are necessary to access them both.65535 (W#16#0001 to W#16#FFFF) MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02. It is possible to map more Modbus values (registers or coils) in one data block than could be processed with one telegram. Even if consecutive register numbers or coils are located in two different DBs. the first request should be started after the connection was established (CONN_ESTABLISHED = TRUE) or an error has been reported respectively (ERROR =TRUE).1 4-7 . The other 7 data areas are optional. 0 cannot be used as DB number since it is reserved for system functions. If data_type_x set to 0. Manual edition 2. At least the first data area has to be defined. these memory areas are read or written. 8 Data Areas 8 data areas are available to map the Modbus addresses in the S7 storage.

Parameterisation of the Modbus Communication

start_x end_x

Start_x specifies the first register or bit address, which is stored in the data element 0 of the DB. End_x defines the of the last MODBUS address. When accessing registers, the number of the data element of the S7 DB in which the last register is mapped, can be calculated with the following formula: DBW number = (end_x – start_x) ∗ 2 When accessing coils or inputs, the number of the data element of the S7 DB in which the last bit is mapped, can be calculated with the following formula: DBB number = (end_x – start_x +7) / 8 The defined memory areas must not overlap. The parameter end_x must not be smaller than start_x. In case of an error occurring, the initialization of the FB is stopped with an error. When start_x is equal to end_x, one Modbus address (1 register or 1 bit) is allocated. In section 6.3 you can find an example of the mapping of the MODBUS addresses to S7 memory areas. start_x, end_x MODBUS address

0 to 65535 (W#16#0000 to W#16#FFFF)

internal_send_ buffer internal_recv_ buffer

This array is used internally for message data within the FB. Accessing or changing the array is inadmissible. This array is used internally for the received data within the FB. Accessing or changing the array is inadmissible.

MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02; Manual edition 2.1

4-8

Licensing

5

Licensing
The block MODBUSPN must be licensed for each CPU individually. The licensing takes place in two steps: reading the IDENT_CODE and declaring the registration key REG_KEY. To read the IDENT_CODE please proceed as follows: 1. Parameterize the block in the cyclic OB (OB1 or cyclic interrupt OB), in OB100 and OB121 according to your requirements. Transfer the program to the PLC and turn it to RUN mode. 2. Open the instance DB of the block MODBUSPN. „Data block“ -> „Open Online“ to open the DB. Monitoring the block via the button is insufficient.

General

Read the IDENT_CODE

MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02; Manual edition 2.1

5-1

Licensing

3. The output IDENT_CODE shows an 18 character string. Copy this string per copy/paste from the DB und and insert it in the form IT4Industry SOFTWARE REGISTRATION FORM. This form is stored in the library path ..\Program Files\Siemens\Step7\S7LIBS\Modbus_PN_CPU during installation and is also available on the installation CD. Insert the License-No. of the product package into the form.

4. Please send the form per e-mail to IT4Industry it4.industry@siemens.com. Hereupon you will receive the registration key for your PLC.

MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02; Manual edition 2.1

5-2

Copy the prepared license block DB3 of the library “Modbus_PN_CPU“ into your project.1 5-3 . MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02. 5. Please proceed as follows to declare the registration key REG_KEY: 1. 3. The registration key can be set at run time. Transfer the changed blocks to the PLC. A STOP -> RUN transition is not necessary. If the DB number is already used in your project. Open the license DB and copy the 17 digit registration key you received from IT4industry to the column “Initial value”. Via this global DB all MODBUSPN blocks can receive the registration key (See also the following example). 4. rename the license DB.Licensing Declaration of the Registration Key REG_KEY The registration key REG_KEY must be declared for each call of the block MODBUSPN. The block is now licensed for this CPU. Choose in the menu “Edit > Initialize Data Block” – all values of the column “initial value” are copied to “actual values”. Assign the value “DB3. Manual edition 2. Change over to the data view via the menu “View” -> “Data View”.REG_KEY” to the parameter REG_KEY of the block MODBUSPN. Declare the registration key in the data block as “initial value” to avoid a repeated insertion after reloading the PLC. 2. Open the data block in the SIMATIC manager with the editor in the declaration view. The registration key REG_KEY should be stored in a global DB.

please check if the FC “EQ_STRING” is copied into the project. MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02. A cyclic error message regarding the missing license is displayed in the diagnostic buffer too. if the OB121 is not available. If this error code is shown although the registration key has been inserted. Manual edition 2. The error number of the missing license is W#16#A090. The entry in the diagnostic buffer is carried out by means of OB121 “Programming Error”. _____________________________________________________________ Modbus communication is carried out even with a missing or wrong registration key.1 5-4 .Licensing Missing or Wrong Licensing When the registration key is missing or a wrong one is detected. the SF LED (S7-300 and IM151-8) or the INTF LED (S7-400) of the CPU is flashing. _____________________________________________________________ Warning ! The CPU will turn to STOP mode. but the output STATUS_MODBUS is set to W#16#A090 “no valid license”.

3. 2. Mark the FB and press “F1” so that he online help is displayed. The blocks provide the following functions: • • • • • • • • Connection and data handling by means of T blocks of the standard library Generation of MODBUS-specific telegram header before sending Verification of the MODBUS-specific telegram header when receiving Verification whether the memory areas requested by the client exist Generation of exception telegrams when errors occur (only when S7 is in server mode) Data transfer to and from the parameterized DB Time monitoring of the data reception as well as connection establishment and termination Verification of the registration key General Information Online-Help The SIMATIC Manager provides an online help for the function block MODBUSPN. 4. The block MOD_CLI comprises the function of Modbus client. The block MODBUSPN calls the blocks MOD_CLI (FB104) and MOD_SERV (FB105) internally. MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02. 5.1 6-1 .1 Functionality of the FB The function block MODBUSPN enables a communication between a PLC with integrated PN interface and a partner which supports Open MODBUS/TCP. The function codes 1. Depending on the parameterization. 15 and 16 are supported. the functionality multitasking in the sense of the MODBUS specification is not implemented. It contains the main information on the FB.Function Block MODBUSPN 6 Function Block MODBUSPN 6. the block MOD_SERV executes the function of Modbus server and the block TCP_COMM handles the connection management. the FB can be operated either in client or in server mode. 6. Manual edition 2. In the server operating mode.

If the block has not been licensed yet.1 6-2 . e. The runtime parameters are not evaluated during the start-up. OB35 is not permissible. the OB121 is called. if the OB121 is not available. e. The LED SF or INTF of the CPU flashes simultaneously. changes to the runtime parameters are ignored. OB121 “Programming Error” The block MODBUSPN must be called in OB121 with the same instance DB as in the start-up OB and the cyclic OB. The Modbus block must be called in OB121. _____________________________________________________________ The call of MODBUSPN in OB121 executes an entry in the diagnostic buffer. the FB MODBUSPN is called in OB1 or in a cyclic interrupt OB.g. the functions of the function block are activated.Function Block MODBUSPN Call of the FB For a correct program sequence the function block MODBUSPN has to be called in 3 organization blocks: • OB100 Start-Up • OB121 Programming Error • Cyclic OB (OB1 or cyclic interrupt OB. Manual edition 2. Start-up of the FB The function block MODBUSPN is unconditionally called once in OB100. • • • • The initialization parameters must be set according to the station configuration. The initialization parameters are copied into the instance DB.g. You will find more information regarding this matter in section 5 “Licensing“. In the cyclical operation mode. Cyclical Operation of the FB In case of cyclical operation. which points out that the registration key is missing. • • • Corresponding to the runtime parameters. While a request is being processed. The values of the parameter data block MODBUS_PARAM are evaluated. MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02. MOD_SERV and TCP_COMM must not be called additionally in an organization block. initialization parameters are ignored. A coexistent call of FB MODBUSPN in OB1 and a cyclic interrupt OB. _____________________________________________________________ Warning ! The CPU will turn to STOP mode. OB35) The subordinate blocks of the Modbus library MOD_CLI.

The point in time at which the connection is established is defined in DB MODBUS_PARAM (parameter connect_at_startup). there are the following requirements for each connection: • • • • one connection parameter block and the related Modbus parameter in DB MODBUS_PARAM call of FB MODBUSPN in OB100 call of FB MODBUSPN in OB121 call of FB MODBUSPN in OB1 or cyclic interrupt OB In this case.1 6-3 . it is possible to define whether the PLC performs active or passive connection establishment. A different instance DB is required for each additional connection. The termination of the connection is defined with the parameter DISCONNECT of FB MODBUSPN. the calls of the FB MODBUSPN in the OB100. OB121 and in the OB1 receive the same instance DB for one connection. During runtime the function TCON establishes the connection to the communication partner for both types of connections. With a parameter of the connection parameter block (active_est). MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02. active and passive. To ensure a proper operation and data transfer. Manual edition 2.Function Block MODBUSPN Connection Handling Active connection establishment can be carried out by the Modbus client as well as the Modbus server. Correspondingly. It is recommended explicitly that the Modbus client executes the active establishment. a strict division of the different connections to the corresponding communication partners is inevitable. Multiple Communication Partners A PN PLC can establish multiple connections to various communication partners. The relevant information is read from the connection parameters of DB MODBUS_PARAM.

the FB is ready to receive a request telegram from the client. At this point. A new request can be initiated. An erroneous request telegram causes an error message and the ERROR bit is set.1 6-4 . the necessary actions are taken and the request is terminated without error. Depending on the input parameters UNIT. a validity check is carried out.Function Block MODBUSPN Initiate Request S7 is Client A rising edge at the trigger input ENQ_ENR initiates a request. LENGTH. Manual edition 2. The completed transmission is reported to the user by setting the DONE_NDR bit. The output DONE_NDR is set. a MODBUS request telegram is generated and sent to the partner station via the TCP/IP connection. The error number is returned in STATUS_MODBUS. the activated request is terminated with an error. START_ADDRESS. TI and WRITE_READ. Activation of the Function Block S7 is Server With the signal TRUE at the trigger input ENQ_ENR. DATA_TYPE. START_ADDRESS. LENGTH. The client waits for the parameterized monitoring time RECV_TIME for a response from the server. the request is terminated with an error. the completed function is indicated at the outputs UNIT. When the monitoring time elapses (no response from the server). If the result is positive. The received telegram is verified. If the verification result is positive. the response telegram is sent. TI and WRITE_READ. DATA_TYPE. the ERROR bit is set and an error number is returned at the output STATUS. The request of the client is not answered. After the receipt of the response telegram. MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02. The server remains passive and waits for a telegram from the client. When an error is recognized during verification.

must be identical to the associated parameter in the local connection description Value range 1 to 4095 W#16#1 to W#16#FFF Parameter ID Init yes DB_PARAM RECV_TIME IN IN BLOCK_ Number of the parameter DB DB TIME Monitoring Time: wait for data from communication partner Shortest adjustable time: 20 ms. TSEND or TRCV) Job processing No job processing active TRUE FALSE no TRUE FALSE TRUE FALSE TRUE FALSE no no BUSY OUT BOOL CONN_ ESTABLISHED DONE_NDR OUT BOOL OUT BOOL Connection established Connection terminated S7 is Client: TRUE: Active request finished without errors S7 is Server: TRUE: Request from the client was executed and answered MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02. TDISCON.Function Block MODBUSPN 6. Manual edition 2.2 Parameters of the Function Block MODBUSPN Decl. no KEEP_ALIVE ENQ_ENR IN IN TIME BOOL Not used S7 is Client: Initiate request at positive edge S7 is Server: Ready to receive at TRUE signal TRUE FALSE no DISCONNECT IN BOOL S7 is Client: TRUE: connection is terminated after reception of response S7 is Server: TRUE: connection is terminated when ENQ_ENR = FALSE TRUE FALSE no REG_KEY LICENSED IN STRING [17] Registration key to activate the license Character no no OUT BOOL License state of the function block: Block is licensed Block is not licensed Operating state of the T functions (TCON. depending on PLC T#20ms to T#+24d20h31 m23s647ms T#20ms to T#+24d20h31 m23s647ms yes no CONN_TIME IN TIME Monitoring Time: wait for establishing or termination of the connection Shortest adjustable time: 100 ms. Type IN WORD Description Connection ID.1 6-5 .

TRCV. TDISON) Name of the function.Function Block MODBUSPN Parameter ERROR Decl. OUTPUT if in SERVER mode) Coils Inputs Holding registers Input registers no no OUT STRING [8] OUT STRING [18] IN/ BYTE OUT IN/ BYTE OUT Character no IDENT_CODE Character no UNIT 0 to 255 B#16#0 to B#16#FF no DATA_TYPE no 1 2 3 4 0 to 65535 W#16#0000 to W#16#FFFF START_ ADDRESS LENGTH IN/ WORD OUT IN/ WORD OUT MODBUS start address (INPUT if in CLIENT mode.1 6-6 . which causes the error at STATUS_MODBUS or STATUS_CONN Identification for licensing Please order your license with this identification string. OUTPUT if in SERVER mode) Number of values to be processed (INPUT if in CLIENT mode. Unit identification (INPUT if in CLIENT mode. Manual edition 2. Type OUT BOOL Description An error has occurred No error has occurred Value range TRUE FALSE 0 to FFFF 0 to FFFF Init no STATUS_ MODBUS STATUS_ CONN STATUS_FUNC OUT WORD OUT WORD Error number for protocol errors when evaluating a Modbus telegram Error number for connection errors during execution of the T blocks (TCON. OUTPUT if in SERVER mode) Coils Reading function Writing function Inputs Reading function Holding Register Reading function Writing function Input Register Reading function no no 1 to 2000 1 to 800 1 to 2000 1 to 125 1 to 100 1 to 125 0 to 65535 W#16#0 to W#16#FFFF TI IN/ WORD OUT IN/ BOOL OUT Transaction Identifier (INPUT if in CLIENT mode. OUTPUT if in SERVER mode) Write access or Read access (INPUT if in CLIENT mode. OUTPUT if in SERVER mode) Data type to be accessed: (INPUT if in CLIENT mode. OUTPUT if in SERVER mode) no WRITE_ READ TRUE FALSE no MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02. TSEND.

In the operation mode S7 is server. it is not advisable to modify the input parameters while a request is active. Range of Values For the range of values of the different parameters. The output parameters are displayed dynamically. i. A modification of the initialization parameters during run mode has no impact. They have to be copied to an additional memory area if you need to process them or to display the values in a VAT (STEP7 variable table). Runtime parameters can by modified during the cyclical operation. the instance DB must be initialized again via a STOP RUN transition of the PLC.e. Manual edition 2. They are marked with “yes“ in the column “INIT“ in the table displayed above.g. the output parameters may only be evaluated when DONE_NDR is TRUE. MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02. Wait with the next request and the change of the parameters until the previous request ends with DONE_NDR or ERROR. After a modification of these parameters (e. during the test phase). PLC-specific restrictions must be taken into consideration.Function Block MODBUSPN General Information The parameters of the FB MODBUSPN can be divided into two groups: • • Initialization parameters Runtime parameters Initialization parameters are evaluated only during the call of OB100 and are adopted into the instance DB.1 6-7 . In the mode S7 is server. they are only available for one PLC cycle.

an error is reported. When CONN_TIME elapses. an indication RECV_TIME < 20 ms causes an error message and the request is rejected. The parameter DB_PARAM assigns the number of the data block MODBUS_PARAM. It is also possible to use different parameter data blocks for multiple connections. the RECV_TIME is triggered. The shortest adjustable time is 20 ms. an indication CONN_TIME < 100 ms causes the use of the default time 5s. TRCV has to be called twice. which are necessary for the communication between the PN PLC and the Modbus device. During cyclic operation in the operating mode S7 is client. In the operating mode S7 is server. The connection ID defined in the connection parameter block has to be entered here and must be unique within the PLC. the active request is cancelled with an error. The parameter data block can contain a sequence of parameters for several connections. The monitoring time is started with the call of TRCV and stopped after the receipt of the telegram segment. The interval between two requests is not taken into consideration. 0 cannot be used as a DB number since it is reserved for system functions. If the monitoring time elapses. With each call of TRCV. CONN_TIME < 100ms causes an error message and the request is rejected. The shortest adjustable time is 100 ms. This parameter data block includes the connection parameters and the Modbus-specific parameters. This is also true for the operating mode S7 is client with connect_at_startup = TRUE.Function Block MODBUSPN ID To each connection between the PN PLC and a communication partner a connection ID is assigned. The range of values for this parameter depends on the PLC. When operating various connections an individual ID is required for each logical connection. In order to receive a Modbus telegram. This parameter is declared in plain text: “DBxy“. Manual edition 2. In the operating mode S7 is client.1 6-8 . an indication RECV_TIME < 20 ms causes the use of the default time of 1. The ID can be set to values between 1and 4095. which is part of the parameter data block MODBUS_PARAM. the corresponding error code is displayed at the output STATUS_CONN. In the operating mode S7 is server. When the time RECV_TIME elapses. The connection ID unambiguously specifies the connection between the PLC and the communication partner. CONN_TIME The monitoring time CONN_TIME observes the connection establishment and the connection termination. The RECV_TIME monitors the duration of the TCP stream.2s. MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02. DB_PARAM RECV_TIME The monitoring time RECV_TIME observes the data input from the communication partner. This connection ID is defined in the connection parameter block.

TDISCON. one of the T functions TCON. With the registration key REG_KEY the block MODBUSPN is licensed and the Modbus communication runs without any restraint.1 6-9 . TSEND or TRCV is running. Operating mode S7 is Server: The FB is activated with a TRUE signal at the input. START_ADDRESS. TI and WRITE_READ. REG_KEY The block MODBUSPN must be licensed for each CPU individually to permit a correct program sequence. CONN_ESTABLISHED indicates that a connection to the communication partner is established and data can be transferred. DATA_TYPE. If the connection is not established (CONN_ESTABLISHED = FALSE). This parameter is a runtime parameter and can be set optionally according to your requirements. You can find further information in section 5 “Licensing”. Manual edition 2. the parameter DISCONNECT = TRUE indicates that the connection is terminated after the completed data transfer. A new request may only be initiated when the previous one is ended with DONE_NDR or ERROR. CONN_ ESTABLISHED MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02. the connection establishment is activated. With a FALSE signal at the input and an established connection. BUSY If this output is TRUE. the connection may be terminated depending on the parameter DISCONNECT. DISCONNECT In the operating mode S7 is client. LENGTH. The request telegram is generated with the values of the input parameters UNIT. In the operating mode S7 is server. data is received from the client and discarded. When the parameter ENQ_ENR turns from TRUE to FALSE. If the connection is not established (CONN_ESTABLISHED = FALSE). Telegrams from the client can be received. If CONN_ESTABLISHED is set to FALSE.Function Block MODBUSPN ENQ_ENR Operating mode S7 is Client: The data transfer is initiated with a TRUE edge at the input. the connection establishment is carried out first and then the data transfer takes places. the parameter DISCONNECT = TRUE indicates that the connection is terminated when the parameter ENQ_ENR is set to FALSE. the connection to the communication partner is not established.

With a writing function. IDENT_CODE UNIT In mode S7 is Client. the activated request was ended with an error. After start-up of the PLC an 18 character string is displayed. The error number is displayed in the STATUS_MODBUS or STATUS_CONN output. When ERROR is TRUE. ERROR When this output is set. With a reading function. this output indicates a telegram exchange without errors. In this case. TSEND and TRCV. the STATUS_CONN output displays the error number regarding the processing of the T functions. the activated request was executed without an error. The error numbers are described in section 7. an error was recognized. TI and WRITE_READ the request parameters of the client are displayed. With the identification string IDENT_CODE you can order the registration key at IT4industry. the response data from the server has already been entered into the DB. The FB copies this value to the request telegram and verifies when receiving the respond telegram. the ERROR bit is set to FALSE. LENGTH. TDISCON. Manual edition 2.Function Block MODBUSPN DONE_NDR The parameter DONE_NDR indicates an error-free execution of the request. The output is set with the received value when the job is finished without an error.1 6-10 . DATA_TYPE. These outputs are only available and valid as long as DONE_NDR is TRUE. an error was detected at a request telegram of the client or when sending a response telegram. The error numbers are described in section 7 and in the STEP7 online help of the functions TCON. the response to the request telegram has been received from the server. the parameter UNIT is an output parameter. The error number is displayed in the STATUS_MODBUS or STATUS_CONN output. In the operating mode S7 is Client. This input has to be set according to your requirements. Status information like “job processing active” is provided by STATUS_CONN as well. In mode S7 is Server. STATUS_CONN STATUS_FUNC This parameter shows the name of the function. In the parameters UNIT. the parameter UNIT is an input parameter. STATUS_MODBUS When ERROR is TRUE. the STATUS_MODBUS output displays the error number regarding the processing of Modbus telegrams. In the operating mode S7 is Server. The FB copies this value from the request telegram to the respond telegram. MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02. In the operating mode S7 is Server. which can be read by means of a variable table? You can find further information in section 5 “Licensing”. In the operating mode S7 is Client. START_ADDRESS. which caused the error occurred.

With a writing function.1 6-11 . LENGTH The parameter LENGTH specifies the number of MODBUS values that are read or written. In the operating mode S7 is Client. DATA_TYPE is an output parameter. The following data types are available: Coils Inputs Holding Register Input Register B#16#1 B#16#2 B#16#3 B#16#4 In the operating mode S7 is Client. this is an input parameter. For each telegram. this is an input parameter. In the operating mode S7 is Client. Data type Coils Coils Coils Coils Inputs Holding Register Holding Register Holding Register Holding Register Input Register START_ADDRESS DATA_ TYPE 1 1 1 1 2 3 3 3 3 4 Function read write write write read read write write write read Length any 1 1 >1 any any 1 1 >1 any single_ write irrelevant TRUE FALSE irrelevant irrelevant irrelevant TRUE FALSE irrelevant irrelevant Function code 1 5 15 15 2 3 6 16 16 4 The parameter START_ADDRESS specifies the first MODBUS address that is read or written. Manual edition 2. With a reading function. this is an output parameter. MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02. all registers or bits have to be in the same DB. a maximum of 125 registers or 2000 bits is possible per telegram. this is an output parameter.Function Block MODBUSPN DATA_TYPE The parameter DATA_TYPE defines which Modbus data type is to be accessed with the current job. In the operating mode S7 is Server. DATA_TYPE is an input parameter. In the operating mode S7 is Server. In the operating mode S7 is Server. The different data types are related directly to the used function codes. a maximum of 100 registers or 800 bits is possible.

The FB copies this value to the request telegram and verifies it when receiving the respond telegram. e. The FB copies this value from the request telegram into the respond telegram. In the operating mode S7 is Client. Therefore. Manual edition 2. The FB MODBUSPN can only perform this function properly if the TI is changed with each transaction. Only a change of the TI ensures a reliable operation of the FB. is called 40001 (memory type 4xxxx. for example. The Transaction Identifier is used for the identification of telegrams and the unambiguous allocation of the requests to the corresponding responds.g. In the operating mode S7 is Server. 6.3 Example of Address Mapping The MODBUS data model is based on a series of storage areas with distinct properties. this is an input parameter. If the value of the input/output is FALSE. Some systems. end_x und START_ADDRESS. A potential source of confusion is the varying interpretation of the register address in different manuals.Function Block MODBUSPN TI The parameter TI (Transaction Identifier) is copied by the server from the request telegram to the respond telegram according to the MODBUS specification. MODICON PLCs. we recommend increment the TI by 1 with any request. distinguish these areas by the register or bit addresses. Therefore. reference 0001).1 6-12 . Interpretation of MODBUS Register Addresses MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02. The value TRUE specifies the writing mode. it is possible to use register or bit addresses from von 0000H to FFFFH for each function code. The Holding Register with offset 0. The FB MODBUSPN uses the register or bit address transferred for its parameters start_x. this is an output parameter. this is an output parameter. the reading mode is specified. In the operating mode S7 is Server. this is an input parameter. WRITE_READ This parameter defines whether a reading or writing function is to be carried out. In the operating mode S7 is Client. Sometimes the register or bit address is defined as the address of the application layer and in other manuals it is the actually transferred address.

The SIMATIC addresses printed in black are the offset in the DB. Additionally. Manual edition 2. The diagram is based on the parameterization in the table above. The Modbus addresses printed in black refer to the Data Link Layer and the ones printed in grey refer to the Application Layer.Function Block MODBUSPN Example: Parameterization of the Memory Areas data_type_1 db_1 start_1 end_1 data_type_2 db _2 start _2 end _2 data_type_3 db _3 start _3 end _3 data_type_4 db _4 start _4 end _4 data_type_5 db _5 start _5 end _5 data_type_6 db _6 start _6 end _6 data_type_7 db _7 start _7 end _7 data_type_8 db _8 start _8 end _8 B#16#3 W#16#B W#16#1 W#16#1F4 B#16#3 W#16#C W#16#2D0 W#16#384 B#16#4 W#16#D W#16#2D0 W#16#3E8 B#16#0 0 0 0 B#16#1 W#16#E W#16#280 W#16#4E2 B#16#2 W#16#F W#16#6A4 W#16#8FC B#16#1 W#16#10 W#16#6A4 W#16#8FC B#16#0 0 0 0 Holding Register DB 11 Start address: 1 End address: 500 Holding Register DB 12 Start address: 720 End address: 900 Input Register DB 13 Start address: 720 End address: 900 Not used 0 0 0 Coils DB 14 Start address: 640 End address: 1250 Inputs DB 15 Start address:1700 End address: 2300 Coils DB 16 Start address: 1700 End address: 2300 Not used 0 0 0 Address Mapping The following diagram shows a comparison of the SIMATIC memory area and the Modbus-typical register oriented storage arrangement.1 6-13 . you can find the Modbus register numbers printed in grey. MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02.

2 DB 16 + 0.. 40721 .0 DB 12 + 0.0 . 1700 01701 .. 640 641 00641 00642 .7 +75. +74... 1700 1701 11701 11702 ..0 + 0..... +358..0 +360.1 ..... +996....0 + 2.1 ...0 .0 899 900 900 901 720 721 720 499 500 1 2 1000 720 721 2299 2300 1700 1701 0 2299 2300 1700 1701 1250 640 641 Modbus device Coils (from 00001) 0 00001 .1 6-14 . 1000 Holding Register (from 40001) 0 1 40001 40002 .0 + 0. 1250 01251 .0 DB 11 + 0.7 +75. 499 500 501 40500 40501 40502 ......0 +998.. +560.. Manual edition 2. +76..0 + 0. +74. 2300 Inputs (from 10001) 10001 .1 .0 + 2.0 + 2.0 DB 13 + 0.0 ... 2300 2301 12301 12302 Input Register (from 30001) 0 1 30001 30002 ...0 DB 15 + 0.. 720 721 30721 30722 .. 40901 40902 1001 31001 31002 2301 02301 02302 MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02..Function Block MODBUSPN SIMATIC DB 14 + 0.

The function block does not use any flags. This instance DB is created by STEP7 when initially calling the FB. The function block TCP_COMM. output and input/output as well as static variables required for its execution. Manual edition 2. The instance data block contains parameters of the types input. uses the blocks TSEND and TRCV of the standard library for the data transfer between the PLC and the communication partner.and Modbus-specific parameters are stored in the parameter data block MODBUS_PARAM. 236 bytes of local data for one FB MODBUSPN call. These variables are remanent and keep their validity between FB calls.4 Data and Standard Functions used by the FB The function block MODBUS stores its data in an instance DB. That is a total of max. called by MODBUSPN.Function Block MODBUSPN 6. uses the blocks TCON and TDISCON of the standard library to establish and terminate the connection between the PLC and the communication partner. Additionally. The FB does not use any timers. The FB MODBUSPN uses the following SFCs from the standard library: • • • • • • FC10 “EQ_STRING” Parameter DB Timers Flags Standard FBs for Connection Handling Standard FBs for Data Transfer MODBUSPN: SFCs for Miscellaneous Functions SFC6 “RD_SINFO“ SFC20 “BLKMOV” SFC24 “TEST_DB” SFC51 “RDSYST” SFC52 “WR_USMSG” MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02. TDISCON. The connection. Required memory of the instance-DBs: Instance-DB MODBUSPN work memory 830 Byte load memory 1852 Byte Instance DB Local Variables The FB requires 96 bytes of local variables.1 6-15 . called by MODBUSPN. The function block TCP_COMM. MOD_CLI (110 Byte) or MOD_SERV (84 Byte) and TCP_COMM require 2 bytes local variables and TCON. The variables control the internal process flow of the FB. TSEND or TRCV use up to 28 bytes depending on the used function block.

FB65 and FB66 of FB TCP_COMM or the called function blocks MOD_CLI. SFC52 and SFB4. It is not possible to rename the system functions SFC6. Change the numbers of the function blocks in the desired numbers in your program in SIMATIC Manager. A modification of the FB numbers via “Extras -> Re-wire” is not necessary. Manual edition 2. Inducement Renaming To rename the blocks proceed as described subsequently: 1. Add the modifications in the symbolism table supplementary. it is possible to rename the internally called function blocks FB63.1 6-16 .Function Block MODBUSPN MOD_CLI and MOD_SERV: SFCs for Miscellaneous Functions TCP_COMM: SFCs for Miscellaneous Functions The FBs MOD_CLI and MOD_SERV use the following SFCs from the standard library: • • SFC20 „BLKMOV“ SFC24 “TEST_DB” The FB TCP_COMM uses the following SFB from the standard library in addition to the T-blocks: • SFB4 „TON“ 6. MOD_SERV und TCP_COMM. SFC20. SFC24. FB64. SFC51. MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02. 2.5 Renaming Standard Functions If the numbers of the standard functions are already assigned within your project or if the number interval is reserved for a different application.

you are provided with a general indication of errors that occurred during the Modbus-specific telegram processing. The STATUS parameters can be evaluated in the user program. For an error diagnosis. the MODBUSPN function block has 3 STATUS outputs. external errors and interface-specific errors. which caused the error at STATUS_MODBUS or STATUS_CONN.1 7-1 . STATUS Outputs of the FB MODBUSPN MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02. When reading the STATUS_MODBUS output.Diagnosis 7 Diagnosis The diagnostic functions of the PN PLC enable a fast localization of errors. The STATUS_CONN output displays status information and error codes with regard to the processing of the T functions. Manual edition 2. The output STATUS_FUNC shows the name of the function. When reading the STATUS outputs. Diagnostic Function Display Elements (LED) The display elements inform you about the operating mode or about the error conditions of the PLC. The following diagnostic features are available: • Diagnosis via the display elements of the PLC • Diagnosis via the STATUS_MODBUS and STATUS_CONN output of the MODBUSPN function block. you are provided with a general indication of errors that occurred during the telegram processing and connection handling. The display elements provide an overview of internal errors.

• Special Displays PN CPU 300. You can find further information in section 5 “Licensing”. the Modbus block has not been licensed yet. PN-CPU 400 .Diagnosis 7. Manual edition 2.1 7-2 .RX/TX a telegram is transferred via the integrated interface Display Functions A detailed description of the display elements can be found in the device manual of the PLC. There are two types of display functions: • Group Error Displays PN CPU 300 . PN CPU 400 and IM 151-8 PN/DP CPU: . You can find further information in section 5 “Licensing”.SF Group error When this LED is flashing. MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02.1 Diagnosis via the Display Elements of the PLC The display elements of the PLC provide information on the status of the component. the Modbus block has not been licensed yet.INTF Internal error When this LED is flashing.

Receipt of the response telegram within the monitoring time The monitoring time can also elapse if less data than specified in the MODBUS telegram header is received. start_x. • MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02. In the cyclical operation no requests are executed. Validity check of data_type 3. At least the first area (_1) has to be parameterized. there also is a check whether the data block specified by the register or bit address is available and has the necessary length. The DB number must not be 0 and/or identical to the number of MODBUS_PARAM or the instance DB. end_x.1 7-3 .2 Verification by the FB MODBUSPN • • Unambiguousness of the id parameter in the connection parameters of DB MODBUS_PARAM Parameter group data_type_x. Manual edition 2. During Start-up Cyclical Operation S7 is Client Verification when the FB is called: • • • • • • Valid registration key DB MODBUS_PARAM is available with the necessary length Range of values monitoring time RECV_TIME and CONN_TIME Range of values START_ADRESS Range of values LENGTH When executing a request.Diagnosis 7. Test end_x >= start_x 5. A correction of the parameterization and a STOP RUN transition of the PLC are necessary. db_x <> 0 4. (x = 1 to 8) 1. 2. Subsequent errors with loss of telegrams can occur. With data_type_x = 0 the Modbus area is disabled and not further verified. Errors during start-up provoke the ERROR bit to remain set. db_x. Modbus addresses for the same data type defined in two db_x lead to an error message (address overlap).

The DB number must not be 0 or identical to the number of MODBUS_PARAM or the instance DB. Manual edition 2. 5. Sent UNIT is equal to the received one Sent FC is equal to the received one Response is an exception code telegram For write requests. 4. • • • • • • Protocol Identifier = 0 Length between 6 and 207 Received function code is verified. During the execution of a request. the number of registers or bits and the byte count in the telegram must match. the start address and number of registers/bits have to match with the request telegram. For write requests. the length in the header of the response telegram is checked for plausibility regarding the request.Diagnosis Verification in the response telegram: • • • Received transaction identifier is equal to the sent one. there is also a check whether the data block specified by the register or bit address is available and has the necessary length. The number of registers or bits is verified. • • • • • • Cyclical Operation S7 is Server MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02. 15 or 16 an exception telegram is sent. an exception telegram is sent. an exception telegram is sent. In case of an error. FC 5 or FC6: Echo in the respond is equal to the request Receipt of the second part of the request telegram within the monitoring time The monitoring time can also elapse if less data than specified in the MODBUS telegram header is received. Protocol identifier = 0 Length is between 3 and 253 Additionally. 3. 6. the length in the header. 2.1 7-4 . If the function code is not equal to 1. If the number is too large. Subsequent errors with loss of telegrams can occur.

Diagnosis Termination of the Connection in Case of Error In special error situations. the FB terminates the connection: • • • • • Monitoring time for connection establishment exceeded Monitoring time for receive exceeded PI <> 0 received TI different to sent TI Length in the header does not match the length information in the telegram MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02. Manual edition 2.1 7-5 .

Correct the parameters. The FBs MODBUSPN. The block TCP_COMM. The error messages of these blocks are passed on to STATUS_CONN without any changes. Manual edition 2. A001 A002 A003 The parameter data block MODBUS_PARAM is too short. SFC24. whereas STATUS_CONN displays the error numbers regarding the connection handling.3 Diagnosis Messages of the FB MODBUSPN The block MOBUSPN has 3 status outputs: STATUS_MODBUS. Minimum length: . STATUS is valid when ERROR is TRUE. FB65 and FB66.Diagnosis 7. STATUS_CONN and STATUS_FUNC. SFC51 und SFC52. called by MOD_CLI or MOD_SERV. FB63. which caused the error. STATUS_FUNC shows the name of the function. SFC20.bit values (end_x .start_x + 1) * 2 . MOD_CLI and MOD_SERV use the standard functions SFC6. For further details on the error messages. The parameter end_x is less than start_x.1 7-6 . The DB to which MODBUS addresses shall be mapped is too short. please consult the diagnosis buffer or the online help of the SIMATIC Manager. Messages at the STATUS Outputs of the FB Error Messages of the called SFCs and FBs Error messages of FB MODBUSPN at the output STATUS_MODBUS STATUS Event text (Hex) Remedy Correct the length of MODBUS_PARAM Correct the parameterization in DB MODBUS_PARAM Extend the DB. The error messages of these blocks are passed on to STATUS_MODBUS without any changes. uses the standard blocks SFB4. FB64.start_x + 7) / 8 Other possible reasons: • • Wrong initialization parameter (S7 is client) Wrong address area in the request telegram of the client (S7 is server) A004 Applies only if S7 is client: An invalid combination of DATA_TYPE and WRITE_READ is given. Only data type 1 or 3 can be written. MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02. Below you can find a list of FB-specific error messages. S7 is Client: Correct the parameters START_ADDRESS or LENGTH S7 is Server: Modify the request of the client. STATUS_MODBUS displays the error numbers regarding the processing of Modbus telegrams.register values (end_x .

S7 is Server: Modify the number in the request telegram. 5. Only if S7 is client: The received UNIT is not equal to the sent one. Range of values: Read coils/inputs: 1 to 2000 Write coils: 1 to 800 Read registers: 1 to 125 Write holding registers: 1 to 100 A006 The given range of registers defined with DATA_TYPE. A00C The received byte count does not match the number of registers. LENGTH. 3. Only if S7 is client: The register or bit address respectively the number of registers or bits in the response telegram is not equal to the one in the request telegram. START_ADDRESS. S7 is Server: The number of registers/bits in the request telegram is invalid. 2. Manual edition 2. The RECV_TIME has to be at least 20 ms. 6. The connection is terminated. The connection is terminated. 15 and 16. S7 is Client: Correct the parameter combination DATA_TYPE. S7 is server: The FB MODBUS only supports the function codes 1.Diagnosis Error messages of FB MODBUS MODBUSPN at the output STATUS_MODBUS STATUS Event text (Hex) Remedy S7 is Client: Correct the parameter LENGTH. S7 is server: An invalid function code was received. Correct the parameterization. A00D A00E MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02.1 7-7 . Verify the data of the communication partner with the help of a telegram trace. S7 is client: Received function code is not equal to the sent one. A009 Verify the data of the communication partner with the help of a telegram trace. S7 is Server: Modify the request of the client or correct the parameterization of data_type_x. A00A A00B S7 is client: Verify the data of the communication partner with the help of a telegram trace. A007 Only if S7 is client: An invalid monitoring time RECV_TIME or CONN_TIME is parameterized. A005 S7 is client: An invalid value for the parameter LENGTH is given. CONN_TIME 100ms Only if S7 is client: The received transaction identifier TI is not equal to the sent one. 4. The connection is terminated. START_ADDRESS and LENGTH does not exist in data_type_1 to data_type_8. The length indicated in the MODBUS-specific telegram header does not match the number of registers/bits or the byte count in the telegram. The FB ignores all data.

Correct the parameterization in DB MODBUS_PARAM. The parameterized areas data_type_2 and data_type_3 overlap. The parameterized areas data_type_1 and data_type_6 overlap. Please contact the product support. A010 A011 A012 A013 A014 A015 A016 A017 A018 A019 In the parameters db_1 to db_8 a DB number is used twice. The connection is terminated. to 4). A00F A protocol identifier <> 0 was received. 0 is assigned to one of the parameters db_x while the according data_type_x is <> 0. The parameterized areas data_type_2 and data_type_5 overlap.Diagnosis Error messages of FB MODBUSPN at the output STATUS_MODBUS STATUS Event text (Hex) Remedy Verify the data of the communication partner with the help of a telegram trace. The parameterized areas data_type_1 and data_type_5 overlap. The parameterized areas data_type_1 and data_type_2 overlap. Correct the parameterization in DB MODBUS_PARAM. Correct the parameterization in DB MODBUS_PARAM. The parameterized areas data_type_1 and data_type_8 overlap. Wrong length in the Modbus header (1 to 253 byte are valid). The parameterized areas data_type_2 and data_type_5 overlap. The parameterized areas data_type_1 and data_type_3 overlap. An invalid value for DATA_TYPE is given (Value range: 1 Correct the parameters. The parameterized areas data_type_2 and data_type_4 overlap. The parameterized areas data_type_3 and data_type_4 overlap. The data areas must not contain any overlapping register areas. A01A A01F A023 A024 A025 A026 A027 A028 A034 The FB MODBUSPN has turned to an invalid state. it is reserved for system functions. Manual edition 2. MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02. The parameterized areas data_type_2 and data_type_5 overlap. The parameterized areas data_type_1 and data_type_7 overlap. The parameterized areas data_type_1 and data_type_4 overlap.1 7-8 . DB 0 can’t be used. Correct the parameterization in DB MODBUS_PARAM The data areas must not contain any overlapping register areas. The connection is terminated. Verify the data of the communication partner with the help of a telegram trace. The parameterized areas data_type_2 and data_type_5 overlap.

The parameterized areas data_type_6 and data_type_8 overlap. Correct the parameterization in DB MODBUS_PARAM. The parameterized areas data_type_4 and data_type_5 overlap. A080 MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02. An invalid value data_type_x was given. Parameter data_type_1 is not defined. The parameterized areas data_type_3 and data_type_6 overlap. The parameter area _1 is the default area and must be defined. The data block defined at DB_PARAM is no parameter Correct the parameterization at DB for Modbus communication. Restart the CPU after changing this parameter. The parameterized areas data_type_3 and data_type_8overlap. The parameterized areas data_type_4 and data_type_6 overlap.1 7-9 . The parameterized areas data_type_4 and data_type_8 overlap. The parameterized areas data_type_5 and data_type_6 overlap. The parameterized areas data_type_4 and data_type_7 overlap. The parameter DB_PARAM was changed without a restart of the CPU. Range of values is 1 to 4095. An invalid value ID is parameterized. The parameterized areas data_type_5 and data_type_8 overlap. A035 A036 A037 A038 A045 A046 A047 A048 A056 A057 A058 A067 A068 A078 A079 A07A A07B A07C A07D A07E A07F The parameterized areas data_type_3 and data_type_5 overlap. The parameterized areas data_type_5 and data_type_7 overlap. The parameter ID exists twice in the parameter DB. The DB number of db_x is identical to the number of the parameter DB MODBUS_PARAM or to the instance DB. The connection ID of parameter ID is not defined in DB MODBUS_PARAM. Correct the parameterization at the input ID. DB_PARAM is an initialization parameter. The parameterized areas data_type_7 and data_type_8 overlap. The parameterized areas data_type_6 and data_type_7 overlap.Diagnosis Error messages of FB MODBUSPN at the output STATUS_MODBUS STATUS Event text (Hex) Remedy Correct the parameterization in DB MODBUS_PARAM The data areas must not contain any overlapping register areas. The value range is 0 to 4. The parameterized areas data_type_3 and data_type_7overlap. Manual edition 2. DBW0 was changed or a wrong DB was defined. The length information in the INPUT DB_PARAM.

Read the identification string IDENT_CODE for this CPU and order the registration key at IT4industry. Check the error message of the communication partner. See also section 5 “Licensing”. A082 A083 Only if S7 is client: A request was initiated prior to the completion of the previous one.1 7-10 . Manual edition 2.Diagnosis Error messages of FB MODBUSPN at the output STATUS_MODBUS STATUS Event text (Hex) Remedy Verify the data of the communication partner with the help of a telegram trace. The communication partner does not support the requested function. The block MODBUSPN is not licensed for this CPU. Only if S7 is client and function code 6: The received register value is not equal to the sent one. A091 An exception telegram with exception code 1 was received (only if CP is client) An exception telegram with exception code 2 was received (only if CP is client) An attempt to an invalid or non existing address at the communication partner was made. Check the error message of the communication partner and verify the data with a telegram trace if needed. Verify the data of the communication partner with the help of a telegram trace. A092 A093 A094 A095 An exception telegram with exception code 3 was received (only if CP is client) An exception telegram with exception code 4 was received (only if CP is client) An exception telegram with an unknown exception code was received (only if CP is client). A081 Only if S7 is client and function code 5: The received coil status is not equal to the sent one. Wait with the initiation of a new request until the previous one was finished either with DONE/NDR = TRUE or ERROR = TRUE. MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02. Correct LENGTH or START_ADDRESS at the call of the FB. Please contact the Product Support. A084 A090 The character string for identification “IDENT_CODE” could not be determined. Check the error message of the communication partner.

1 7-11 . Please contact the product support. When RECV_TIME is exceeded. MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02. A101 The monitoring time of the TDISCON is exceeded. Manual edition 2. A100 The monitoring time CONN_TIME or RECV_TIME was exceeded when executing a job.Diagnosis Error messages of FB MODBUSPN at the output STATUS_CONN STATUS Event text (Hex) Remedy Check the parameterization of the connection. the connection is terminated.

4 Diagnosis Messages of Called Blocks Error messages of SFC 6 and SFC 20 at the output STATUS_MODBUS STATUS Event text (Hex) Remedy See online help (SIMATIC manager -> mark block -> key F1) See online help (SIMATIC manager -> mark block -> key F1) 7xxx 8xxx For detailed information please refer to the online help of SIMATIC Manager. Error messages of FB 63. Use the same IDB for the call of MODBUSPN in OB1 or cyclic interrupt OB and OB100.1 7-12 . 80A1 DB Number = 0 or too large for the PLC This error code is also reported. 80B1 The DB does not exist in the PLC. All data blocks that are specified in DB_x must be created and copied into the PLC. 80B2 DB UNLINKED MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02. when FB MODBUSPN is called with different instance DBs in OB1 or cyclic interrupt OB and OB100. For detailed information please refer to the online help of SIMATIC Manager. Manual edition 2. 7. FB 65 and FB 66 at the output STATUS_CONN STATUS Event text (Hex) Remedy See online help (SIMATIC manager -> mark block -> key F1) See online help (SIMATIC manager -> mark block -> key F1) 7xxx 8xxx For detailed information please refer to the online help of SIMATIC Manager. DB must not be created as UNLINKED.5 Diagnosis Messages of SFC24 Error messages of SFC24 at the output STATUS_MODBUS STATUS Event text (Hex) Remedy Choose a valid DB number.Diagnosis 7. For detailed information please refer to the online help of SIMATIC Manager. FB 64.

1 8-1 . • • Simatic Station is S7-300. General Information Example Project on the CD On the CD you can find an extensive example project which offers all varieties of parameterization possibilities for the Simatic stations. with variable table) and for licensing • Data blocks for register and bit values Used Blocks The following blocks are used in the provided sample project for S7 stations with FB MODBUSPN. S7-400 or IM 151-8 PN/DP CPU Simatic Station is client or server Sample Program The programming example consists of the blocks: • Start-Up OB100 with call of FB102 • Programming error OB121 with call of FB102 • Cyclic program processing OB1 with call of FB102 • Global DBs for job trigger (e. the provided example project is meant for information purposes only. Manual edition 2. Block OB 1 OB 100 OB 121 FB 102 FB 103 FB 104 FB 105 DB 1 DB 2 DB 3 DB 102 DB 11 DB 12 DB 13 DB 14 DB 15 Symbol CYCL_EXC COMPLETE RESTART PROG_ERR MODBUSPN TCP_COMM MOD_CLI MOD_SERV CONTROL_DAT MODBUS_PARAM LICENSE_DB IDB_MODBUS DATA_AREA_1 DATA_AREA_2 DATA_AREA_3 DATA_AREA_4 DATA_AREA_5 Comment cyclic program processing start-up OB for restart programming error OB FB MODBUSPN FB TCP_COMM FB MOD_CLI FB MOD_SERV work DB CONTROL DAT for FB MODBUSPN parameter DB PARAM_DB for FB MODBUSPN license data block for FB MODBUSPN instance DB for FB MODBUSPN value DB for area 1 value DB for area 2 value DB for area 3 value DB for area 4 value DB for area 5 MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02.Application Sample 8 Sample Application The following simple programming example illustrates the use of FB MODBUSPN.g. It displays the handling of the Modbus blocks and is not to be understood as a solution for a customer-specific installation configuration. Please note.

org MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02. Manual edition 2. 2006 http://www.modbus-IDA. December 28.A Literature MODBUS IDA MODBUS APPLICATION PROTOCOL SPECIFICATION V1.1 .1 Appendix .1b.

which are replaced with actual values when the relevant block is called. The configuration is the set up of individual modules of the PLC in the configuration table. With the help of a connection ID the system function blocks can communicate between two communication points. Automation System B Baud Rate Block Call .Glossary A Address The address identifies a physical storage location. MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02. Communications processors are modules for point-to-point connections and bus connections. With STEP7 there are • • • Bus Segment Code blocks (FB.1 Glossary . Module for communications tasks. structure. CP Communications Processor. an object that requests a service from a -> server. different input and output devices as well as HMI devices. the operand stored there can be directly accessed. Subnets can consist of bus segments and connectivity devices such as repeaters and bridges. SFB. An automation system is a programmable logic controller that contains at least a PLC. in general terms. OB. Blocks are elements of the user program which are defined by their function. C Client A client is a device or. Segments are transparent for addressing. FC. If the address is known. or purpose. SFC) Data blocks (DB. Manual edition 2.> transmission rate A block call occurs when program processing branches to the called block Block parameters are variables within multiple-use blocks.1 . Communications Processor Configuration Connection Parameterization The specification of a connection ID in the system function block. SDB) User-defined data types (UDT) Block Parameter Blocks Part of a -> subnet.

CRC Cycle Time Cyclic Program Processing D Data Block (DB) These are blocks containing data and parameters with which the user program works. Data types allow users to define how the value of a variable or constant is to be used in the user program. Every PLC has a diagnostic buffer. Unlike all other blocks. The default setting is a basic setting which is always used if no other value is specified. in accordance with the IEC standard.2 . are ”blocks with memory”.g.1 Glossary . memory. Function blocks can be parameterized but can also be used without parameters. say. They are classified into elementary and structured data types. The memory for the function block is an assigned data block. errors on a module or system errors in the PLC.CPU Central processing unit of the S7 programmable logic controller with control and arithmetic unit. data blocks do not contain instructions. Diagnostic events are. MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02. code blocks) from the programming device into the load memory of the PLC. In cyclic program processing. Manual edition 2. Data Type Default Setting Diagnostic Buffer Diagnostic Event Diagnostic Functions Download F Function Block (FB) Function blocks are components of the user program and. the user program is executed in a constantly repeating program loop. analysis and reporting of errors within the automation system. which are caused by. The diagnostics functions cover the entire system diagnosis and include detection. H Hardware Hardware is the term given to all the physical and technical equipment of a PLC. Cyclic Redundancy-Check = Checksum which guarantees a high probability of error recognition. Complex data can be stored in structured form. The data held in the data blocks can be accessed absolutely or symbolically. operating system. The cycle time is the time the PLC needs to execute the user program once. called a cycle. They are subdivided into global data blocks and instance data blocks. for example. in which detailed information on diagnostic events are stored in the order in which they occur. and interfaces to I/O modules. Downloading means loading objects (e. a so called ”instance data block”. a program error or by operating mode transitions.

STEP7 allows you to display contextual help texts on the screen while working with the programming software. MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02.3 .I Industrial Ethernet Instance Data Block A LAN system complying with IEEE 802. Interface Module Interrupt M MAC-Address Address to distinguish between different stations connected to a common transmission medium (Industrial Ethernet). On the interface module the physical conversion of signals takes place. Interrupt is a name for a break of the program processing in the processor of an automation system by an external alarm. The functionality of the PLCs varies in the individual operating modes.1 Glossary . Media Access Control (MAC) Mechanisms for controlling access by a station to a common transmission medium shared with other stations. An operand is part of a STEP7 instruction and states with what the processor is to do something. O Online / Offline Online means that a data connection exists between PLC and programming device. A distinction is made between static and dynamic module parameters. Module Parameters N NCM S7 for Industrial Ethernet Configuration software for configuration and diagnostic functions on an Ethernet CP. Module Modules are pluggable printed circuit boards for programmable logic controllers Module parameters are used to set the module behaviors. START UP and RUN. It can be both absolutely and symbolically addressed. Online Help Operand Operating Mode Operating System of the PLC The operating system of the PLC organizes all functions and operations of the PLC which are not connected to a specific control task. The SIMATIC S7 programmable controllers have three different operating modes: STOP. Offline means that no such data connection exists. By exchanging the pluggable interface module you can adapt the communications processor to the physical interface of the communications partner.3 (ISO 8802-2) An instance data block is a block assigned to a function block and contains data for this special function block. Manual edition 2.

A service is started at the instigation of a -> client. be connected together by -> gateways to form a network. the process image of the outputs is transferred to the output modules as output signals. MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02. Subnets can. System functions are software modules without memory which are already integrated into the operating system of the S7-PLC and can be called by the user as required. These include the operating system and the user programs. S Server A server is a device. A subnet is part of a -> network whose parameters must be matched. A subnet consists of several stations with unique -> MAC addresses. At the end of the cyclic program. They are classified into system data blocks. Software START UP STEP7 Subnet System Block System Function (SFC) System Function Block (SFB) System function blocks are software modules with memory which are already integrated into the operating system of the S7-PLC and can be called up by the user as required.4 . Software is the term given to all programs used on a computer system. This is a special memory area in the PLC. for example. A system consists of several subnets with unique subnet numbers. the signal states of the input modules are transferred to the process image input table. System blocks differ from the other blocks in that they are already integrated into the S7-400 system and are available for already defined system functions. A distinction is made between block parameters and module parameters. The execution of a data interchange operation according to a specific protocol is called a procedure. an object that provides certain services.P Parameter Parameters are values that can be assigned. or in general terms. The communications partners involved in a data interchange must abide by fixed rules for handling and implementing the data traffic. Parameterization means setting the behavior of a module.1 Glossary . system functions. and system function blocks. The operating mode START UP is active when the PLC transits from operating mode STOP to operating mode RUN. STEP7 is the programming software of SIMATIC S7. Manual edition 2. The subnet includes bus components and all the attached stations. At the beginning of the cyclic program. These rules are called protocols. Parameterization Procedure Process image Protocol R Rack A rack is a rail containing slots for mounting modules.

5 . User Program V Variable A variable is an operand (e. Manual edition 2. he set or selected transmission rate depends on various conditions.g. for example the distance across Transmission Rate U Upload Uploading means loading objects (e. by means of which a system or a process can be controlled. code blocks) from the load memory of the PLC into the programming device. According to DIN 44302.T Tool A tool is a piece of software that is capable of accessing operating system functions in a programming device. The user program for SIMATIC S7 is structured and is divided into smaller units called blocks. MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02. The unit is bps. E 1. W Work Memory The work memory is a RAM on the PLC which the processor accesses while processing the user program. The user program contains all instructions and declarations for signal processing.g.0) which can have a symbolic name and can therefore also be addressed symbolically.1 Glossary . this is the number of binary decisions transmitted per time unit.

com http://www.com/s7modbus Siemens Aktiengesellschaft Subject to change without prior notice. Manual edition 2.siemens.1 .industry@siemens. 60 91052 Erlangen Tel: ++49 9131 7-46111 Fax: ++49 9131 7-44757 Mail: it4.Customer Support Siemens AG Industry Sector I IS IN E&C Werner-von-Siemens-Str. Stand: 06/2009 MODBUS / TCP communication via the integrated PN interface of the CPU 2XV9450-1MB02.