Siemens network card - ethernet card user manual (22 pages)
Summary of Contents for Siemens SIMATIC S7
SIMATIC S7 - OPEN MODBUS / TCP Communication via CP343-1 and CP443-1 Manual...
Preface, Table of Contents Product Description Getting Started SIMATIC S7 Commissioning OPEN MODBUS / TCP Licensing Communication via CP343-1 and 443-1 FB MODBUSCP Diagnostics Manual Application Samples Appendices Literature Glossary Edition 4.3...
Preface Preface Purpose of the The information in this manual allows you to set up and put in operation the connection between the CP 343-1/CP 443-1 and a device that supports the Manual Open MODBUS/TCP protocol. Contents of the This manual describes the function of the function block MODBUSCP and Manual its integration into the hardware and software of the communication processors CP 343-1/CP 443-1.
If you have further questions regarding the use of the FBs described in this Questions manual, which are not answered in this document, please contact your Siemens partner who supplied you with this function block. Terminology This document uses the term CP or CP 343/CP 443. The descriptions only apply to communications processor CP 343-1/CP 443-1.
Table of contents Table of Contents ..Product Description....................... 1-1 ..Field of Applications..................1-1 ..Hardware and Software Prerequisites.............. 1-2 ..Getting Started ....................... 2-1 ..Commissioning ......................3-1 ..Installing the Library on the STEP7 PG/-PC ............ 3-1 ..
Table of contents ..Sample project STL ..................7-2 ..Sample project CFC ..................7-3 OPEN MODBUS / TCP communication via CP343-1 and 443-1 2XV9450-1MB00; Manual edition 4.3...
1, 2, 3, 4, 5, 6, 15 and 16 are provided. Data transmission is carried out following the Client-Server principle. The SIMATIC S7 can act as both client and server during the data transmission. TCP/IP with CP343-1 and CP434-1 uses static connections. The TCP TCP/IP with connection is not disconnected during errror-free operation.
The usage of the modbus blocks is possible with STEP7 Version 5.4 or higher. Withal the use of the blocks AG_LSEND/AG_LRECV V3.1 of the update of SIMATIC NET library (http://support.automation.siemens.com/WW/view/en/22172239) is required. The FB MODBUSCP requires ca. 6k byte work and load memory. Memory requirements The FB MB_CPCLI requires ca.10k byte work and memory.
Getting started Getting Started Procedure 1. Install “OpenModbusTCP CP“. => Section 3.1 2. Parameterize the connection parameters regarding your requirements (IP-address, port number, etc.). => Section 3.2 to 3.4 3. Insert the Modbus function blocks into your SIMATIC project. => Section 3.6 4.
To access the Modbus library the first time, use the browse function of the open dialog for libraries. The manual can be accessed via short cut in \Program Files \Siemens \Documentation as well. OPEN MODBUS / TCP communication via CP343-1 and 443-1...
Commissioning Parameterization of the CP Parameterization If you have your stations connected with each other without a router, then they have to be within the same subnet. of the CP In the field Subnet connect the CP with the Industrial Ethernet. In order to do that, select the entry with the name of your network.
Commissioning Parameterization In the mode “CP is client” an “other station” is required for network configuration. of the Communication Partner After you have inserted the communication partner’s station into your STEP7 project (as described in “Project components: Insert Other station“) you have to specify the object properties of the external station.
Commissioning 2) Properties – Other Station General In tab “General” you do not have to make any settings. Network Configuration Communications The CP is the link for the Industrial Ethernet connection between the S7-CPU and the communication partner / bus. A connection configuration must be Connection made for the connection of the interfaces to the communication partner / bus.
Commissioning After selecting Insert New Connection... the dialog box ”Insert new connection“ will come up. Select the connection partner (Other Station) for the new connection and use “TCP Connection” for the connection. Put a check mark on “Show properties dialog“ Click “OK“.
Commissioning • An ID is provided. You can change the ID if needed. Object Properties • Click on the button “Routing” and the configured connection will be shown. of the Connection • The MODBUS client must execute “Active connection establishment”. •...
Commissioning Unspecified If you have got a communication with CP as MODBUS server, the communication is set up as “unspecified connection”. The client must carry Connection with out active connection establishment. “CP is server” After selecting Insert New Connection... the dialog box ”Insert new connection“...
Commissioning Click “OK“. This will take you back to the dialog box “Properties TCP connection“. The check box “active connection establishment” must not be activated. In the register “addresses” all information regarding the partner, “IP” and “PORT” are left blank. Click on “OK“...
Commissioning How to Select the Appropriate Modbus Block General The block FC10 AG_CNTRL of the SIMATIC_NET library permits to terminate and reestablish an established connection. This block was also implemented Information in the Modbus blocks for a more effective use of the resources of CPU and CP.
Commissioning Insertion of the Function Blocks into the Program Content of The following blocks are required for the Modbus communication: MODBUS library • MODBUSCP • MB_CPCLI • MB_CPSRV Insertion of the In order to exchange data with MODBUS devices, you need the function blocks MODBUSCP, MB_CPCLI, MB_CPSRV and AG_CNTRL if applicable.
Commissioning Insertion of the The Modbus function blocks use the function blocks AG_SEND and AG_RECV in S7-300 or AG_LSEND and AG_LRECV in S7-400. Communication You can find these communication function blocks in the library Blocks “SIMATIC_NET_CP“ which are included in the software package NCM S7 for Industrial Ethernet.
Modbus clients can establish a connection via port 502. The CP acts as Modbus server. Here you can find information which CP and which firmware release support multiple connections via port 502: www.siemens.com/s7modbus Pre-requisits To use the functionality, the parameterization must be carried out as follows: •...
Commissioning Start_up Characteristics of CP343 / CP443 Introduction The start up of the CP is divided into the following phases: • Initialization (Power on of the CP) • Parameterization Initialization As soon as the CP is connected to power, the hardware self test runs. The firmware of the CP is set up for operation.
8. Delete the previous Modbus call or comment it out. Load the program into the CPU and execute a restart of the CPU. Notes to V4.3 Here you find information to V4.3: www.siemens.com/s7modbus, tab “Downloads”. OPEN MODBUS / TCP communication via CP343-1 and 443-1 3-14 2XV9450-1MB00;...
Licensing Licensing General The block MODBUSCP 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. The OB121 must be available in the CPU. To read the IDENT_CODE please proceed as follows: Read the IDENT_CODE 1.
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_TCP_CP during installation and is also available on the installation CD. Insert the License-No. of the product package into the form.
Licensing Declaration of the The registration key REG_KEY must be declared for each call of the block MODBUSCP. Registration Key REG_KEY The registration key REG_KEY should be stored in a global DB. Via this global DB all MODBUSCP blocks can receive the registration key (See also the following example).
Licensing Missing or Wrong When the registration key is missing or a wrong one is detected, the SF LED (S7-300) or the INTF LED (S7-400) of the CPU is flashing. A cyclic error Licensing message regarding the missing license is displayed in the diagnostic buffer too.
Function Block MODBUSCP Function Block MODBUSCP Functionality of the FB General The function block MODBUSCP allows a communication between a CP443-1 and CP 343-1 and a partner, which supports Open MODBUS/TCP protocol. Information The function codes 1, 2, 3, 4, 5, 6, 15 and 16 are supported. Depending on the parameterization the FB can be operated both in client and in server mode.
Function Block MODBUSCP • Data transfer to and from the parameterized DB • Monitoring the data reception with a time-out • Verification of the registration key Online-Help In Simatic Manager an online help for function block MODBUSCP is provided. Mark the FB and press the key “F1”. The online help is displayed; it contains the main information regarding the FB.
Function Block MODBUSCP Initiate Request A rising edge at the trigger input ENQ_ENR initiates a request. Depending on the input parameters UNIT, DATA_TYPE, START_ADDRESS LENGTH and CP is Client WRITE_READ a MODBUS request telegram is generated and sent to the partner station via the TCP/IP connection.
Function Block MODBUSCP Parameters of the Function Block MODBUSCP Parameter Decl. Type Description Value range Init WORD Connection-ID as per configuration in NetPro 1 to 64 laddr WORD Input-Address of the CP in HW Config dependent MONITOR TIME Monitoring Time: Wait for data from T#20ms to communication partner T#+24d20h31...
Function Block MODBUSCP Parameter Decl. Type Description Value range Init start _3 WORD 3rd data area: first Modbus address in this DB 0 to 65535 W#16#0000 to W#16#FFFF end _3 WORD 3rd data area: last Modbus address in this DB 0 to 65535 W#16#0000 to W#16#FFFF...
Function Block MODBUSCP Parameter Decl. Type Description Value range Init end _7 WORD 7th data area: last Modbus address in this DB 0 to 65535 W#16#0000 to W#16#FFFF data_type_8 BYTE 8th data area: data type (Coils, Inputs, 0 to 4 Holding Register, Input Register), NULL if not used db _8...
Function Block MODBUSCP Parameter Decl. Type Description Value range Init LENGTH WORD Number of registers to be processed (INPUT if in CLIENT mode, OUTPUT if in SERVER mode) Coils: reading function 1 to 2000 writing function 1 to 1968 Inputs: reading function 1 to 2000 Holding Register: reading function 1 to 125...
Function Block MODBUSCP For each configured connection in STEP7 (NetPro) a connection ID is assigned. The connection ID identifies unambiguously the connection from the CPU via the CP to the communication partner. The number from the connection configuration has to be entered here. The range of values for this parameter is 1 to 64.
Function Block MODBUSCP db_x The parameter db_x defines the number of the data block in which the consecutively defined MODBUS registers or bits are mapped. 0 cannot be used as DB number since it is reserved for system functions. db_x DB-Number 1 - 65535 (W#16#0001 to W#16#FFFF) start_x...
Function Block MODBUSCP DONE_NDR In the operating mode “CP is client“ the activated request was executed without error. For a read function the response data from the server has already been entered into the DB. For a write function the response to the request telegram has been received from the server.
Function Block MODBUSCP DATA_TYPE The parameter DATA_TYPE defines which Modbus data type is to be accessed with the current job. The following data types are available: Coils B#16#1 Inputs B#16#2 Holding Register B#16#3 Input Register B#16#4 In the operating mode “CP is client”, DATA_TYPE is an input parameter. In the operating mode “CP is server”, DATA_TYPE is an output parameter.
Function Block MODBUSCP WRITE_READ This parameter defines if a read or write function should be carried out. If the value of the input/output is FALSE, it specifies the read mode. The value TRUE specifies the write mode. Only Holding Registers and Coils can be written. Input Registers and Inputs can be read merely.
Function Block MODBUSCP Example: data_type_1 B#16#3 Holding Register db_1 W#16#B DB 11 Parameterization start_1 W#16#1 Start address: 1 of the Memory end_1 W#16#1F4 End address: 500 Areas data_type_2 B#16#3 Holding Register db _2 W#16#C DB 12 start _2 W#16#2D0 Start address: 720 end _2 W#16#384 End address: 900...
Function Block MODBUSCP Data and Standard Functions used by the FB Instance DB The function block MODBUSCP stores its data in an instance DB. This instance DB is created by STEP7 at the first call of the FB. The instance data block contains parameters of type Input, Output, Input/Output as well as static variables that it needs for its execution.
Function Block MODBUSCP MODBUSCP: The FB MODBUSCP uses the following SFBs/SFCs from the standard library: SFCs for • SFB4 „TON“ Miscellaneous • Functions SFC6 „RD_SINFO“ • SFC20 „BLKMOV“ • SFC51 „RDSYST” • SFC52 „WR_USMSG MB_CPCLI and The FBs MB_CPCLI and MB_CPSRV use the following SFCs from the MB_CPSRV: standard library: SFCs for...
Function Block MODBUSCP Renaming of Standard Functions Inducement Whether you have already used the numbers of standard functions in your project or the block number is reserved for a different application, you may rename the internal called functions FC5/FC50 or FC6/FC60, FC10 or the blocks MODBUSCP, MB_CPCLI and MB_CPSRV.
Diagnostics Diagnostics Diagnostic The diagnostic functions of the CP 343/ CP 443 allow you fast failure Function localization. The following diagnostic features are available: • Diagnostics via the display elements of the CP • Diagnostics via the STATUS output of the function block MODBUSCP. The display elements inform you about the operating mode or about the Display Elements failure conditions of the CP.
Diagnostics Diagnostic Messages of the FB MODBUSCP Messages at the The block MOBUSCP has got 2 status outputs: STATUS and STATUS_FUNC. STATUS displays all error numbers. STATUS_FUNC shows STATUS Output of the name of the function, which caused the error. STATUS is valid when the FB ERROR is TRUE.
Diagnostics Error messages FB MODBUSCP STATUS Event text Remedy (Hex) A006 The given range of data defined with DATA_TYPE, CP is Client: START_ADDRESS and LENGTH does not exist in Correct the parameter’s data_type_1 to data_type_8. combination DATA_TYPE, CP is server: START_ADDRESS and The CP sends an exception telegram.
Diagnostics Error messages the FB MODBUSCP STATUS Event text Remedy (Hex) A00E The length indicated in the MODBUS specific telegram Verify the data of the header does not match the number of registers/bits or communication partner with the the byte count in the telegram. The FB receives all data help of a telegram trace.
Diagnostics Error messages of FB MODBUSCP STATUS Event text Remedy (Hex) A01E The CP has received invalid data which could not be Check the error message of the assigned. communication partner and verify the data with a telegram trace if MODBUSCP V2.x: needed.
Diagnostics Error messages of FB MODBUSCP STATUS Event text Remedy (Hex) A067 The parameterized areas data_type_6 and Correct the parameterization. data_type_7 overlap. The data areas must not contain A068 The parameterized areas data_type_6 and any overlapping register areas. data_type_8 overlap. A078 The parameterized areas data_type_7 and data_type_8 overlap.
Diagnostics Error messages of FB MODBUSCP STATUS Event text Remedy (Hex) An exception telegram with exception code 1 was The communication partner does A091 received (only if CP is client) not support the requested function. An exception telegram with exception code 2 was Correct LENGTH or A092 received (only if CP is client)
Diagnostics Diagnostic Messages of FC5/FC6 and FC50/FC60 Diagnostic messages of the included blocks AG_SEND/AG_RECV (FC5/FC6) and AG_LSEND/AG_LRECV (FC50/FC60) at the output STATUS STATUS Event text Remedy (Hex) 7xxx For detailed information please refer to the online help See online help (SIMATIC of SIMATIC Manager.
Application Sample Application Samples General With the installation 2 sample projects are installed in \Program Files\Siemens\Step7\Examples. Information • sample project “MB_TCP_CP” written in STL and • sample project “MB_TCP_CP_CFC” written in CFC The S7 programs are for information purposes only and are not to be understood as a solution for a customer specific installation configura- tion.
Application Sample Sample project STL General The sample project written in STL includes serveral Simatic stations for the different applications. Information • Simatic Station is S7-300 or S7-400 • Simatic Station is client or server • Simatic Station supports or doesn’t support AG_CNTRL Used Blocks The subsequent listed blocks are used in the provided example project for S7 stations with FB MODBUSCP.
Application Sample Sample project CFC General The sample project written in CFC includes two Simatic S7-400 stations, one is parameterized as client, the other one as server. Information Used Blocks The subsequent listed blocks are used in the provided example project with FB MODBUSCP.
A Literature MODBUS IDA MODBUS APPLICATION PROTOCOL SPECIFICATION V1.1b, December 28, 2006 http://www.modbus-IDA.org OPEN MODBUS / TCP communication via CP343-1 and 443-1 Appendix - 1 2XV9450-1MB00; Manual edition 4.3...
Customer Support Siemens AG Industry Sector I IS IN OC Werner-von-Siemens-Str. 60 91052 Erlangen Tel: ++49 9131 7-46111 Fax: ++49 9131 7-44757 Mail: email@example.com http://www.siemens.com/s7modbus Siemens Aktiengesellschaft Subject to change without prior notice. Stand: 06/2011 OPEN MODBUS / TCP communication via CP343-1 and 443-1...