Home
Display - Service, Support
Contents
1. RUNS Data type Size 0 Area not used 1 Coils Bit 2 Inputs Bit 3 Holding Register Word 4 Input Register Word 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 The size of the data blocks must be 2 byte larger than it is necessary for the Modbus values The last word is used for internal purposes and it is not allowed to change it start x Start x specifies the first register or bit address which is stored in the data element 0 of the DB The maximum number of Modbus addresses which can be stored in the DB is defined by its length The DB length is calculated during start up of the CPU When accessing registers the last register address which is mapped in the S7 DB can be calculated with the following formula Last register address in DB DB length in byte 2 2 start x 1 When accessing coils or inputs the last register address which is mapped in the S7 DB can be calculated with the following formula Last coil address in DB DB length in byte 2 8 start x 1 Please note The defined data areas must not overlap In section 5 5 you can find an example of the mapping of the MODBUS addresses to S7 memory areas SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 5 15 2XV9450 1MB 1 1 Manual edition 2 2 Fu
2. Rerrark Anmerkung Software anc electronic documentation or CD Order No Hestell Nr 26 SAM 11 Jun se No Lizenrdir 20996 6501 000084 Pm 4 Sendthis form as Service Request to Customer Support Hereupon you will receive the registration key for your PLC SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 4 2 2XV9450 1MB11 Manual edition 2 2 Declaration of the Registration Key REG KEY Licensing The registration key REG KEY must be declared for each call of the Modbus block The registration key REG KEY should be stored in a global DB Via this global DB all Modbus blocks can receive the registration key See also the following example Please proceed as follows to declare the registration key REG KEY 1 Copy the prepared license block DB3 of the library Modbus TCP CP Red300 400 into your project If the DB number is already used in your project rename the license DB Open the license DB and copy the 17 digit registration key you received to the column Initial value VSLAD STL FBD DB3 LICENSE DB MODBUS_TCP_CP_Redundant H Singl ick File Edit Insert PLC Debug View Options Window Help Da Ed X S o c li gia n 9a 66 1 TE Raaress Kane me rattan vele ey 0 0 rec xz striwcti7 insert REG KEY Registration Key Declare the registration key in the data block as initial value to avoid a repeated insertion after rel
3. 2 use all conn FALSE check conn cycle gt 0s The telegrams are transferred via 1 connection The other projected connections are on standby When the parameterized time check conn cycle elapses a cyclical check of all parameterized connections is executed Number of faulty STATUS 0A STATUS 0B STATUS 1A STATUS 1B RedErrS7 RedErrDev TotComErr connections Po fo S LS o m raise rust ee ee Co o eo o ease rase Fus ODE o o prse tuse raise m4 o o o ese raise rus Los o9 eo So mee rase use Co f o o o ws e vus Ceo o o o ms rase rase e Co f eo eo o ws ruse rase Ceo o so o rese m vus Ceo es o o rase muse Ceo so so o mu ime se Ceo o o o me me rase Ceo o so so mue mu rus o o eo o me me ras Ce eo eo eo eo mue me 7e SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 9 7 2XV9450 1MB11 Manual edition 2 2 Diagnostics 3 use all conn TRUE check conn cycle gt Oms 2 projected connections The telegrams are transferred via 2 projected connections When the parameterized time check conn cycle elapses a cyclical check of the connections is executed Number of faulty STATUS 0A STATUS OB STATUS 1A STATUS 1B RedErrS7 RedErrDev TotComErr connections o FEF e0 FFFF TRUE TRUE FALSE FFFF BES FFFF TRUE TRUE FALSE
4. Box Modbus device The Modbus addresses printed in black refer to the Data Link Layer the ones printed in grey refer to the Application Layer Box SIMATIC The SIMATIC addresses printed in black are the offset in the DB You can find additionally the Modbus register numbers printed in grey SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 2XV9450 1MB 1 1 Manual edition 2 2 5 19 Function Block MB REDCL Modbus Client SIMATIC VS LAD STL FBD DB13 Coils A ick File Edit Insert PLC Debug Coils from 00001 Dc Sea amp e o eiiet soT a EX NENNEN EN B NENNEN 76 2 Coils 1250 Bc Modbus device G File Edit Insert PLC Debug View Option Dc Re xu cc wojserdins Register 01 eon Holding C z ofiouaing Register 21 vo Register Input Register from 30001 996 0 Holding Register 498 WORD 938 0 Holding Register 499 WORD TSILAD STL FBD DB12 Holding Register ick File Edit Insert PLC Debug View Optio Denel SBREloO en NN 773 o ojseisims Regoeo Ahrom 2 officiaing negi7217 eese r officiaing nest7z2 wom ina RAN oR Fase olfioiaing Resrass feom sso ojseiaims mestsooi won SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 5 20 2XV9450 1MB 1 1 Manual edition 2 2 Function Block MB REDCL Moabus Client 5 6 Data and Standard Function used by the FB Instance DB Local Variables Timers Flags Standard
5. This block numbers are also used in the provided example project for S7 stations with FB MB_REDCL OB1 CYCL EXC Cyclic program processing OB 100 COMPLETE Start Up OB for Re Start RESTART OB 121 PROG ERR Programming error OB sd error Programming error OB sd FB 907 MB_REDSV FB MB_REDSV FB 906 MB_CPSRV Internal called FB MB_CPSRV DBs LICENSE 08 License DB or F8 MB REDY DB12 DATA AREA 2 Register DB Tor memory areaz D1 DATA AREA 3 Register DB or memory areas SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 10 3 2XV9450 1MB11 Manual edition 2 2 Application Sample 10 3 Example project in CFC Modbus Client Overview The example was created with CFC V7 1 SP2 1656 1650 1656 1650 1680 1656 16 0 160 b E im m D o a w jm m ool 4 i K BIT 3 BIT 5 BIT 6 BIT BIT 16 1 i 1653 1652 1654 16s3FFC 168SFFS 30s insert REG KEY DONE Counter cru e o 9 a a a 1000 ERROR Counter cru Upwards Save_STATUS Save STA HW eeeoeeoeodd so m et e 1655 1651 1651 1651 j 3 R_TRIG Recosnit one L B m l m LJ EEPEPEFErE Used Blocks This block numbers are also used in the provided example project for S7 stations with FB MB REDCL OB35 CYCL EXC Cyclic program processing OB 100 COMPLETE Start Up OB for Re Start RESTART
6. not networked New 1 Properties Ethernet 4 Ethemet 5 zl Delete Cancel Help Click on the OK button This will bring you back to the tab Interfaces Properties other station x General Interfaces Name Type Address Subnet Ethernet port 1 Industrial Ethernet 10 0 0 31 Ethernet 2 OK Cancel Help 2 Properties Other Station General In tab General you do not have to make any settings SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 3 3 2XV9450 1MB11 Manual edition 2 2 Commissioning 3 3 Network Configuration Communications Connection Configure Network in mode CP is Client The CP is the link for the Industrial Ethernet connection between the S7 CPU and the communication partner bus A connection configuration must be made for the connection of the interfaces to the communication partner bus In the STEP7 project select the CPU in your S7400H Station and open Network configuration by double clicking Connections This opens the program NetPro with which your connections can be configured After selecting Insert New Connection the dialog box Insert new connection will come up E NetPro MODBUS TCP CP Redundant Network E Program Files Examples MODBUS _ 98 Network Edit Insert PLC View Options Window Help ee S ede te 8 oo JESERTES Ethernet 1 E ES m d a m T H Single sided
7. 4 use all conn TRUE check conn cycle gt Oms 4 projected connections The telegrams are transferred via 4 projected connections When the parameterized time check conn cycle elapses a cyclical check of the connections is executed Number of faulty STATUS 0A STATUS 0B STATUS 1A STATUS 1B RedErrS7 RedErrDev TotComErr connections 2 SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 9 8 2XV9450 1MB1 1 Manual edition 2 2 Diagnostics 9 5 2 Server Block The time check conn cycle must be parameterized when using the server block Number of faulty STATUS 0A STATUS 0B STATUS 1A STATUS 1B RedErrS7 RedErrDev TotComErr connections 2 SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 9 9 2XV9450 1MB 1 1 Manual edition 2 2 Application Sample 10 Application Sample Sample General Information Example Project on the CD Simatic Stations in the Example Project With the installation 2 sample projects are stored in Program Files Siemens Step7 Examples e sample project MB_TCP_CP_RED_ 400 written in STL and e sample project MB TCP CP RED 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 On the CD you can find an extensive example project which offers all varieties of parameterization possibilities for the Simatic statio
8. 9 2 Diagnostics STATUS Remedy Hex A007 CP is client An invalid monitoring time MONITOR is Correct the parameterization parameterized A value 20ms is required A008 Monitoring time MONITOR elapsed when AG REOV Verify error messages at the waits for receipt E g connection is not established communication partner Partner is not ready Check if the communication The connection is terminated and reestablished partner needs a special unit identifier A009 CP is client The received transaction identifier TI is Verify the data of the not equal to the sent one communication partner with the The connection is terminated and reestablished help of a telegram trace AO0A CP is client The received UNIT is not equal to the Verify the data of the sent one communication partner with the The connection is terminated and reestablished help of a telegram trace AO0B CP is client Received function code is not equal to the CP is client Verify the data of the sent one communication partner with the help of a telegram trace CP is server An invalid function code was received CP is server The Modbus FB The CP sends an exception telegram supports the function codes 1 2 The connection is terminated and reestablished 3 4 5 6 15 and 16 CP is server The CP sends an exception telegram help of a telegram trace The connection is terminated and reestablished AOOD Only when CP is client The register bi
9. OB121 PROG ERR Programming error OB FB 909 MB REDCL FB MB REDCL wy PBemeaeiycro SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 10 4 2XV9450 1MB 1 1 Manual edition 2 2 Application Sample 10 4 Example project in CFC Modbus Server Overview The example was created with CFC V7 1 SP2 NDR OA Counter ctu ERROR_OA Counter cru ubera ETT MB IN wi 40555 arie pe 1680 Linef Ro cer i6s9 REG 4 is 16eoReG_2 4 py i6 O REG 3 MB_REDSY 1680 REG 4 MB_REDSY 16 0REG_S 1651 Save STRTUS OR 16 0 REG_6 16s3 id 4 a Save STR icno RES T 16m2 ee i6so kEe 8 i6s jid 4 b ERROR 1646 REG S A683FFC status Save sta 1683FF 1oddr cp srarus F 38 check co 2 1553 data typ status 4 MB IN B dba ERROR 48 Counter i654 cru e Le 1693 Upwards zea o db 2 ET e jir2 165206 E SS Ss o er 1680 vod S e1r 4 i6sO db 3 Pu 9 BIT 5 1680 s jire 1650 data tup Red 9 do 4 Save STRTUS 4R opts 165250 Save STR ofert s 15 200mz 48555 insert REG KEY NDR OB Counter Save STA 14 ENR ctu 9 ounter cru cru Used Blocks This block numbers are also used in the provided example project for S7 stations with FB MB REDSV OB35 CYCL EXC Cyclic program processing OB 100 COMPLETE Start Up OB for Re Start RESTART OB 121 PROG ERR P
10. and e FB906 MB CPSRYV amongst others gt Modbus TCP CP Red300 400 Component view C Program Files SIEMENS STE TS 2 mi x Ej Q amp Modbus TCP CP Red300 400 Object name Symbolic name Created Type Version 7 300 Client amp FB906 MB CPSRV SCL Function Block 2 2 57 300 Server g FB907 MB_REDSY SCL Function Block 2 3 H E S7 400 Client DB3 LICENSE DB DE DataBlock 01 57 400 Server Eoo Both blocks are required for redundant communication The function block MB REDSV executes a multiple call of MB CPSRV SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 3 9 2XV9450 1MB 1 1 Manual edition 2 2 Commissioning Insertion of the Open the library Modbus TCP CP Red300 400 and copy the necessary blocks blocks Insert the blocks into your program The Modbus function block uses the function blocks AG LSEND and AG LREOV Copy these functions from the library SIMATIC NET CP gt CP 400 and insert them into your program Copy also the function AG CNTRL from the library SIMATIC NET CP into your program Please note that the following versions of the FCs are a prerequisite for the faultless function of the FBs MB REDCL MB REDSV AG LSEND _ V3 1 or higher AG LRECV _ V3 1 or higher SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 3 10 2XV9450 1MB 1 1 Manual edition 2 2 Commissioning 3 5 Multiple Connections via Port 502 General P
11. s START ADDRESS The parameter START ADDRESS specifies the first MODBUS address that is read or written SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 5 16 2XV9450 1MB 1 1 Manual edition 2 2 LENGTH WRITE READ UNIT LICENSED BUSY DONE ERROR STATUS 0A STATUS 1A STATUS 0B STATUS 1B IDENT CODE Function Block MB REDCL Moabus Client The parameter LENGTH specifies the number of MODBUS values that are read or written For read functions a maximum of 125 Holding Registers and Input Registers is possible per telegram For Coils and Inputs a maximum of 2000 bits is possible For write functions a maximum of 123 Holding Registers or 1968 Coils is possible All registers or bits have to be in the same DB per telegram 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 This input has to be set according to the requirements The FB copies this value to the request telegram and verifies when the respond telegram is received Please note that some communication partners expect a certain unit number If this output is TRUE then the Modbus block is licensed on this CPU If the output is FALSE none or a faulty license string was typed in You can find further information in section 4 Licensing If this output is TRUE one of the functions AG LSEND
12. 1 Manual edition 2 2 Table of contents Table of Contents 1 ProductDescription utet a tea edt asset d TUE due eI ee daa 1 1 1 1 Field of Applications sssssssssssseeeeeeennnnnne nennen nnns 1 1 1 2 Hardware and Software Prerequisites sssseeeeene 1 2 2 Getting Started 5 52 15 2522 5 051 c DG Dei IL Iii ii Bi 2 1 3 COMMISSIONING t 3 1 3 1 Installing the Library on the STEP7 PG PC seeen 3 1 3 2 Parameterization of the CP ssssssssssssssssseeeeeneeneeen nennen 3 2 3 3 Network Configuration eseessssssssesseeeeeeeneeenn enne nnn nnns 3 4 3 4 Insertion of the Function Blocks into the Program 3 9 3 5 Multiple Connections via Port 502 sssssssssseeenees 3 11 3 6 Start up Characteristics of CP443 sssssseen 3 12 4 DICONSING E 4 1 5 Function Block MB REDCL Modbus Client e 5 1 5 1 Configuration of the Redundant Communication seessssss 5 1 5 2 Functionality of FB MB REDGOL ssssssseeeeeeeeeeeeeenn nnne 5 4 5 3 Connection Testing by means of AG ONTRL sssssss 5 10 5 4 Parameters of the Function Block MB REDGOL sssseeeeee 5 11 5 5 Example for Address Mapping ssessssesseeennnn 5 19 5 6 Data and Standard Function used
13. A B Mi Other station Server1 mj Other station Server2 Configuration in While configuring the hardware in HW Config both CPO and CP1 get HW Config different input and IP addresses so that they can be addressed unique in the S7 program respectively from the communication partner Configuration in You have to define one connection in NetPro for each possible connection NetPro between the communication partners With single sided redundancy there is one connection for CPUO CPO and one for CPU1 CP1 e Connection from CPUO CPO to Partner gt Connection 0A e Connection from CPU1 CP1 to Partner gt Connection 1A With double sided redundancy there are two connections for CPUO CPO and two for CPU1 CP1 e Connection from CPUO CPO to Partner Node A gt Connection 0A e Connection from CPU1 CP1 to Partner Node A gt Connection 1A e Connection from CPUO CPO to Partner Node B gt Connection 0B e Connection from CPU1 CP1 to Partner Node B gt Connection 1B SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 5 1 2XV9450 1MB 1 1 Manual edition 2 2 Function Block MB REDCL Moabus Client The figures in the following example illustrate the denotation of the connections Please note when configuring network connections that the end points of the connection S7 CPO und CP1 partner node A and node B must have at least one distinctive feature for addressing either the IP address or the port number
14. EventID 1644090 4 12 29 46 097 PM 08 03 2010 Area length error when reading 5 12 28 46 096 PM 08 03 2010 Event ID 16 4090 6 12 28 46 096 PM 08 03 2010 Area length error when reading 12 27 46 095 PM 08 03 2010 EventID 16 4090 8 12 27 46 095 PM 08 03 2010 Area length error when reading x Details on Event 1 of 120 EventID 158 4090 No entry in text database Hexadecimal values will be displayed Event ID 16 4090 OB 16 01 PK 16 01 DatlD 1 2 16 52 C2 Additional infol 2 3 188 4D4F 4442 5553 xi Save As Settings Update Print Open Block Warning The CPU will turn to STOP mode if the OB121 is not available Modbus communication is carried out even with a missing or wrong registration key but the outputs STATUS x is set to W 16 A090 no valid license SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 4 4 2XV9450 1MB 1 1 Manual edition 2 2 Function Block MB REDCL Modbus Client 5 Function Block MB REDCL Modbus Client 5 1 Configuration of the Redundant Communication General The CP is client if the S7 takes the initiative to read data from or to write data Information to the remote partner The communication partner of the H system can be mounted stand alone or redundant too single sided or double sided redundancy Single sided redundancy Double sided redundancy H Single sided Client H Double sided Client Switch Switch A
15. If the output is FALSE none or a faulty license string was typed in You can find further information in section 4 Licensing SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 6 12 2XV9450 1MB11 Manual edition 2 2 BUSY NDR 0A NDR 1A NDR 0B NDR 1B Function Block MB REDSV Modbus Server If this output is TRUE one of the functions AG LSEND or AG LREOCV is running The output is set for each correct executed request of the client via the corresponding connection ERROR 0A If this output is set an error occurred at the corresponding connection when ERROR 1A receiving a request or sending a response The error number is displayed in ERROR 0B the STATUS x outputs ERROR 1B STATUS 0A The STATUS x outputs display the error number when ERROR is TRUE As STATUS 1A long as ERROR is FALSE STATUS x displays status information for the STATUS 0B corresponding connection STATUS 1B The error numbers and status information are described in chapter Diagnostics IDENT CODE After start up of the PLC this parameter displays the identification code an 18 character string With this IDENT CODE you can order the registration key You can find further information in section Licensing RedErrS7 If this output is true SIMATIC side lost redundancy In single sided redundancy mode the connection of CPO or CP1 is disturbed In double sided redundancy mode both connections of CPO or both connections of CP1
16. In HW Config CPO und CP 1 get always different IP addresses Therefore in the network configuration each CP can use the same port number If the communication partner has got only one IP address then each connection has to use a different port number Usually the Modbus server is addressed via the port number 502 the Modbus client uses a port number from 2000 A wrong port number identical port numbers will be recognized by NetPro while entering the value and or closing the configuration window SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 5 2 2XV9450 1MB 1 1 Manual edition 2 2 Function Block MB REDCL Modbus Client Example The following figure illustrates a configuration example in NetPro for single Single Sided sided redundancy Redundancy 7 is client IMPUDP CP4C 1 CPU DP HPUDP CP4C 1 10 0 0 60 PO partner is server BH The S7 station has got the IP addresses 10 0 0 50 and 10 0 0 51 and can use the port number 2000 for both connections The communication partner has got the IP Address 10 0 0 60 and must be addressed with 2 different port numbers 502 and 503 Example The following figure illustrates a configuration example in NetPro for double Double Sided sided redundancy Redundancy 7 is client DP MPVDP CP4C 1 10 0 0 51 2000 2001 E 10 0 0 60 10 0 0 61 m partner is server Oo H The S7 station has got the IP addresses 10 0 0 50 and 10
17. MODBUS message requesting the read of a holding register at offset 0 would return the value known to the application programmer as found in register 40001 memory type 4xxxx reference 0001 One potential source of confusion is the varying interpretation of the register address in different manuals Sometimes the register address means the address of the application layer sometimes the address transferred The FB MB REDCL uses the Modbus address transferred at its parameters start x und START ADDRESS So it is possible to use register addresses from von 0000 to FFFF with each function code data type 1 B 16 3 Holding Register db 1 W 16 B DB 11 start_1 W 16 1 start address 0 data_type_2 BHI 6 3 Holding Register db 2 W 16 C DB 12 start 2 W 16 2D0 start address 720 data_type_3 B 16 0 not used db 3 0 0 start 3 0 0 data_type_4 BH16 1 Coils db 4 W 16 D DB 13 start 4 W 16 2D0 start address 640 For this example applies e DB11 consists of 1002 byte 500 registers are mapped register 0 register 499 2 reserved byte e DB12 consists of 364 byte 181 register are mapped register 720 register 900 2 reserved byte e DB13 consists of 79 byte 611 bits are mapped Coil 640 Coil 1250 2 reserved byte The following diagram shows the comparison of the SIMATIC memory area and the Modbus typical register oriented storage arrangement The diagram is based on the above parameterization
18. STATUS Remedy Hex A019 O is assigned to one of the parameters db x while the Correct the parameterization of according data type x is O db xto gt 0 DB 0 can t be used it is reserved for system functions AO1A Wrong length in header Verify the data of the Range of values 3 to 253 bytes communication partner with the The connection is terminated and reestablished help of a telegram trace AO1B CP is server and function code 5 Verify the data of the An invalid value for coils was received communication partner with the CP sends an exception telegram help of a telegram trace AO1E The CP has received invalid data which could not be Check the error message of the assigned communication partner and verify The connection is terminated and reestablished the data with a telegram trace if needed AO1F The FB MB REDCL and MB REDSY respectively Please contact the product have turned to an invalid state support A020 Check conn cycle is set to lt 1s so no or a too small Correct the parameterization cycle time is parameterized for AG CNTRL Client With use all conn TRUE a cycle time 1s is required Server A cycle time 1s is required A023 The parameterized areas data type 2 and Correct the parameterization The data type 3 overlap data areas must not contain any overlapping register areas A024 The parameterized areas data type 2 and data type 4 overlap A034 The parameterized areas
19. as both client and server during the data transmission Redundant communication is supported A S7 400H system as well as a S7 400 single CPU with 2 CPs can be used Hot standby means the parallel redundant processing of signals in redundant components This allows a bumpless failover of the entire system to the standby components TCP IP with TCP IP with CP443 1 uses static connections The TCP connection is not CP443 1 disconnected during operation Network configuration of STEP7 enables only a unique use of a specific port number when using TCP native stack of the CP However with specific CP modules it is possible to use multiple connection via port 502 to different clients simultaneously In section 3 6 Mulitple connections via port 502 you can find technical details regarding this matter SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 1 1 2XV9450 1MB 1 1 Manual edition 2 2 Product Description 1 2 Hardware and Software Prerequisites Usable Modules for MB REDCL and MB REDSV Software Versions Memory requirements The block AG CNTRL of the SIMATIC NET library permits to terminate and reestablish an established connection This block was also implemented in the Modbus blocks for a more effective use of the resources of CPU and CP However previous CPs or previous firmware releases do not support the use of AG CNTRL Here you can find up to date information which CPs and which firmware rel
20. at the output STATUS x SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 6 7 2XV9450 1MB 1 1 Manual edition 2 2 Function Block MB REDSV Modbus Server 6 4 Parameters of the Function Block MB REDSV Connection ID for CPU CPO according to the configuration in NetPro 1 to 64 W 16 1 to W 16 40 1 to 64 W 16 1 to W 16 40 1 to 64 W 16 1 to W 16 40 Connection ID for CPU CP1 according to the configuration in NetPro Connection ID for CPU CPO according to the configuration in NetPro Only required with double sided redundancy 1 to 64 W 16 1 to W 16 40 Connection ID for CPU CP1 according to the configuration in NetPro Only required with double sided redundancy laddr cpO WORD Input address of the CPO from HW Config CPU dependent laddr_cp1 WORD _ Input address of the CP1 from HW Config CPU dependent check_conn_c Cycle time for connection testing by the T 1s to ycle means of AG_CNTRL T 24d20h31 data_type_2 WORD 1st data area data block number WORD 1st data area first Modbus address in this DB BYTE 2nd data area data type Coils Inputs Holding Register Input Register NULL if not used WORD _ 2nd data area data block number WORD _ 2nd data area first Modbus address in this DB data_type_3 BYTE 3rd data area data type Coils Inputs Holding Register Input Register NULL if not used N data type 1 IN BYTE 1st data area data type Coils Inputs Holding Register In
21. in H Systems 1 2XV9450 1MB 1 1 Manual edition 2 2 Additional Sources of Information Additional Questions Terminology Preface All additional information concerning CP 443 mounting commissioning etc can be found in the manual SIEMENS SIMATIC Fault Tolerant Systems 7 400H System Manual A5E00267693 03 SIEMENS SIMATIC NET S7 CPs for Industrial Ethernet device manual C79000 G8900 C155 SIEMENS SIMATIC NET S7 CPs for Industrial Ethernet device manual part B4 CP 443 1 C79000 G8900 C152 SIEMENS SIMATIC NET NOM S7 for Industrial Ethernet manual C79000 G8900 C129 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 SIEMENS SIMATIC Software System software for S7 300 400 System and standard functions Reference manual C79000 G7000 C503 02 If you have further questions regarding the use of the FBs described in this manual which are not answered in this document please contact your Siemens partner who supplied you with this function block This document uses the term CP or CP 443 The descriptions only apply to communications processor CP 443 1 Scope of The function block described in this manual establishes a connection Application between the CP 443 1 and third party MODBUS devices SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 2 2XV9450 1MB 1
22. initialization Init Status WORD Status of manual initialization 0 to FFFF no General The parameters of the FB MB REDSV can be divided into two groups information e Initialization parameter e Runtime parameter The initialization parameters are evaluated only at the first initial execution of the function block MB REDSV and taken over into the instance DB They are marked in the above table in the column INIT with yes A modification of the initialization parameters during the runtime has no impact After the modification of these parameters e g at the test mode the instance DB must be initialized via a STOP RUN transition of the CPU Runtime parameters can be used in cyclical operations It is not advised to change the input parameters while a request is active The output parameters are displayed dynamically i e they are only available for one PLC cycle 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 Range of Values For the range of values of the different parameters CPU specific restrictions must be taken in consideration SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 6 10 2XV9450 1MB 1 1 Manual edition 2 2 id O a id 1 a id O b id 1 b laddr_cp0 laddr_cp1 check_conn_cycle Function Block MB REDSV Modbus Server For each configured connection in STEP7 NetPro a connection ID is as
23. occurred connection TRUE 0A FALSE STATUS 0A WORD Status for connection 0A 0 to FFFF NDR 1A OUT BOOL TRUE The request of the client via TRUE no connection 1A was executed and FALSE responded to ERROR_1A OUT BOOL TRUE An error has occurred connection TRUE Sm FALSE STATUS 1A WORD Statusforconnection fA OtoFFFF x NDR OB OUT BOOL TRUE The request of the client via TRUE connection OB was executed and FALSE responded to ERROR OB OUT BOOL TRUE An error has occurred connection TRUE no 0B FALSE SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 6 9 2XV9450 1MB11 Manual edition 2 2 2 Function Block MB REDSV Modbus Server Peas enge esi Yaeerae Wi STATUS 0B OUT WORD Status for connection 0B 0 to FFFF NDR 1B OUT BOOL TRUE The request of the client via TRUE connection 1B was executed and FALSE responded to ERROR 1B OUT BOOL TRUE An error has occurred connection TRUE no 1B FALSE STATUS 1B OUT WORD Status for connection 1B 0 to FFFF no IDENT_ OUT STRING Identification for licensing Please order Character no CODE 18 your license with this identification string RedErrS7 BOOL TRUE 7 lost redundancy TRUE FALSE no RedErrDev OUT BOOL TRUE 3rd party device lost redundancy TRUE FALSE no TotComErr OUT BOOL TRUE Complete communication failure TRUE FALSE no Init Error OUT BOOL TRUE Error occurred during manual TRUE FALSE no
24. or AG_LRECV is running The activated request was executed without error via one connection at least 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 When this output is set errors occurred at all active connections use all conn FALSE In case of a protocol error ERROR is immediately set In case of a connection error all the configured connections are verified and ERROR is set not until all connections report an error use all conn TRUE When this output is set errors occurred at all configured connections The error number is displayed in the STATUS x outputs The STATUS x outputs display the error number when ERROR is TRUE As long as ERROR is FALSE STATUS x displays status information for the corresponding connection The error numbers and the status information are described in chapter Diagnostics After start up of the PLC this parameter displays the identification code an 18 character string With this IDENT CODE you can order the registration key You can find further information in section Licensing SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 5 17 2XV9450 1MB11 Manual edition 2 2 Function Block MB REDCL Moabus Client RedErrS7 If this output is true the SIMATIC lost redundancy In single sided redundancy mode the connection of CPO or CP
25. partner station via TCP IP connection The client waits for the parameterized monitoring time for a response from the server When in the first execution of a cyclic FB after restart of the H system a job is triggered via all connections the standby CPU may report error 80B2 once This happens due to system characteristics of the H system SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 5 5 2XV9450 1MB 1 1 Manual edition 2 2 Function Block MB REDCL Moabus Client Sending The Modbus telegram is sent via a single the current active connection Telegrams via a when use all conn FALSE In case the monitoring time elapses no answer Single Connection from the server or a faulty connection the telegram will be sent successively via the other configured connections maximum 4 The sequence in doing so is OA 1A OB und 1B When a telegram was transferred successfully via one connection this one is marked active and the following telegrams are transferred via this active connection In case of a connection error of the active connection a transmission retry is carried out via the other parameterized connections If all transmission attempts fail ERROR and STATUS x are set accordingly When the client receives a respond a validity check is carried out If the result is positive necessary actions will be taken and the request will be terminated without error The output DONE is set When an error is recognized d
26. printed in grey refer to the Application Layer Box SIMATIC The SIMATIC addresses printed in black are the offset in the DB You can find additionally the Modbus register numbers printed in grey SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 2XV9450 1MB 1 1 Manual edition 2 2 6 14 SIMATIC DE LAD STL FBD DB13 Coils A ick File Edit Insert PLC Debug ee Be ee e o eiiet soT a EX NENNEN EN B NENNEN 76 2 Coils 1250 Bc G File Edit Insert PLC Debug View Option Dee HS Xs cc Bee a Holding Register 0 p z o otding negister 11 void ce WORD 938 0 Holding Register 499 q WORD TSILAD STL FBD DB12 Holding Register ick File Edit Insert PLC Debug View Optio Denel SBREloO en NN 773 o ojseisims Regoeo Ahrom 2 officiaing negi7217 eese r officiaing nest7z2 wom ina RAN oR Fase olfioiaing Resrass feom sso ojseiaims mestsooi won Function Block MB REDSV Moabus Server Modbus device Coils from 00001 Input Register from 30001 Holding Register SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 6 15 2XV9450 1MB 1 1 Manual edition 2 2 Function Block MB REDSV Modbus Server 6 6 Data and Standard Function used by the FB Instance DB Local Variables Timers Flags Standard FCs for Data Transfer SFCs and FCs for Miscellaneous The function block MB REDSV stores its data in an instance DB T
27. siemens com s7modbus or contact the Customer Support SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 7 2 2XV9450 1MB11 Manual edition 2 2 Application with S7 300 8 Application with S7 300 General Usable Modules for MB REDCL und MB REDSV Modbus Blocks The library Modbus TCP Redundant can be used with a S7 300 station as well The description of functions and parameters in the previous and following sections apply accordingly with S7 300 Ethernet 1 ndustrial Ethernet oingle siaee client Bl Other station Server1 You can only use s7 300 CPUs which provide enough local data per priority class gt section 5 6 and section 6 6 The block AG_CNTRL of the SIMATIC_NET library permits to terminate and reestablish an established connection This block was also implemented in the Modbus blocks for a more effective use of the resources of CPU and CP However previous CPs or previous firmware releases do not support the use of AG_CNTRL Here you can find up to date information which CPs and which firmware releases support AG_CNTRL Ethernet CPs and AG CNTRL You can find further hardware prerequisites on the internet www siemens com s7modbus The installed library Modbus TCP CP Red300 400 includes the folders for S7 300 S7 300 client and S7 300 server with the blocks for S7 300 gt Modbus TCP CP Red300 400 Component view C Program Files SIEMENS
28. sssssseee 9 6 9 4 Diagnostic Messages of SFC24 sssssssssssssssssseeeeeeenne nemen 9 6 9 5 Diagnostics with Alarm Bits 9 7 9 5 1 Client z oer SERRE 9 7 9 5 2 SOLVER BIOCK E 9 9 10 Application Sample 1eeeeeeeeeseeeeeeeeeeeeeeee eene nnns annes nnn nnns annus nnn 10 1 10 1 Example project in AWL Modbus Client eeeeeeeeee 10 2 10 2 Example project in AWL Modbus Server sssssssee 10 3 10 3 Example project in CFC Modbus Client sssseeeeee 10 4 10 4 Example project in CFC Modbus Server sssssssssne 10 5 A Literature T 1 SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems ii 2XV9450 1MB 1 1 Manual edition 2 2 Product Description 1 Product Description 1 1 Field of Applications Placement in the The driver described here is a software product for the Communications System Environ Processor CP443 1 in a SIMATIC S7 redundant system ment CP 443 1 can be used in the SIMATIC S7 400 automation systems and can establish communication links to partner systems Function of the These function blocks enable a communication link between CP 443 1 and a FBs device that supports the Open MODBUS TCP protocol The function codes 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
29. the following SFCs from the standard library Miscellaneous e SFB4 TON Functions e SFC6 RD SINFO e SFC20 BLKMOV e SFC51 RDSYST e SFC52 WR USMSG The block MB CPCLI uses the following system functions e SFC20 BLKMOV e SFC24 TEST DB e SFBA TON Additional The parameter TI is operated internally in MB_REDCL and is incremented Information with each new request Error 8304 When the connection from the CP to the communication partner is interrupted the interruption is recognized by the CP and error number 8304 stored When a communication request is activated first error code 8304 is returned even if the connection is available again because this error code is still stored This is a given system characteristics of the CP When the MODBUS function block returns ERROR TRUE and STATUS 8304 the communication request should be activated once again The time delay to recognize the termination of a connection can be modified with the parameter Send Keepalives for Connections of the CP s properties in HW Config SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 5 22 2XV9450 1MB 1 1 Manual edition 2 2 Function Block MB REDCL Moabus Client 5 7 Renaming Rewiring of Standard Functions and Function Blocks Inducement Whether you have already used the numbers of standard functions in your project or the block number is reserved for a different application e g in CFC you may rename rewire the intern
30. 0 0 51 For the access to node A of the communication partner both CPs CPO and CP1 can use port number 2000 because both of them are having different IP Addresses connection 0A and 1A For the access to node B of the communication partner it is also possible that both CPs CPO and CP1 use the same Port number 2001 Connection OB and 1B The communication partner has got the IP Addresses 10 0 0 60 and 10 0 0 61 For the access to CPO of S7 node A and node B can use the same port number 502 Connection 0A and OB For the access to CP1 of S7 itis also possible to use the same port number 503 Connection 1A and 1B SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 5 3 2XV9450 1MB 1 1 Manual edition 2 2 Function Block MB REDCL Moabus Client 5 2 Functionality of FB MB REDCL General It is possible to run an H station as Modbus client and Modbus server simultaneously Therefore the adequate blocks for client and server communication must be called and the necessary connections in NetPro must be parameterized For each group of redundant connections consisting of 2 connections for single sided redundancy or 4 connections for double sided redundancy the Modbus block must be called once That means when the H station acts as client and as server with single sided redundancy 2 connections for the server call and 2 connections for the client call are required in NetPro When the H station acts as client and a
31. 1 is disturbed In double sided redundancy mode both connections of CPO or both connections of CP1 are disturbed You can find further information in section 9 5 Diagnostics with Alarm Bits RedErrDev If this output is true the 3rd party device lost redundancy In single sided redundancy mode the connection from node A to CPO or to CP1 is disturbed In double sided redundancy mode both connections to node A or both connections to node B are disturbed You can find further information in section 9 5 Diagnostics with Alarm Bits TotComErr The output TotComErr TRUE shows a complete communication failure All connections are disturbed You can find further information in section 9 5 Diagnostics with Alarm Bits Init Error An error during the manual initialization is shown with Init Error TRUE Init Status The output Init Status displays the error number when Init Error is TRUE The error numbers are described in section 9 Diagnostics SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 5 18 2XV9450 1MB 1 1 Manual edition 2 2 Function Block MB REDCL Moabus Client 5 5 Example for Address Mapping Interpretation of Modbus Addresses Example Parameterization of the Memory Areas Address Mapping MODBUS bases its data model on a series of tables which have distinguishing characteristics The distinction between these memory areas is done via the register address by some systems e g MODICON PLOs So a
32. 3 1 in H Systems 6 16 2XV9450 1MB11 Manual edition 2 2 Function Block MB REDSV Modbus Server Additional Error 8304 When the connection from the CP to the communication partner Information is interrupted the interruption is recognized by the CP and error number 8304 stored When a communication request is activated first error code 8304 is returned even if the connection is available again because this error code is still stored This is a given system characteristics of the CP When the MODBUS function block returns ERROR TRUE and STATUS 8304 the communication request should be activated once again The time delay to recognize the termination of a connection can be modified with the parameter Send Keepalives for Connections of the CP s properties in HW Config SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 6 17 2XV9450 1MB11 Manual edition 2 2 Function Block MB REDSV Modbus Server 6 7 Renaming Rewiring of Standard Functions and Function Blocks Inducement Whether you have already used the numbers of standard functions in your project or the block number is reserved for a different application e g in CFC you may rename rewire the internal called function blocks AG LSEND AG LRECV or the blocks MB REDSV and MB CPSRV It is not possible to rename rewire the system functions SFC6 SFC20 SFC24 SFC51 and SFC52 as well as the system function block SFB4 Sequence You must follow some r
33. Client DP MP DP CP CPU 0P MPUDP 1 i H mi Other station Server1 CP Ax epee ee oh BH gsm m Hm m 4 Ctrl N Show Hide Columns Optimize Column Width Display Columns 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 SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 3 4 2XV9450 1MB 1 1 Manual edition 2 2 Object Properties of the Connection Insert New Connection 1 xi r Connection Partner amp In the current project amp MODBUS TCP CP Redundant Fe H Double sided Client H Double sided Server Ez H Single sided Server Other station Serverl B Other station Server2 Unspecified All broadcast stations 4ll multicast stations Bp In unknown project i Project MODBUS_TCP_CP_Redundant x Station Other station Serverl Module Connection Type TCP connection m IV Display properties before inserting Apply Cancel Help Commissioning Click OK This will take you back to the dialog box Properties TCP connection An ID is provided You can change the ID if needed Click on the button Routing and the configured connection will be shown The MODBUS client does Active connection establishment Properties TCP conne
34. FCs for Data Transfer The function block MB REDCL 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 needed for its execution These variables are non volatile and keep its validity between FB calls The variables control the internal process flow of the FB Required memory of the instance DBs Instance DB work memory load memory MB REDCL ca 4 kByte ca 5 kByte The FB requires 96 Bytes of local variables Additionally the subordinate FBs require local variables FBs MB_CPCLI 28 byte or AG_CNTRL 178 byte That gives a maximum of 302 Bytes of local data fora FB MB_REDCL call The function block does not use any timer The function block does not use any flags The function block uses the blocks AG_LSEND and AG_LRECV from the SIMATIC_NET library for the data transfer between CPU and CP AG_CNTRL is used additionally to reset and restart a connection in case of error The following versions of the FCs are tested with the FB MB_REDCL and released for the communication e FC50 AG LSEND Version 3 1 e FC60 AG LREOV Version 3 1 e AG CNTRL CP 400 Version 1 0 SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 5 21 2XV9450 1MB11 Manual edition 2 2 Function Block MB REDCL Moabus Client SFCs and FCs for The FB MB REDCL uses
35. IP addresses 10 0 0 50 und 10 0 0 51 and can be addressed via both connections with the port number 502 The communication partner has got the IP Address 10 0 0 60 and has to use 2 different port numbers for the two connections 2000 und 2001 Example The following figure illustrates a configuration example in NetPro for double Double Sided sided redundancy Redundancy S7 is server CPU DP MPIDP CP4C 1 CPU DP MPDP CPLCI 1 2000 2001 2000 2001 10 0 0 60 10 0 0 61 partner is client The S7 station has got the IP addresses 10 0 0 50 and 10 0 0 51 for the access from node A of the communication partner Both CPs CPO and CP1 can use port number 502 because both of them are having different IP addresses connection 0A and 1A For the access from node B of the communication partner it is also possible that both CPs CPO and CP1 use the same port number 503 Connection 0B and 1B The communication partner has got the IP Addresses 10 0 0 60 and 10 0 0 61 for the access to CPO of S7 node A and node B can use the same port number 2000 connection 0A and OB For the access to CP1 of S7 it is also possible to use the same port number 2001 connection 1A and 1B SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 6 3 2XV9450 1MB 1 1 Manual edition 2 2 Function Block MB REDSV Modbus Server 6 2 Functionality of the FB MB REDSV General Performed Functions Call of the FB It is possible
36. Manual edition 2 2 The DB to which MODBUS addresses shall be mapped is too short Minimum length in byte registers START ADDRESS start x LENGTH 2 2 bits START ADDRESS start x LENGTH 8 2 Other possible reasons CP is client Wrong initialization parameter CP is server Wrong address area in the request telegram of the client Applies only with CP is client An invalid combination of DATA TYPE and WRITE READ is given CP is client An invalid value for the parameter LENGTH is given CP is server The number of registers or bits in the request telegram is invalid The CP sends an exception telegram Range of values Read coils inputs 1 to 2000 Write coils 1 to 1968 Read registers 1 to 125 Write holding registers 1 to 123 The given range of data defined with DATA TYPE START ADDRESS and LENGTH does not exist in data type 1 to data type 4 CP is server The CP sends an exception telegram Extend the DB CP is client Correct the parameters START ADDRESS or LENGTH CP is server Modify the request of the client Correct the parameters Only data type 1 or 3 can be written CP is client Correct the parameter LENGTH CP is server Modify the number of registers bits in the request telegram CP is client Correct the parameter s combination DATA TYPE START ADDRESS LENGTH CP is server Modify the request of the client or correct the parameterization of data type x
37. RUE or ERROR TRUE The manual initialization was started during processing Wait for the end of the running a telegram job before you start the manual initialization A085 Anerror occurred during the license handling due to Verify the project if there is any an invalid write access invalid write access to the license DB The structure of REG KEY must not be changed Please contact the Product Support if necessary The Modbus communication runs without a license as order the registration key A090 The Modbus block is not licensed for this CPU Read the identification string This is a status information The bit ERROR is not set IDENT CODE for this CPU and well A091 An exception telegram with exception code 1 was The communication partner does received only if CP is client not support the requested The connection is terminated and reestablished function An attempt to an invalid or non existing address at the the FB A092 An exception telegram with exception code 2 was Correct LENGTH or received only if CP is client START ADDRESS at the call of communication partner was made A093 An exception telegram with exception code 3 was The communication partner is not received only if CP is client able to execute the received telegram e g the requested length is not supported A094 An exception telegram with exception code 4 was The communication partner is in received only if CP is client a state in whi
38. SIEMENS SIMATIC SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems SIEMENS SIMATIC S7 SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems Manual Edition 2 2 Preface Table of Contents Product Description Getting Started Commissioning Licensing FB MB REDCL FBMB REDSV Add On for CFC Usage in S7 300 Diagnostics Application Sample Appendices Literature Glossary O Oc N O OC A WO N e Safety Precautions and 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 indicates that loss of life severe personal injury or substantial damage can result if proper indicates that minor personal injury or property damage can result if proper precautions are call attention to information that is especially significant to the product handling of the The equipment may be commissioned and put into operation by qualified personnel only Warnings triangle and 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 precautions are not taken Caution not taken Notes product or a specific part of this documentation Qualified Personnel For the purpose of safety relevant warnings of this manual a qua
39. STEP loj x zi Q amp Modbus_TCP_CP_Red300_400 Version Eig 7 300 Client ERFBS08 MB CPCLI SCL FunctionBlock 23 lupos g FB909 MB_REDCL SCL FunctionBlock 24 Eg 57 300 Server t DB3 LICENSE DB DB Data Block 01 H E 57 400 Client H E 57 400 Server gt j Copy the blocks into your project and parameterize the blocks as described in this manual Please make sure to use the blocks AG_CNTRL AG_SEND and AG_RECV of the S7 300 library SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 8 1 2XV9450 1MB11 Manual edition 2 2 Diagnostics 9 Diagnostics Diagnostic The diagnostic functions of the CP443 allow you fast failure localization The Function following diagnostic features are available e Diagnostics via the display elements of the CP e Diagnostics via the STATUS output of the modbus function block Display Elements The display elements inform you about the operating mode or about the LED failure conditions of the CP The display elements give you an overview of internal failures external failures and interface specific failures STATUS Output of For error diagnostics the FBs MB REDCL and MB REDSV respectively the MODBUS FB have got STATUS outputs By reading the STATUS outputs you get a general indication of failures that have occurred during the communication The STATUS parameters can be evaluated in the user program 9 1 Diagnostics via the Display Elements of the CP Display Functions The display elements o
40. T for FB MB REDCL DB3 LICENSE DB License DB for FB MB REDCL DB 11 DATA AREA 1 DB for memory area 1 DB 12 DATA AREA 2 DB for memory area 2 DB13 DATA AREA 3 DB for memory area 3 DB 909 IDB MODBUS Instance DB for FB MB REDCL SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 10 2 2XV9450 1MB 1 1 Manual edition 2 2 10 2 Example project in AWL Modbus Server Overview ES sg H Double sided Client B H Double sided Server s System data Application Sample SDB Used Blocks ick OBI STL 794 Organization Block EM CPU 4174H i 0B72 RED FLT STL 38 Organization Block 01 Gy S7Progam 08100 COMPLETE RESTART STL 430 Organization Block 0 1 arms ical RE CPU 417 4 H 1 086121 PROG ERR STL 38 Organization Block 0 1 x CP 4431 g FB906 MB CPSRV SCL 9484 Function Block 22 CP 443 11 FB307 MB REDSV SCL 11948 Function Block 23 B H Single sided Client g FC10 AG_CNTRL STL 1610 Function 1 0 H H Single sided Server amp FC50 AG_LSEND STL 846 Function 3 1 g FC60 AG LRECV STL 982 Function 31 DB1 CONTROL DAT DB 100 Data Block 0 1 iz DB3 LICENSE DB DB 56 Data Block 0 1 DB11 Holding Register Area 1 DB 1036 Data Block 0 1 iz DB12 Holding Register rea2 DB 398 DataBlock 01 D813 Coils Area 1 DE 114 Data Block 0 1 ick D6907 IDB Modbus Server DB 2052 Instance datablock 0 0 v Server job Server job Variable Table 0 1 TON STL System function block 1 0 l
41. UE 3rd party device lost redundancy TRUE FALSE OUT BOOL TRUE Complete communication failure Init Error OUT BOOL TRUE Error occurred during manual initialization Init Status WORD Status of manual initialization General The parameters of the FB MB REDCL can be divided into two groups information e Initialization parameter e Runtime parameter The initialization parameters are evaluated only at the first initial execution of the function block MB REDCL and taken over into the instance DB They are marked in the above table in the column INIT with yes A modification of the initialization parameters during the runtime has no impact After the modification of these parameters e g at the test mode the instance DB must be initialized via a STOP RUN transition of the CPU SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 5 13 2XV9450 1MB 1 1 Manual edition 2 2 Range of Values id O a id 1 a id O b id 1 b laddr_cp0 laddr_cp1 check_conn_cycle use_all_conn Function Block MB REDCL Modbus Client Runtime parameters can be used in cyclical operations It is not advised to change the input parameters while a request is active Wait with the preparation of the next request and the change of the parameter until the previous request ends with DONE or ERROR The output parameters are displayed dynamically i e they are only available for one PLC cycle They have to be copied to an ad
42. al called function blocks AG LSEND AG LRECV or the blocks MB REDCL and MB CPCLI It is not possible to rename rewire the system functions SFC6 SFC20 SFC24 SFC51 and SFC52 as well as the system function block SFB4 Sequence You must follow some rules regarding the block numbers when rewiring blocks in the SIMATIC Manager of STEP7 If you want to rewire the blocks of the Modbus library the following sequence is required 1 FC50 AG LSEND FC60 AG LRECV 2 FB908 MB CPCLI FB906 MB CPSRV 3 FB909 MB REDCL FB907 MB REDSV It is not necessary to rewire all blocks Even if you want to rewire only some of the blocks you must follow the mentioned sequence Renaming To rewire proceed as described subsequently 1 Get the information about the used operand by clicking Extras gt Reference data Display 2 Setthe operand priority in the object properties of the block folder to Absolute value 3 Call the function Extras Re wire in the SIMATIC Manager in order to re wire the operands into free areas 4 To be able to keep on using the symbolism diagnostics tools add the modifications in the symbolism table supplementary The modifications can be verified by clicking Extras Reference data Display SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 5 23 2XV9450 1MB 1 1 Manual edition 2 2 Function Block MB REDSV Modbus Server 6 Function Block MB REDSV Modbus Server 6 1 Configurat
43. are disturbed You can find further information in section 9 5 Diagnostics with Alarm Bits RedErrDev If this output is true the 3rd party device lost redundancy In single sided redundancy mode the connection from node A to CPO or to CP1 is disturbed In double sided redundancy mode both connections to node A or both connections to node B are disturbed You can find further information in section 9 5 Diagnostics with Alarm Bits TotComErr The output TotComErr TRUE shows a complete communication failure All connections are disturbed You can find further information in section 9 5 Diagnostics with Alarm Bits Init Error An error during the manual initialization is shown with Init Error TRUE Init Status The output Init Status displays the error number when Init Error is TRUE The error numbers are described in section 9 Diagnostics SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 6 13 2XV9450 1MB 1 1 Manual edition 2 2 Function Block MB REDSV Modbus Server 6 5 Example for Address Mapping Interpretation of Modbus Addresses Example Parameterization of the Memory Areas Address Mapping MODBUS bases its data model on a series of tables which have distinguishing characteristics The distinction between these memory areas is done via the register address by some systems e g MODICON PLOs So a MODBUS message requesting the read of a holding register at offset 0 would return the value kno
44. at least a response is received via one connection the output DONE is set If errors are detected at all connections the output ERROR is set and the error codes are displayed in STATUS x When a parameterized connection fails the following Modbus telegrams are not transferred via the faulty connection as long as the connection testing gt section 5 3 recognizes the reestablishment of this connection Case a All responds were received without an error Connection 0A Connection 1A I O at modbus block ENQ TRUE Request Response DONE TRUE ERROR FALSE STATUS 0A 0 STATUS 1A 0 SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 5 7 2XV9450 1MB 1 1 Manual edition 2 2 Function Block MB REDCL Modbus Client Case b At least one respond was not received successfully Connection 0A Connection 1A VO at modbus block ENQ TRUE Request Connection interrupted Response MONITOR ERROR FALSE STATUS_0A 0 STATUS_1A 8304 ENQ TRUE Request Response MONITOR ERROR FALSE STATUS 0A 0 Connection 1A STATUS 1A 20 is recovered Check of J connections DONE FALSE ERROR FALSE STATUS 0A 0 STATUS 1A 0 Both connections are used again ENQ TRUE Request pee ini MONITOR ERROR FALSE STATUS 0A 0 STATUS 1A 0 SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 5 8 2XV9450 1MB1 1 Manual edit
45. ber 1 to 65535 W 16 1 to W 16 FFFF start_1 IN WORD 1st data area first Modbus address in this 0 to 65535 DB W 16 0000 to W 16 FFFF SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 5 11 2XV9450 1MB11 Manual edition 2 2 Function Block MB REDCL Moabus Client data type 2 BYTE 2nd data area data type Coils Inputs 0 to 4 Holding Register Input Register NULL if not used db 2 WORD 2nd data area data block number 1 to 65535 W 16 1 to W 16 FFFF start 2 WORD 2nd data area first Modbus address in this 0 to 65535 DB W 16 0000 to Wi 1 6 FFFF data_type_3 BYTE 3rd data area data type Coils Inputs Holding Register Input Register NULL if not used db 3 WORD _ 3rd data area data block number 1 to 65535 W 16 1 to W 16 FFFF 4 start 3 IN WORD 3rd data area first Modbus address in this 0 to 65535 yes DB W3 680000 to W 16 FFFF data_type_4 IN BYTE 4th data area data type Coils Inputs yes Holding Register Input Register NULL if not used db IN WORD A4th data area data block number 1 to 65535 yes W 16 1 to W 16 FFFF start_4 IN WORD A4th data area first Modbus address in this 0 to 65535 yes DB W 16 0000 to W 16 FFFF MONITOR IN TIME Monitoring Time Wait for data from T 20ms to no communication partner T 24d20h31 m23s647ms REG_KEY STRING Registration key to activate the license Character no 17 IN no ENQ BOOL Initiate request at positive edge TRUE FALSE DATA TYPE BYTE Data ty
46. by the FB sesssssss 5 21 5 7 Renaming Rewiring of Standard Functions and Function Blocks 5 23 6 Function Block MB REDSV Modbus Server eene 6 1 6 1 Configuration of the Redundant Communication sssssssss 6 1 6 2 Functionality of the FB MB_REDSV ssssssssssseeeeeeennnneennn 6 4 6 3 Connection Testing by means of AG CNTRL sssssssssee 6 7 6 4 Parameters of the Function Block MB REDSY ccccccccceecesseeeeeeeeeeeeeeas 6 8 SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems i 2XV9450 1MB11 Manual edition 2 2 Table of contents 6 5 Example for Address Mapping sssseeeennnnn 6 14 6 6 Data and Standard Function used by the FB sssssssssss 6 16 6 7 Renaming Rewiring of Standard Functions and Function Blocks 6 18 7 Additional Blocks onion a ce eae eens 7 1 7 1 Add On tor GEG i RU RE ERE I A EEEE 7 1 7 2 Job List for cyclical telegram transfer 7 2 8 Application with S7 300 eeseseeeeeeeeeeeeeeeeeeeeen nene n nenne nennen nanus nnn n nnne 8 1 9 Diagnostics oti cies eect vase E aa aaa E A E 9 1 9 1 Diagnostics via the Display Elements of the CP eseese 9 1 9 2 Diagnostic Messages of the FBs MB REDCL and MB REDSYV 9 2 9 3 Diagnostic Messages of included FCSs SFOs
47. ch it is not able to execute a received telegram A095 An exception telegram with an unknown exception Check the error message of the code was received only if CP is client communication partner and verify the data with the help of a telegram trace AOFF The connection is not ready for communication Check the connections Correct the value of check conn cycle if applicable This error code is also reported when a CP is used which doesn t support AG CNTRL FFFF The connection is not parameterized If the connection should be used id x and laddr_x must be parameterized at start up SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 9 5 2XV9450 1MB 1 1 Manual edition 2 2 Diagnostics 9 3 Diagnostic Messages of included FCs SFCs Error messages of included FCs SFCs STATUS Remedy Hex 7XXX For detailed information please refer to the online help See online help SIMATIC of SIMATIC Manager manager gt mark block gt key F1 gt Ethernet gt see also gt code evaluation 8xxx For detailed information please refer to the online help See online help SIMATIC of SIMATIC Manager manager mark block gt key F1 gt Ethernet gt see also gt code evaluation 80B2 The communication bus connection between the CPU This error may occur once after and CP is not established restart of the H system and can be ignored 8186 ID parameter invalid Correct the parameter
48. ction E x General Information Addresses Options Overview Status Information Route IV Active connection establishment m Local Endpoint r Block Parameters ID hex 0001 4051 1 Name TCP Verbinduna 48 Wit GHIFF Via CP ce 443 1 R0 57 ID LADDR SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 2XV9450 1MB 1 1 Manual edition 2 2 3 5 Selection of the Port Number Commissioning e Inthe register Addresses the port numbers are defined Properties TCP connection x General Information Addresses Options Overview Status Information Ports from 1025 through 65535 are available For further ports refer to online help Local Remote IP dec 10 0 0 50 10 0 0 60 PORT dec 2000 502 Cancel Help Click on OK and the inputs are accepted Save the network configuration and close the program NetPro Please note that the connection ID Local ID has to be used when the FB is called in the user program In a MODBUS communication a MODBUS server are normally addressed via port 502 whereas a MODBUS client uses a port from 2000 SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 3 6 2XV9450 1MB11 Manual edition 2 2 Unspecified Connection with CP is server Commissioning If you have got a communication with CP as MODBUS server the communication is set up as unspecified connection The cl
49. data type 3 and data type 4 overlap AO07A An invalid value id is parameterized Range of values Correct the parameterization of is 1 to 64 id A07C Aninvalid value data type x was given The value Correct the parameterization of range is 0 to 4 data type x AO07D Parameter data type 1 is not defined The parameter Correct the parameterization of area 1 is the default area and must be defined data type 1 AO7E The DB number of db x is identical to the number of Correct the parameterization of the instance DB db x A080 Different instance DBs were used for the call of Modbus block must be called with Modbus block in OB100 and the cyclic OB the identical instance DB in OB100 and the cyclic OB A081 Only if CP is client and function code 5 Verify the data of the The received coil status is not equal to the sent one communication partner with the help of a telegram trace A082 Only if CP is client and function code 6 Verify the data of the The received register value is not equal to the sent communication partner with the one help of a telegram trace SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 9 4 2XV9450 1MB 1 1 Manual edition 2 2 Diagnostics STATUS Remedy Hex A083 Only if CP is client A request was initiated prior to the Wait with the initiation of a new completion of the previous one The request is not request until the previous one executed was finished either with DONE T
50. dbus Server The data transfer between CP and CPU are done with the standard function blocks AG_LSEND and AG_LRECV At the receipt of a telegram from the client the standard blocks necessary for the CP are called by the FB in the right order and number TCP IP with CP443 1 uses statistic connections The TCP connection cannot be disconnected while in run mode Given this system characteristic telegrams might be lost under unfavorable conditions when the synchronization had been lost after an error When the FB detects lost synchronization the connection is terminated and reestablished by means of AG_CNTRL If the communication partner terminates the TCP connection the next receive can be started not until an idle time of 1 second has elapsed This delay due to system characteristics is executed by the function block If the block has not been licensed yet the OB121 is called Warning The CPU will turn to STOP mode if the OB121 is not available 6 3 Connection Testing by means of AG_CNTRL Connection Testing The block MB_REDSV recognizes a faulty connection if during the transmission of telegrams the communication functions AG_LSEND AG_LRECV report an error To detect and solve actual connection problems immediately the configured connections are checked cyclically by the means of AG_CNTRL The parameter check_conn_cycle defines the interval of the testing The result of the connection testing is displayed
51. ditional memory area if you need to process them or to display the values in a VAT STEP7 variable table For the range of values of the different parameters CPU specific restrictions must be taken in consideration For each configured connection in STEP7 NetPro a connection ID is assigned The connection ID is the distinct description of the connection from the CPU via the CP to the communication partner The number of the configured connection has to be entered here The value range for this parameter depends on the CPU id 0a represents the connection from the CPO to node A id 1a represents the connection from the CP1 to node A id O b represents the connection from the CPO to node B id 1 b represents the connection from the CP1 to node B The connection OA is the default connection its configuration is mandatory If the communication partner is built up standalone then the parameters id 0 aandid 1 aare used The parameters laddr cpO and laddr cp1 represent the input address of the CPO and the CP1 from HW Config I Address The configured value has to be entered here The range of values for these parameters depends on the CPU This parameter defines the time interval for connection testing by means of AG CNTRL The time can be parameterized in 1 second steps the default value is 30 seconds The results of the connection testing are displayed at the outputs STATUS x When use all conn FALSE the connection testing can b
52. e Modbus block for this CPU gt Section 4 SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 2 1 2XV9450 1MB11 Manual edition 2 2 Commissioning 3 Commissioning General Information Requirements 3 1 Installing the What We Provide You Requirements The configuration of the CP 443 1 is possible via MPI or LAN Industrial Ethernet Required software is STEP7 with NCM S7 for Industrial Ethernet shortly named NCM IE All statements in the following sections referring to STEP7 or NCM IE are related to the STEP7 Version 5 4 SP3 and NCM S7 Industrial Ethernet Version 5 4 Operation flows names and directory names might be different in other STEP7 versions Knowledge of AWL and basic knowledge of STEP7 and PLC Library on the STEP7 PG PC The attached CD contains a setup which installs the library Modbus TCP CP Red300 400 the example projects and the manuals in English and German in the corresponding STEP7 directories The manuals can also be found on the CD as PDF file To install STEP7 must be installed Installation Insert your Modbus CD into the CD ROM drive and follow step by step the instructions that are automatically displayed by the installation program If the installation program fails to automatically run perform these steps 1 Using Windows Explorer navigate to the CD ROM drive and go to the directory setup and double click to the setup file to start the installation proc
53. e skipped by setting the time interval to 0 seconds If check conn cycle is parameterized with 0 ms it s not possible to recognize a connection error without a telegram traffic via this connection It is recommended to set this parameter gt 0 ms This parameter defines the number of connections Modbus telegrams are transferred With the setting FALSE the Modbus telegrams are sent via 1 connection This parameter set to TRUE causes the Modbus telegrams to be transferred via all configured connections SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 5 14 2XV9450 1MB 1 1 Manual edition 2 2 Function Block MB REDCL Moabus Client single write With single write 2 TRUE write requests with length 1 are carried out with the function codes 5 and 6 With single write FALSE all write requests use the function codes 15 and 16 Init The parameter INIT TRUE enables a manual initialization The initialization can be executed if currently no order is running This must be ensured in the user program with ENQ FALSE and BUSY FALSE If manual initialization it is important that the initialization parameters are parameterized in the cyclical OB During a manual initialization the parameterized connections are terminated and reestablished again data type x The parameter data type x defines the MODBUS data type which is to be mapped with this definition If data type x set to 0 this data area is not used
54. eases support AG CNTRL Ethernet CPs and AG CNTRL You can find further hardware prerequisites on the internet www siemens com s7modbus The usage of the FB MB REDCL and MB_REDSYV 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 de 22172239 is required The FB MB_REDCL requires 14 kByte work memory and 17 kByte load memory The FB MB_CPCLI requires 10 kByte work memory and load memory The FB MB_REDSV requires 12 kByte work memory and 14 kByte load memory The FB MB_CPSRV requires 10 kByte work memory and load memory You can find precise length information of the blocks in their properties in SIMATIC Manager SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 1 2 2XV9450 1MB11 Manual edition 2 2 Getting Started 2 Getting Started Procedure Install SIMATIC Modbus TCP Redundant gt Section 3 1 Parameterize the connection parameters regarding your requirements IP address port number etc gt Section 3 2 and 3 3 Insert the Modbus function blocks into your SIMATIC project gt Section 3 4 Modbus Client Call and parameterize the Modbus block MB REDCL in the required OBs gt Section 5 2 and 5 3 or Modbus Server Call and parameterize the Modbus block MB_REDSV in the required OBs gt Section 6 2 and 6 3 Load the user program into the PLC and license th
55. edure 2 Follow step by step the instructions that are displayed by the installation program Now you can find e the libraries in Program Files Siemens Step7 S7libs e the example projects in Program Files Siemens Step7 Examples e the manual in Program Files Siemens Step7 S7manual S7Comm e the Software Registration Form in Program Files Siemens Step7 S7libs Modbus_TCP_CP_Red300_400 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 SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 3 1 2XV9450 1MB11 Manual edition 2 2 Commissioning 3 2 Parameterization of the CP Parameterization of the CP Parameterization of the Communication Partner If you have your stations connected with each other without a router then they have to be within the same subnet 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 For newly created networks this is normally Ethernet 1 Properties Ethernet interface CP 443 1 RO S5 xi General Parameters Set MAC address use ISD protocol MAC address v IP protocol is being used IP address 10 0 0 41 Gateway Do not use router Subnet mask 255 0 0 0 C Use router Address 10 0 0 41 Subnet not networked N
56. efore send e Verification of the MODBUS specific telegram header after receive e Verification if the memory areas exist which are requested by the client e Generate exception telegrams when failures occur Exception Meaning code 1 The requested function code is not supported An access to a not existing or not permitted address was carried out An invalid length was indicated for this function code 2 3 e Data transfer to and from the parameterized DB e Monitoring the data reception with a time out The function block has to be called both in the start up OB100 as well as ina cyclic OB SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 6 4 2XV9450 1MB11 Manual edition 2 2 Online Help Start up of the FB Cyclical Operation of the FB Activation of the Function Block Function Block MB REDSV Modbus Server In SIMATIC Manager an online help for function block MB REDSV is provided Mark the FB and press the key F1 The online help is displayed it contains the main information regarding the FB The function block MB REDSV should be unconditionally called once in OB100 The initialization parameters must be set according to the station configuration They will be copied into the instance DB The runtime parameters will not be evaluated during the start up In cyclical operation the MB REDSV is called e g in OB35 According to the runtime parameters the func
57. er licensing is no longer possible Read the To read the IDENT CODE please proceed as follows IDENT CODE 1 Parameterize the block MB REDCL and MB REDSY respectively in the cyclic OB OB1 or cyclic interrupt OB and in OB100 according to your requirements Transfer the program to the PLC and turn it to RUN mode 2 Open the instance DB of the Modbus block Data block gt Open Online to open the DB Monitoring the block via the button 1 is insufficient F3IDB Param DB909 Datablock Edit PLC Debug View Window Help Open Ctr o Open Online Close Save Ctri S Properties Print Ctrl P Print Preview Page Setup 1MODBUS TCP CP RedundantiH Single sided Server CPU 414 4 H DB907 2 MODBUS TCP CP RedundantiH Double sided Client CPU 414 4 HY ADB909 3MODBUS TCP CP RedundantlH Double sided Server CPU 414 4 HY 1DB907 4 MODBUS TCP CP RedundantH Double sided Client CPU 414 4 Hi DB100 data type 2 B 16 0 B 16 0 db_2 WI 680 SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 4 1 2XV9450 1MB11 Manual edition 2 2 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 0 FTW ARE REGISTRATION FORM This form is stored in the library path Program Files Siemens Step7 S7LIBS Modbus TCP CP Red300 400 during installation and is also available
58. ew 1 Properties Ethernet 4 Etheret 5 xl Delete Cancel Help Save and Compile the parameterization In the mode CP is client an other station is required for network configuration After you have inserted the communication partner s station into your STEP7 project you have to specify the object properties of the external station 1 Properties Other Station gt Interfaces On the tab Interfaces click on New In the upcoming selection select Industrial Ethernet and click on OK Properties Other station x General Interfaces Type New Interface Type Selection OK Cancel Help SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 3 2 2XV9450 1MB 1 1 Manual edition 2 2 Commissioning This opens a dialog box Properties Ethernet Interface Enter an IP Address that is in the same subnet as the communication partner s station The subnet mask should be the same as the one of the partner s station Select the associated subnet that connects the CP interface with the communication partner s interface Properties Ethernet interface xj General Parameters Set MAC address use ISO protocol If a subnet is selected oe the next available addresses are suggested Iv IP protocol is being used IP address 10 0 0 31 Gateway Do not use router Subnet mask 255 0 0 0 C Use router Address fi 0 0 0 31 Subnet
59. f the CP give you information on the module status There are two types of display functions e Group Error Displays INTF Internal failure EXTF External failure e Special Displays CP 443 1 TXD A telegram is being sent via the interface RXD A telegram is being received via the interface A detailed description of the display elements can be found in the device manual of the CP SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 9 1 2XV9450 1MB11 Manual edition 2 2 9 2 Messages at the STATUS Output of the FB Error Messages of the called SFCs and FCs messages to STATUS x without any changes Diagnostics Diagnostic Messages of the FBs MB REDCL and MB REDSV The error messages are displayed at the status outputs of the FBs MB REDCL and MB_REDSV Below you will find a list of FB specific error The Modbus FBs use the standard functions SFC6 SFC20 SFC24 SFC51 SFC52 FC50 and FC60 The error messages of these blocks are passed on In the diagnostics buffer or in the online help of SIMATIC Manager you will find further details on these error messages as well as in the SIMATIC STEP7 NCM S7 Industrial Ethernet Manual Error messages of FBs MB REDCL and MB REDSV STATUS Remedy Hex A002 Anerror was detected when checking start x Please contact the product support A003 A004 A005 A006 SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 2XV9450 1MB 1 1
60. his 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 needed for its execution These variables are non volatile and keep its validity between FB calls The variables control the internal process flow of the FB Required memory of the instance DBs Instance DB work memory load memory MB REDSV ca 4 kByte ca 5 kByte The FB requires 96 Bytes of local variables Additionally the subordinate FBs require local variables FBs MB_CPSRV 30 byte or AG_CNTRL 178 byte That gives a maximum of 304 Bytes of local data fora FB MB_REDSVL call The function block does not use any timer The function block does not use any flags The function block uses the blocks AG_LSEND and AG_LRECV from the SIMATIC_NET library for the data transfer between CPU and CP The following versions of the FCs are tested with the FB and released for the communication e FC50 AG LSEND Version 3 1 e FC60 AG LREOV Version 3 1 e AG CNTRL CP 400 Version 1 0 The FB MB REDSV uses the following SFCs from the standard library Functions e SFBA TON e SFC6 RD_SINFO e SFC20 BLKMOV e SFC24 TEST_DB e SFC51 RDSYST e SFC52 WR USMSG The block MB CPSRV uses the following system functions e SFB4 TON e SFC20 BLKMOV e SFC24 TEST_DB SIMATIC Modbus TCP Redundant Communication via CP44
61. ient This information Regarding the can be readout in the application program if required The following values Request of the are buffered in the IDB for each connection and are valid when NDR Client TRUE Address in I DB Variable Description for Connection 0A DBX 120 0 CONNECTION 1 TRUE Write to S7 WRITE READ FALSE Read from S7 DBB 121 CONNECTION 1 Unit number UNIT DBB 122 CONNECTION 1 Accessed data type DATA TYPE 1 Coils 2 Inputs 3 Holding register 4 Input register DBW 124 CONNECTION 1 First address accessed START ADDRES S DBW 126 CONNECTION 1 Number of executed registers LENGTH bits DBW 128 CONNECTION 1 Transaction Identifier TI Sequence number DBD 130 CONNECTION 1 Counter of correct executed Cnt NDR requests DBD 134 CONNECTION 1 Counter of recognized errors Cnt ERROR Two counters for NDR and ERROR are available for each connection as well The information block for connection 1A CONNECTION 2 starts at DBX 154 0 of the IDB The information block for connection OB CONNECTION S starts at DBX 188 0 of the IDB The information block for connection 1B CONNECTION 4 starts at DBX 222 0 of the IDB SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 6 6 2XV9450 1MB 1 1 Manual edition 2 2 Data Transfer CPU CP TCP IP with CP443 1 Termination of the TCP connection by the Communi cation Partner OB121 Programming Error Function Block MB REDSV Mo
62. ient has to meet the requirement of active connection establishment After selecting Insert New Connection the dialog box Insert new connection will come up ii NetPro MODBUS TCP CP Redundant Network EProgram ap Network Edit Insert PLC View Options Window Help LN E E EE Ethernet 2 ndustrial Ethernet Partner ID Insert New Connection Ctrl N Download selected connections Show Hide Columns Optimize Column Width Display Columns Select here unspecified instead of the communication partner and use TCP Connection for the connection Put a check mark on Show properties dialog Insert New Connection E X r Connection Partner amp In the current project Bp MODBUS TCP CP Redundant H Double sided Client H Double sided Server H Single sided Client y Other station Serverl B Other station Server2 All broadcast stations All multicast stations amp In unknown project Broject a Station Unspecified Module r Connection Type TCP connection Iv Display properties before inserting Apply Cancel Help SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 3 7 2XV9450 1MB 1 1 Manual edition 2 2 Commissioning Click OK This will take you back to the dialog box Properties TCP connection The check box active co
63. ion 2 2 Function Block MB REDCL Moabus Client Case c Not any respond was received Connection 0A Connection 1A I O at modbus block Connection E Request ENQ TRUE q interrupted Response MONITOR DONE FALSE ERROR TRUE STATUS_0A 8304 STATUS 1A 8304 ENQ TRUE DONE FALSE ERROR TRUE STATUS 0A AOFF STATUS 1A AOFF Connection 1A is recovered Check of J connections DONE FALSE ERROR FALSE STATUS 04A 8304 STATUS 1A 0 Connection 1A ENQ TRUE Request sused S E Z O Response DONE TRUE ERROR FALSE STATUS_0A 0 STATUS_1A 0 SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 5 9 2XV9450 1MB11 Manual edition 2 2 Data Transfer CPU CP TCP IP with CP443 1 Termination of the TCP connection by the Communi cation Partner OB121 Programming Error Function Block MB REDCL Modbus Client The data transfer between CP and CPU are done with the standard function blocks AG_LSEND and AG_LRECV At the activation of a MODBUS request by the user the standard blocks necessary for the CP are called by the FB in the right order and number TCP IP with CP443 1 uses statistic connections The TCP connection cannot be disconnected while in run mode Given this system characteristic telegrams might be lost under unfavorable conditions when the synchronization had been lost after an error When lost synchronization i
64. ion of NetPro the FB MB REDCL can be called once SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 5 4 2XV9450 1MB11 Manual edition 2 2 Online Help Start up of the FB Cyclical Operation of the FB OB121 Programming Error Initiate Request CP is Client Function Block MB REDCL Modbus Client In SIMATIC Manager an online help for function block MB_REDCL is provided Mark the FB and press the key F1 The online help is displayed it contains the main information regarding the FB The function block MB_REDCL should be unconditionally called once in OB100 The initialization parameters must be set according to the station configuration They will be copied into the instance DB The runtime parameters will not be evaluated during the start up In cyclical operation the MB REDCL is called e g in OB35 According to the runtime parameters the functions of the function block are activated While a request is running changes to the runtime parameters are ignored During cyclical operation changes to the initialization parameters are ignored If the block has not been licensed yet the OB121 is called Warning The CPU will turn to STOP mode if the OB121 is not available A rising edge at the trigger input ENQ initiates a request via the active connection Depending on the inputs parameters UNIT DATA TYPE START ADDRESS LENGTH and WRITE READ a MODBUS request is generated and sent to the
65. ion of the Redundant Communication General Information Configuration in HW Contig Configuration in NetPro The CP is server if the remote partner takes the initiative to read data from or to write data to the S7 The communication partner of the H system can be mounted stand alone or redundant too single sided or double sided redundancy Single sided redundancy Double sided redundancy H Double sided Server CPU VDP MPWoP cP CPU DP MPUDP CP z e t uafu n ut H Hat HER a mH m Hg iN H Single sided Server Switch Switch A A B Bi Other station Client Bi Other station Client2 H S HH While configuring the hardware in HW Config both CPO and CP1 get different input and IP addresses so that they can be addressed unique in the S7 program respectively from the communication partner You have to define one connection in NetPro for each possible connection between the communication partners With single sided redundancy there is one connection for CPUO CPO and one for CPU1 CP1 e Connection from CPUO CPO to Partner gt Connection 0A e Connection from CPU1 CP1 to Partner gt Connection 1A With double sided redundancy there are two connections for CPUO CPO and two for CPU1 CP1 e Connection from CPUO CPO to Partner Node A gt Connection 0A e Connection from CPU1 CP1 to Partner Node A gt Connection 1A e Connection from CPUO CPO to Partner Node B gt Connection 0B e C
66. ition 2 2 Function Block MB REDCL Moabus Client 5 4 Parameters of the Function Block MB REDCL Parameter _ Deci Type WORD Connection ID for CPU CPO according to 1 to 64 IN IN IN IN IN the configuration in NetPro W 16 1 to W3H 64H40 WORD Connection ID for CPU CP1 according to 1 to 64 the configuration in NetPro W 16 1 to W1H 6440 WORD Connection ID for CPU CPO according to 1 to 64 the configuration in NetPro W 16 1 to Only required with double sided pone nee redundancy WORD Connection ID for CPU CP1 according to 1 to 64 the configuration in NetPro W 16 1 to Only required with double sided W 16 40 redundancy yes yes yes yes laddr cpO WORD Input address of the CPO from HW Config CPU yes dependent laddr_cp1 WORD _ Input address of the CP1 from HW Config CPU yes dependent yes yes no yes yes yes check_conn_c IN TIME Cycle time for connection testing by the T 1s to yes ycle means of AG_CNTRL T 24d20h31 m23s No connection testing 0 Telegrams are sent via one connection FALSE Telegrams are sent via all configured TRUE connections single_write IN BOOL Write 1 Coil Register Function code 5 and 6 are used TRUE respectively Function code 15 and 16 are used FALSE respectively BOOL Manual initialization with positive edge TRUE FALSE mo data type 1 IN BYTE 1st data area data type Coils 1 Inputs 2 Holding Register 3 Input Register 4 db 1 IN WORD 1st data area data block num
67. ization Use This error code is also reported when the ID of NetPro and work with MB REDCL MB REDSV is called with different only 1 instance DB instance DBs in cyclical OB and OB100 9 4 Diagnostic Messages of SFC24 Error messages of SFC24 STATUS Remedy Hex 80A1 DB Number 0 or too large for the CPU Choose a valid DB number 80B1 The DB does not exist in the CPU All data blocks that are specified in DB x must be created and copied into the CPU 80B2 DB UNLINKED DB must not be created as UNLINKED SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 9 6 2XV9450 1MB 1 1 Manual edition 2 2 Diagnostics 9 5 Diagnostics with Alarm Bits The Modbus block provides the possibility to detect lost redundancy This information is displayed in the output parameters RedErrS7 RedErrDev and TotComErr It is possible to connect these status bits to an alarm block or to another block for further evaluation 9 5 1 Client Block Depending on the parameterizations the alarm bits are set as follows 1 use all conn FALSE check conn cycle 0ms The telegrams are transferred via 1 connection The other projected connections are on standby There is no cyclical check of the connections With these parameter settings a check of the connections and the updating of the alarm bits are only executed if a telegram is transferred via this connection Disturbed or re established connections on standby can t be recognized
68. judice for its complete conformity The information in this document is checked regularly and necessary corrections are contained in subsequent issues Any suggestions for improvement are gratefully received We reserve the right to make technical changes Preface Preface Purpose of the The information in this manual allows you to set up and put in operation the Manual connection between the CP 443 1 in an S7 redundant system and a device that supports the Open MODBUS TCP protocol Contents of the This manual describes the function of the Modbus function block and their Manual integration into the hardware and software of the communication processors CP 443 1 The manual contains the following topics e Production description e Getting Started e Commissioning Installation Parameterization e Licensing e Function blocks e Diagnostics e Application sample Scope of this This manual is valid for the following software Manual Identification number From version MODBUS TCP Redundant 2XV9 450 1MB1 1 2 1 1 FB 909 MB REDCL o 24 FB 908 MB CPCLI ff FB 907 MB REDSV o 28 FB 906 MB CPSRV B 2 2 Note This manual contains the FB description as it is valid at the time of publication How to Access the To enable you a quick access to selected information the manual provides Information in this the following access aids Manual e The next pages contain a complete table of contents SIMATIC Modbus TCP Redundant Communication via CP443 1
69. lified person is one who is authorized to commission ground and tag devices systems and circuits Use as prescribed Please note the following Warning This equipment must only be used in applications as prescribed in the catalogue and the technical description and in conjunction with equipment and components recommended and authorized by Siemens Successful and safe operation of this equipment is dependent upon proper transport and storage erection and installation as well as careful operation and maintenance SIMATIC and SIMATIC NET are registered trademarks of SIEMENS AG Trademarks The other brand names in this manual may be trademarks use of which by third parties for their purposes may infringe the proprietors rights Copyright Siemens AG 2008 20012 All Rights Reserved The reproduction transmission or use of this document or its contents is not permitted without express written authority Offenders will be liable for damages All rights including rights created by patent grant or registration of a utility model or design are reserved Siemens AG Industry Sector Industry Automation Division Industrial Automation Systems Factory Automation I IA AS FA WF FTH 1 Postfach 23 55 D 90713 F rth Exclusion from Liability We have checked the contents of this document with regard to conformity to the described hardware and software Deviations however cannot be excluded therefore we cannot accept pre
70. mponent view C Program Fes SIEPENSISTESRMENE TCP C loj xi E Ep MB TCP CP RED 400 Version El H Double sided Client System data pa iud SDB ue B CPU 4174 H OP1 CYCL_EXC STL 714 Organization Block 01 S E S7 Programit la 0872 RED FLT STL 38 Organization Block 011 QE 08100 COMPLETE RESTART STL 364 Organization Block 0 1 CP 4434 i 08121 PROG ERR STL 38 Organization Block 0 1 x CP 443 1 1 amp FB308 MB CPCLI SCL 9828 Function Block 23 8 H Double sided Server amp FB303 MB REDCL SCL 14594 Function Block 24 8l H Single sided Client FFCI0 AG CNTRL STL 1610 Function 1 0 E H Single sided Server g FCS0 AG_LSEND STL 846 Function 31 g FC60 AG LRECV STL 382 Function 34 DBI CONTROL_DAT DB 102 Data Block 0 1 i DB3 LICENSE_DB DB 56 Data Block 0 1 D811 Holding Register Area 1 DB 1036 Data Block 0 1 D812 Holding Register Area 2 DB 398 Data Block 0 1 icRDB13 Coils Area 1 DB 114 Data Block 0 1 ick D8909 IDB Modbus Client DB 2084 Instance data block 0 0 v Client job Client job Variable Table 0 1 g SFB4 TON STL System function block 1 0 gt i Used Blocks This block numbers are also used in the provided example project for S7 stations with FB MB_REDCL Block Symbol Comment OB1 CYCL EXC Cyclic program processing OB 100 COMPLETE Start Up OB for Re Start RESTART OB 121 PROG ERR Programming error OB FB 909 MB REDCL FB MB REDCL FB 908 MB CPCLI Internal called FB MB CPCLI CONTROL DAT Work DB CONTROL DA
71. n partner over the active connection The minimum time that can be set is 20ms A monitoring time of 1 5 seconds is recommended MONITOR specifies the timeout for the receipt of the complete response telegram from the server When the monitoring time elapses the active request is cancelled with an error The time is started after sending of the request telegram is finished and is stopped after the receipt of the complete data The Modbus block must be licensed for each CPU individually to permit a correct program sequence With the registration key REG KEY the Modbus block is licensed and the Modbus communication runs without any restraint You can find further information in section Licensing The FB is activated with a TRUE signal at this input Telegrams from the client can be received With a FALSE signal at this input data is received from the CP and discarded The FB listens to all configured connections Requests via all connections are executed and replied to The parameter INIT TRUE enables a manual initialization The initialization can be executed if currently no order is running The client must not send a request during initialisation If manual initialization it is important that the initialization parameters are parameterized in the cyclical OB During a manual initialization the parameterized connections are terminated and reestablished again If this output is TRUE then the Modbus block is licensed on this CPU
72. nction Block MB REDCL Moabus Client MONITOR The monitoring time observes the entry of the data input from the communication partner over the active connection The minimum time that can be set is 20ms A monitoring time of 1 5 seconds is recommended MONITOR specifies the timeout for the receipt of the complete response telegram from the server When the monitoring time elapses the active request is cancelled with an error The time is started after sending of the request telegram is finished and is stopped after the receipt of the complete data REG KEY The Modbus block must be licensed for each CPU individually to permit a correct program sequence With the registration key REG KEY the Modbus block is licensed and the Modbus communication runs without any restraint You can find further information in section Licensing ENQ The data transfer is initiated with a TRUE signal at the input The request telegram is generated with the values of input parameters UNIT WRITE READ DATA TYPE START ADDRESS and LENGTH A new request can only be sent when the previous one is finished with DONE or ERROR 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 The different data types are related directly to the used function codes TYPE write code memes 3 ww 1 true
73. nnection establishment must not be activated Properties TCP connection TCP Verbindung 57 E F Use ETP protocol In the register addresses all information regarding the partner IP and PORT are left blank Properties TCP connection B ru Click on OK and the inputs are accepted SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 3 8 2XV9450 1MB 1 1 Manual edition 2 2 Commissioning 3 4 Insertion of the Function Blocks into the Program Content of MODBUS library The Modbus library contains the folders S7 300 Client S7 300 Server 9 400 Client and S7 400 Server with the FBs for the redundant communication S7 400 Client The folder S7 400 Client contains the blocks e FB909 MB REDCL and e FB908 MB CPCLI amongst others gt Modbus_TCP_CP_Red300_400 Component view C Program Files SIEMENS STEP sane m XI Modbus TCP CP Red300 400 Version H E S 300 Client amp FBS08 MB_CPCLI SCL Function Block 2 3 i i ies e g FB909 MB REDCL SCL Function Block 24 leni a 13 DB3 LICENSE_DB DB DataBlock 01 E 5 400 Server Both blocks are required for redundant communication The function block MB REDCL executes a multiple call of MB CPCLI S7 400 Server The folder S7 400 Server contains the blocks e FB907 MB REDSV
74. nnection in certain error situations This action is carried out by the FB MB REDSV Thereby all existing connections via port 502 are terminated When several connections are established via port 502 it is not possible to identify the client which has sent the recent request If the clients use different UNIT numbers the verification of the same in the user program allows a determination SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 3 11 2XV9450 1MB1 1 Manual edition 2 2 Commissioning 3 6 Start up Characteristics of CP443 Introduction The start up of the CP is divided into the following phases e Initialization Power on of the CP e 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 Parameterization During parameterization the CP receives the device parameters that are assigned to its slot The CP is now ready for operation SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 3 12 2XV9450 1MB11 Manual edition 2 2 Licensing 4 Licensing General The blocks MB REDCL and MB REDSV 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 Please note With a S7 H station only the CPU in rack 0 is licensed Hence the replacement of the CPU in rack 0 aft
75. ns e S7 H Station is client or server e Single sided or double sided redundancy m Single sided Client m Other station Server1 H Single sided Server CPU DP MPVDP CP CPU DP MPVOP CP CPU DP MPVDP CP CPU DP MPVOP CP Egi ei axo d im E Egg er wert d Hose i ot LIES per a oo m T oo E moo E Bao m 20 20 20 21 20 20 20 21 H Double sided Client H Double sided Server IBI Other station Server2 S CPU DP MPU DP CP CPU DP MPDP CP In S CPU DP MPOP CP CPU DP MPDP CP nou usafi 1 ux my ee uafu i xt H 1 j i mu ME 1 o H og m 20 20 20 21 20 20 20 21 The example project consists of the following Simatic stations Double sided H Double sided Client H Double sided Server H Single sided Client H Single sided Server SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 10 1 2XV9450 1MB1 1 Manual edition 2 2 Application Sample Programming The programming example consists of the blocks Example e Start Up OB100 with call of FB909 and FB907 respectively e OB121 programming error e Cyclic program processing OB1 with call of FB909 and FB907 respectively e Global DBs for job trigger e g with variable table and for licensing e Data blocks for register values and bit values 10 1 Example project in AWL Modbus Client Overview EMB TCP CP RED 400 Co
76. oading the PLC Open the data block in the SIMATIC manager with the editor in the declaration view Change over to the data view via the menu View gt Data View Choose in the menu Edit gt Initialize Data Block all values of the column initial value are copied to actual values Assign the value DB3 REG KEY to the parameter REG KEY of the Modbus block Transfer the changed blocks to the PLC The registration key can be set at run time A STOP gt RUN transition is not necessary The block is now licensed for this CPU SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 4 3 2XV9450 1MB11 Manual edition 2 2 Licensing Missing or Wrong When the registration key is missing or a wrong one is detected the INTF Licensing LED of the CPU is flashing once per minute A cyclic error message regarding the missing license is displayed in the diagnostic buffer too The error number of the missing license is W 16 A090 ii gt iix Path MODBUS TCP CP RedundantH Single si Operating mode of the CPU lt RUN Status OK Not a force job Performance ication Stacks H State Identification General Memory Scan Cycle Time Time System Events F Eilter settings active Time including CPU local time difference Time of day 12 30 46 098 PM 08 2 12 30 46 098 PM 08 03 72 2010 EventID 16 4090 2 010 Area length error when reading 3 12 29 46 097 PM 08 03 2010
77. on the installation CD Insert the License No of the product package into the form s inl xl EZ Datablock Edit PLC Debug Yiew Window Help lel xl r Hgo o 55 lt gt kal a Decl iti Actual value FALSE B 16 0 1620 Wieso FALSE B 16 0 LICENSED FALSE BUSY FALSE DONE FALSE FALSE Vit bx AOSO STATUS 14 Vi 644090 STATUS 0B J VW BRFFFF STATUS 1B WIHBRFFFF par cote smo 8 SEND BUFFER 1 BYTE B 16 0 SEND BUFFER 2 Bx B 16 0 Press F1 for help o M 7 Please insert the IDENT CODE here The manual contains information how to find oufthe IDENT CODE Bitte tragen Sie den IDENT CODE hier ei Das Handbuch enth lt Informationen wie Sie den IDENT CODE ermitteln gt gt gt IDENT_CODE lt lt MW 7 0penModbus TC ype of Software f Softwaretyp Runtime Software Type ol License Lizenztyp Single Lice nje Type of Use Art der Ni ung CPU Please insert the License No here E You find the License No on the package of the pe JEMENS ORIGINAL INDUSTRIAL SO No Anzahl 1 Software Class Software dasse A Reference hardware Zielharcvare SIMATIC FN CPU pC Bitte tragen Sie die Lizenz Nr hier ein Sie finden die Lizenz Nr auf der Verpackung de Systemi Cond tions Systemanforcewng Wipugws K gt gt gt License No Lizenz Nr lt lt lt
78. onnection from CPU1 CP1 to Partner Node B gt Connection 1B SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 6 1 2XV9450 1MB 1 1 Manual edition 2 2 Function Block MB REDSV Modbus Server The figures in the following example illustrate the denotation of the connections Please note when configuring network connections that the end points of the connection S7 CPO und CP1 partner node A and node B must have at least one distinctive feature for addressing either the IP address or the port number In HW Config CPO und CP 1 get always different IP addresses Therefore in the network configuration each CP can use the same port number If the communication partner has got only one IP address then each connection has to use a different port number Usually the Modbus server is addressed via the port number 502 the Modbus client uses a port number different from 502 A wrong port number identical port numbers will be recognized by NetPro while entering the value and or closing the configuration window SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 6 2 2XV9450 1MB 1 1 Manual edition 2 2 Function Block MB REDSV Moabus Server Example The following figure illustrates a configuration example in NetPro for single Single Sided sided redundancy Redundancy 7 is server MPUDP CP4CX I CPU DP MPUDP CP4U 1 1 1 10 0 0 60 partner is client The S7 station has got the
79. pe to be accessed Coils 1 Inputs 2 Holding registers 3 Input registers 4 WORD MODBUS start address 0 to 65535 o W3H 640000 to W 16 FFFF LENGTH WORD _ Number of values to be processed Coils reading function 1 to 2000 writing function 1 to 1968 Inputs reading function 1 to 2000 Holding Register reading function 1 to 125 writing function 1 to 123 Input Register reading function 1to 125 SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 5 12 2XV9450 1MB11 Manual edition 2 2 START ADDRESS Function Block MB REDCL Moabus Client Write access Read access LICENSED OUT BOOL License state of the function block Block is licensed Block is not licensed BUSY OUT BOOL Operating state of the functions AG LSEND and AG LRECV Job processing No job processing active DONE OUT BOOL TRUE Active request finished without TRUE no errors via one connection at least FALSE ERROR OUT BOOL TRUE Errors have occurred at all TRUE no configured connections FALSE STATUS 0A WORD Status for connection 0A 0 to FFFF STATUS 1A WORD Status for connection 1A 0 to FFFF 0 to 255 B 16 0 to BHI 6 FF STATUS 0B OUT WORD Status for connection 0B STATUS 1B OUT WORD Status for connection 1B 0 to FFFF IDENT OUT STRING Identification for licensing CODE 18 Please order your license with this identification string RedErrS7 OUT BOOL TRUE S7 lost redundancy TRUE no FALSE RedErrDev OUT BOOL TR
80. put Register IN SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 2XV9450 1MB 1 1 Manual edition 2 2 1 to 65535 W 16 1 to W 16 FFFF 0 to 65535 W 16 0000 to W 16 FFFF 1 to 65535 W 16 1 to W 16 FFFF 0 to 65535 W 16 0000 to W 1 6 F FFF yes yes yes yes yes yes es 6 8 Function Block MB REDSV Modbus Server 3rd data area data block number 1 to 65535 yes W 16 1 to W 16 FFFF 3rd data area first Modbus address in this 0 to 65535 DB W 16 0000 to W 16 FFFF 4th data area data type Coils Inputs Holding Register Input Register data_type_4 NULL if not used 4th data area data block number 1 to 65535 W 16 1 to W 16 FFFF start_4 Ath data area first Modbus address in this 0 to 65535 DB W 16 0000 to W 16 FFFF MONITOR TIME Monitoring Time Wait for data from T 20ms to communication partner T 24d20h31 m23s647ms REG_KEY ar STRING Registration key to activate the license Character 17 BOOL Ready for receive at true signal TRUE FALSE Int M m BOOL Manual initialization with positive edge TRUE FALSE LICENSED BOOL License state of the function block Block is licensed TRUE Block is not licensed FALSE BUSY OUT BOOL Operating state of the functions AG_LSEND and AG_LRECV Job processing TRUE No job processing active FALSE NDR 0A OUT BOOL TRUE The request of the client via TRUE connection OA was executed and FALSE responded to ERROR 0A OUT BOOL TRUE An error has
81. re requisits Number of released Connections Displaying the Status of the Connection Characteristics of the Error Handling Tip for your User Program Some CP modules are able to multiplex TCP connections In doing so several 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 To use the functionality the parameterization must be carried out as follows e CP is server e port 502 as local port e unspecified TCP connection in NETPRO e passive connection establishment Please note that only 1 connection is parameterized in NETPRO irrespective of the number of clients which address the CP as server The CP is capable to keep up to 4 connections to different clients The status of the connection is displayed even in NETPRO online as well as in special diagnosis of the CP As only 1 connection is parameterized in NETPRO the display shows the status of all TCP connections to the several clients As long as no client has established a connection Passive connection establishment in progress is displayed As soon as one client has established a connection established is displayed It is not possible to check how many clients have actually established a connection to the CP The FB MB REDSY and the CP respectively must terminate and reestablish the co
82. rogramming error OB FB 907 MB REDSV FB MB REDSV mx PBseneaehyCFO SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 10 5 2XV9450 1MB 1 1 Manual edition 2 2 A Literature The MODBUS MODBUS APPLICATION PROTOCOL SPECIFICATION Organization V1 1b December 28 2006 http www modbus org SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 2XV9450 1MB11 Manual edition 2 2 Customer Support Siemens AG Industry Sector Industry Automation Division Industrial Automation Systems Factory Automation I IA AS FA Phone 49 0 911 895 7 222 Customer Support http www siemens com s7modbus Siemens Aktiengesellschaft Subject to change without notice SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 2XV9450 1MB11 Manual edition 2 2 release 08 2014
83. rt The output IDB is Sample connected to the DB input db 1 db 2 db 3 or db 4 of the Modbus block Then the Modbus values can be connected directly from the channel blocks to the data collector FB OBITS 0 BIT 4 Q 0 BIT 6 BO E 0 BIT 410 0 BIT 13 0 BIT 45 0 BIT 47 B0 BIT 13 You can find the additional blocks and a detailed description here www siemens com s7modbus or contact the Customer Support SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 7 1 2XV9450 1MB11 Manual edition 2 2 7 2 Job List for cyclical telegram transfer Additional Blocks General By means of the block Job_List it is possible to generate a list of jobs which are executed cyclically Application Sample os Dr ESI dis 6 Job_List Job List w id Gb ROR BO STRTUS GR STRTUS 41R SIRIUS OB X ETT y data type y data_type By EET I MONITOR II CYCLICAL B0 DONE Y DATATYPE BO ERROR QSTART_AD W START_ADD QWRITE_RE BO W Jobi LENG BY Job2_DATA W Job2 STRR BY JobS_DATA BO RESET E JE Je m m m m fe ler o lor 1 ic o fe fe z E a a a a Iz i jo a lh a fa a fx x E m a o i n n n le fo fo n B je BUSY BO BY UNIT BO Jobi WRIT STATUS W STRTUS 1B You can find the additional block and a detailed description here www
84. s recognized the connection is terminated and reestablished by means of AG_CNTRL If the communication partner terminates the TCP connection the next send can be started not until an idle time of 150 milliseconds has elapsed This delay due to system characteristics is executed by the function block If the block has not been licensed yet the OB121 is called Warning The CPU will turn to STOP mode if the OB121 is not available 5 3 Connection Testing by means of AG_CNTRL Connection Testing The block MB_REDCL recognizes a faulty connection if during the transmission of telegrams the communication functions AG_LSEND AG_LRECV report an error To detect and solve actual connection problems immediately you can activate a feature to check the configured connections cyclically by the means of AG_CNTRL The parameter check_conn_cycle defines the interval of the testing The result of the connection testing is displayed at the output STATUS x As long as an error of the connection is detected the FB Modbus doesn t attempt to transfer telegrams via this connection When the connection testing recognizes that a faulty connection was reestablished all further telegrams are transmitted via this connection too When a response was received via all configured connections the timer of check conn cycle is restarted SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 5 10 2XV9450 1MB 1 1 Manual ed
85. s server with double sided redundancy 4 connections for the server call and 4 connections for the client call are required in NetPro There is no limitation of the maximum number of parallel called Modbus blocks on the part of the library Though it depends on the CPU how many AG functions can run simultaneously The maximum number of AG calls can be taken from the manual of the CPU Technical Data Communication In the manual of the CP it s detailed how many connections can be processed by this CP simultaneously Performed The function block MB REDCL performs the following functions Functions e Coordination via which connection s the telegrams are sent e Monitoring of all parameterized connections with AG_CNTRL e Control the Transaction identifier TI The function block MB REDCL executes a multiple call of MB CPCLI and coordinates these calls for the different connections The function block MB CPCLI performs the following functions e Calls the standard functions for the data transfer between the CPU and the CP e Generates MODBUS specific telegram header before send e Verification of the MODBUS specific telegram header after receive e Verification if the memory areas exist which are requested by the client e Data transfer to and from the parameterized DB e Monitoring the data reception with a time out Call of the FB The function block has to be called both in the start up OB100 as well as ina cyclic OB For each connect
86. s 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 The size of the data blocks must be 2 byte larger than it is necessary for the Modbus values The last word is used for internal purposes and it is not allowed to change it SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 6 11 2XV9450 1MB 1 1 Manual edition 2 2 start x MONITOR REG KEY ENR Init LICENSED Function Block MB REDSV Modbus Server Start x specifies the first register or bit address which is stored in the data element 0 of the DB The maximum number of Modbus addresses which can be stored in the DB is defined by its length The DB length is calculated during start up of the CPU When accessing registers the last register address which is mapped in the S7 DB can be calculated with the following formula Last register address in DB DB length in byte 2 2 start x 1 When accessing coils or inputs the last register address which is mapped in the S7 DB can be calculated with the following formula Last coil address in DB DB length in byte 2 8 start x 1 Please note The defined data areas must not overlap In section 6 5 you can find an example of the mapping of the MODBUS addresses to S7 memory areas The monitoring time observes the entry of the data input from the communicatio
87. signed The connection ID is the distinct description of the connection from the CPU via the CP to the communication partner The number of the configured connection has to be entered here The value range for this parameter depends on the CPU id 0a represents the connection from the CPO to node A id 1a represents the connection from the CP1 to node A id O b represents the connection from the CPO to node B id 1 b represents the connection from the CP1 to node B The connection OA is the default connection its configuration is mandatory If the communication partner is built up standalone then the parameters id 0 aandid 1 aare used The parameters laddr cpO and laddr cp1 represent the input address of the CPO and the CP1 from HW Config I Address The configured value has to be entered here The range of values for these parameters depends on the CPU This parameter defines the time interval for connection testing by the means of AG CNTRL The time can be parameterized in 1 second steps the default value is 30 seconds The results of the connection testing are displayed at the outputs STATUS x data type x The parameter data type x defines the MODBUS data type which is to be mapped with this definition If data type x set to 0 this data area is not used CITUR Data type Size 0 Area not used 1 Coils Bit 2 Inputs Bit 3 Holding Register Word 4 Input Register Word db x The parameter db x define
88. t address or the Verify the data of the number of registers bits in the response telegram is communication partner with the not equal to the one in the request telegram help of a telegram trace AOOE _ 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 AO0C The received byte count does not match the number Verify the data of the of registers bits communication partner with the the byte count in the telegram The FB receives all help of a telegram trace data and ignores them The connection is terminated and reestablished help of a telegram trace A010 In the parameterized area db 1 to db 4 a DB number Correct the parameterization is used twice A011 An invalid value for DATA TYPE is given Value Correct the parameters range 1 to 4 A012 The parameterized areas data type 1 and Correct the parameterization The data type 2 overlap data areas must not contain any AOO0F A protocol identifier lt gt 0 was received Verify the data of the The connection is terminated and reestablished communication partner with the overlapping register areas A013 The parameterized areas data type 1 and data type 3 overlap A014 The parameterized areas data type 1 and data type 4 overlap SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 9 3 2XV9450 1MB 1 1 Manual edition 2 2 Diagnostics
89. tions of the function block are activated During cyclical operation changes to the initialization parameters are ignored The connection of the standby CPU may report error 80B2 once after restart of the H system This happens due to system characteristics of the H system With a true signal at the input ENR the FB is ready to receive a request telegram from the client The server remains passive With ENR TRUE all configured connections are active and the CP listens to them No switch over from one connection to the redundant one takes place The client can send the request via one or via all connections alternatively The received telegrams are verified If a telegram is verified positive the response telegram is generated and sent The completed transmission is reported to the user by setting the output NDR x A faulty request telegram causes an error message and the output ERROR x of the associated connection is set The error number is returned in STATUS x Depending on the kind of error the request of the client is either answered with an exception telegram or no response is sent SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 6 5 2XV9450 1MB 1 1 Manual edition 2 2 Function Block MB REDSV Modbus Server Instance DB The basic data of the executed Modbus order is stored in an information Information block in the IDB of the server with each request of the cl
90. to run an H station as Modbus client and Modbus server simultaneously Therefore the adequate blocks for client and server communication must be called and the necessary connections in NetPro must be parameterized For each group of redundant connections consisting of 2 connections for single sided redundancy or 4 connections for double sided redundancy the Modbus block must be called once That means when the H station acts as client and as server with single sided redundancy 2 connections for the server call and 2 connections for the client call are required in NetPro When the H station acts as client and as server with double sided redundancy 4 connections for the server call and 4 connections for the client call are required in NetPro There is no limitation of the maximum number of parallel called Modbus blocks on the part of the library Though it depends on the CPU how many AG functions can run simultaneously The maximum number of AG calls can be taken from the manual of the CPU Technical Data Communication In the manual of the CP it s detailed how many connections can be processed by this CP simultaneously The function block MB REDSV executes a multiple call of MB CPSRV and coordinates these calls for the different connections The function block MB CPSRV performs the following functions e Calls the standard functions for the data transfer between the CPU and the CP e Generates MODBUS specific telegram header b
91. ules regarding the block numbers when rewiring blocks in the SIMATIC Manager of STEP7 If you want to rewire the blocks of the Modbus library the following sequence is required 1 FC50 AG LSEND FC60 AG LRECV 2 FB908 MB CPCLI FB906 MB CPSRV 3 FB909 MB REDCL FB907 MB REDSV It is not necessary to rewire all blocks Even if you want to rewire only some of the blocks you must follow the mentioned sequence Renaming To rewire proceed as described subsequently 5 Getthe information about the used operand by clicking Extras Reference data Display 6 Set the operand priority in the object properties of the block folder to Absolute value 7 Call the function Extras Re wire in the SIMATIC Manager in order to re wire the operands into free areas 8 To be able to keep on using the symbolism diagnostics tools add the modifications in the symbolism table supplementary The modifications can be verified by clicking Extras Reference data Display SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 6 18 2XV9450 1MB 1 1 Manual edition 2 2 Additional Blocks 7 Additional Blocks 7 1 Add On for CFC General The add on offers the possibility to configure Modbus registers bits in data collector FBs instead of global DBs The send buffer and receive buffer for the values can be placed in the CFC chart per Drag amp Drop Application The data collector FBs are located in the CFC cha
92. uring verification the request is terminated with an error the ERROR bit is set and an error number is returned in STATUS x In this case the request telegram will not be sent again via the next configured connection The switch over to the next configured connection only takes place if a connection break down occurs or no answer was received gt Connection 0A Connection 1A T O at modbus block ENQ TRUE Request MONITOR Response DONE TRUE ERROR FALSE STATUS 0A 0 STATUS 1A 0 Connection interrupted ENQ TRUE Request Request Response c o E Z z 4 o 2 6 DONE TRUE ERROR FALSE E mum STATUS 90A 8304 onnection STATUS_1A 0 is recovered Check of connections DONE FALSE ERROR FALSE STATUS_0A 0 STATUS_1A 0 Connection 1 A is still used ENQ TRUE Request Response MONITOR DONE TRUE ERROR FALSE STATUS_0A 0 STATUS_1A 0 SIMATIC Modbus TCP Redundant Communication via CP443 1 in H Systems 5 6 2XV9450 1MB11 Manual edition 2 2 Function Block MB REDCL Moabus Client Sending Telegrams via all The Modbus telegram is sent via all parameterized connection when Connections use all conn TRUE When the client receives a respond a validity check is carried out If the result is positive necessary actions will be taken The outputs DONE ERROR and STATUS are set not until the reception of responds via all parameterized connections While
93. wn to the application programmer as found in register 40001 memory type 4xxxx reference 0001 One potential source of confusion is the varying interpretation of the register address in different manuals Sometimes the register address means the address of the application layer sometimes the address transferred The FB MB REDCL uses the Modbus address transferred at its parameters start x und START ADDRESS So it is possible to use register addresses from 0000p to FFFFy with each function code data type 1 B 16 3 Holding Register db 1 W 16 B DB 11 start_1 W 16 1 start address 0 data_type_2 BHI 6 3 Holding Register db 2 W 16 C DB 12 start 2 W 16 2D0 start address 720 data_type_3 B 16 0 not used db 3 0 0 start 3 0 0 data_type_4 BH16 1 Coils db 4 W 16 D DB 13 start 4 W 16 2D0 start address 640 For this example applies e DB11 consists of 1002 byte 500 registers are mapped register 0 register 499 2 reserved byte e DB12 consists of 364 byte 181 register are mapped register 720 register 900 2 reserved byte e DB13 consists of 79 byte 611 bits are mapped Coil 640 Coil 1250 2 reserved byte The following diagram shows the comparison of the SIMATIC memory area and the Modbus typical register oriented storage arrangement The diagram is based on the above parameterization Box Modbus device The Modbus addresses printed in black refer to the Data Link Layer the ones
Download Pdf Manuals
Related Search
Related Contents
Solar measurement / Pyranometer App 「取扱説明書」 DASシリーズ (20070701-V045) Adventurer Traveler-Spanish Samsung Q1657AT Instrukcja obsługi Release Notes FortiClient Connect for Mac v4.0 SAP Printing Application Note Copyright © All rights reserved.
Failed to retrieve file