Professional Documents
Culture Documents
______________
______________
______________
______________
______________
______________
______________
______________
______________
______________
______________
______________
______________
______________
Preface
1
Product Description
2
Installation
3
Mode of Operation
4
Commissioning the Driver
5
Commissioning the
Communications FB
6
CPU-CP interface
7
Transmission Protocol
8
Function Codes
9
Diagnostics of the Driver
10
Diagnostics of the
Communications FB
11
Technical Data
A
Wiring Diagrams Multipoint
B
References
C
SIMATIC
S7-300/S7-400
Loadable Driver for Point-to-Point
CPs: MODBUS Protocol, RTU
format, S7 is Slave
Operating Instructions
09/2009
A5E00218418-06
Legal information
Legal information
Warning notice system
This manual contains notices you have to observe in order to ensure your personal safety, as well as to prevent
damage to property. The notices referring to your personal safety are highlighted in the manual by a safety alert
symbol, notices referring only to property damage have no safety alert symbol. These notices shown below are
graded according to the degree of danger.
DANGER
indicates that death or severe personal injury will result if proper precautions are not taken.
WARNING
indicates that death or severe personal injury may result if proper precautions are not taken.
CAUTION
with a safety alert symbol, indicates that minor personal injury can result if proper precautions are not taken.
CAUTION
without a safety alert symbol, indicates that property damage can result if proper precautions are not taken.
NOTICE
indicates that an unintended result or situation can occur if the corresponding information is not taken into
account.
If more than one degree of danger is present, the warning notice representing the highest degree of danger will
be used. A notice warning of injury to persons with a safety alert symbol may also include a warning relating to
property damage.
Qualified Personnel
The product/system described in this documentation may be operated only by personnel qualified for the specific
task in accordance with the relevant documentation for the specific task, in particular its warning notices and
safety instructions. Qualified personnel are those who, based on their training and experience, are capable of
identifying risks and avoiding potential hazards when working with these products/systems.
Proper use of Siemens products
Note the following:
WARNING
Siemens products may only be used for the applications described in the catalog and in the relevant technical
documentation. If products and components from other manufacturers are used, these must be recommended
or approved by Siemens. Proper transport, storage, installation, assembly, commissioning, operation and
maintenance are required to ensure that the products operate safely and without any problems. The permissible
ambient conditions must be adhered to. The information in the relevant documentation must be observed.
Trademarks
All names identified by are registered trademarks of the Siemens AG. The remaining trademarks in this
publication may be trademarks whose use by third parties for their own purposes could violate the rights of the
owner.
Disclaimer of Liability
We have reviewed the contents of this publication to ensure consistency with the hardware and software
described. Since variance cannot be precluded entirely, we cannot guarantee full consistency. However, the
information in this publication is reviewed regularly and any necessary corrections are included in subsequent
editions.
Siemens AG
Industry Sector
Postfach 48 48
90026 NRNBERG
GERMANY
A5E00218418-06
09/2009
Copyright Siemens AG 2009.
Technical data subject to change
Loadable Driver for Point-to-Point CPs: MODBUS Protocol, RTU format, S7 is Slave
Operating Instructions, 09/2009, A5E00218418-06 3
Table of contents
1 Preface...................................................................................................................................................... 7
2 Product Description ................................................................................................................................. 11
2.1 Application Options......................................................................................................................11
2.2 Hardware and Software Requirements........................................................................................13
2.3 Summary of the GOULD-MODBUS Protocol ..............................................................................14
3 Installation ............................................................................................................................................... 17
3.1 Use of the Dongle ........................................................................................................................17
3.2 Interface Connection....................................................................................................................18
4 Mode of Operation................................................................................................................................... 19
4.1 Components of the SIMATIC / MODBUS Slave Data Link..........................................................19
4.2 Task Distribution ..........................................................................................................................21
4.3 Used MODBUS Function Codes..................................................................................................21
4.4 Data Areas in the SIMATIC CPU.................................................................................................22
4.5 Access with Bit-Orientated Function Codes ................................................................................23
4.6 Access with Register-Orientated Function Codes .......................................................................24
4.7 Enable/disable Write Access .......................................................................................................26
5 Commissioning the Driver........................................................................................................................ 27
5.1 Installing the Driver on the STEP 7 Programming Device/PC.....................................................27
5.2 Uninstalling the Driver..................................................................................................................28
5.3 Configuring the Data Link ............................................................................................................28
5.3.1 Configuring a Data Link with the CP 341.....................................................................................28
5.3.2 Configuring a Data Link with the CP 441-2..................................................................................29
5.4 Assigning Parameters to the CP..................................................................................................31
5.4.1 Assigning Parameters to the CP..................................................................................................31
5.4.2 Assigning Parameters to the CP 341...........................................................................................31
5.4.3 Assigning Parameters to the CP 441-2 .......................................................................................32
5.5 Configuration of the Data Link .....................................................................................................34
5.6 Assigning parameters to the loadable driver ...............................................................................35
5.6.1 MODBUS Slave Protocol .............................................................................................................35
5.6.2 Conversion of MODBUS Addresses for Bit Functions.................................................................38
5.6.3 Conversion of MODBUS Addresses for Register Functions .......................................................42
5.6.4 Limits for Write Functions ............................................................................................................44
5.6.5 RS422/485 (X27) Interface ..........................................................................................................46
Table of contents
Loadable Driver for Point-to-Point CPs: MODBUS Protocol, RTU format, S7 is Slave
4 Operating Instructions, 09/2009, A5E00218418-06
5.7 Loading the Configuration and Parameter Assignment Data for the CP 341............................. 48
5.8 Loading drivers to the CP 341 .................................................................................................... 49
5.9 Loading the Configuration and Parameter Assignment data for the CP 441-2 .......................... 50
5.10 Startup Characteristics of the CP................................................................................................ 50
5.11 Parameter Assignment for "Startup of the CPU" ........................................................................ 51
6 Commissioning the Communications FB ................................................................................................. 53
6.1 Installing the FB .......................................................................................................................... 53
6.2 STEP 7 project ............................................................................................................................ 54
6.3 FB 80 Parameters (CP 341)........................................................................................................ 56
6.4 FB 180 Parameters (CP 441-2) .................................................................................................. 57
6.5 Program Call ............................................................................................................................... 58
6.6 Cyclic Operation.......................................................................................................................... 61
7 CPU-CP interface .................................................................................................................................... 63
7.1 CPU-CP interface for CP 341 ..................................................................................................... 63
7.1.1 General Information .................................................................................................................... 63
7.1.2 Data Transfer Length CPU <-> CP............................................................................................. 63
7.1.3 Data Consistency........................................................................................................................ 64
7.2 CPU-CP Interface for CP 441-2.................................................................................................. 65
7.2.1 General Information .................................................................................................................... 65
7.2.2 Data Transfer Length CPU <-> CP............................................................................................. 65
7.2.3 Data Consistency........................................................................................................................ 66
8 Transmission Protocol ............................................................................................................................. 67
9 Function Codes........................................................................................................................................ 73
9.2 Function Code 01 Read Coil (Output) Status........................................................................... 75
9.3 Function code 02 - Read Input Status ........................................................................................ 79
9.4 Function Code 03 - Read Output Registers................................................................................ 82
9.5 Function code 04 - Read Input Registers ................................................................................... 85
9.6 Function Code 05 - Force Single Coil ......................................................................................... 89
9.7 Function code 06 - Preset Single Register ................................................................................. 92
9.8 Function code 08 - Loop back Diagnostic Test........................................................................... 95
9.9 Function code 15 - Force Multiple Coils...................................................................................... 97
9.10 Function code 16 - Preset Multiple Registers ........................................................................... 100
Table of contents
Loadable Driver for Point-to-Point CPs: MODBUS Protocol, RTU format, S7 is Slave
Operating Instructions, 09/2009, A5E00218418-06 5
10 Diagnostics of the Driver........................................................................................................................ 103
10.1 Diagnostic Facilities on the CP 341...........................................................................................104
10.1.1 Diagnostics via Display Elements of the CP 341.......................................................................104
10.1.2 Diagnostic Messages of the Function Blocks of the CP 341.....................................................105
10.2 Diagnostic Facilities on the CP 441-2........................................................................................106
10.2.1 Diagnostics via Display Elements of the CP 441-2....................................................................106
10.2.2 Diagnostic Messages of the System Function Blocks of the CP 441-2.....................................107
10.2.3 Reading Error Message Area SYSTAT for CP 441-2................................................................108
10.2.4 Diagnostics via Error Message Area SYSTAT of the CP 441-2................................................108
10.3 Table of Errors/Events ...............................................................................................................110
10.3.1 Error Codes in SYSTAT for "CPU Job Errors"...........................................................................110
10.3.2 Error Codes in SYSTAT for "Receive Errors" ............................................................................111
10.3.3 Error Codes in SYSTAT for General Processing Errors .........................................................112
11 Diagnostics of the Communications FB................................................................................................. 117
11.1 Diagnostics via Parameters ERROR_NR, ERROR_INFO ........................................................118
11.1.1 Errors during Initialization ........................................................................................................118
11.1.2 Errors during Processing of Function Codes...........................................................................119
11.1.3 Other Errors.............................................................................................................................120
A Technical Data....................................................................................................................................... 121
A.1 Technical Data...........................................................................................................................121
B Wiring Diagrams Multipoint .................................................................................................................... 127
C References ............................................................................................................................................ 129
C.1 References.................................................................................................................................129
Glossary ................................................................................................................................................ 131
Index...................................................................................................................................................... 139
Table of contents
Loadable Driver for Point-to-Point CPs: MODBUS Protocol, RTU format, S7 is Slave
6 Operating Instructions, 09/2009, A5E00218418-06
Loadable Driver for Point-to-Point CPs: MODBUS Protocol, RTU format, S7 is Slave
Operating Instructions, 09/2009, A5E00218418-06 7
Preface
1
Purpose of the Manual
The information in this manual will enable you to set up and commission a data link between
a CP in the form of a Modbus capable slave and a MODBUS Master control system.
Required Basic Knowledge
This manual requires general knowledge of automation engineering.
In addition, you should know how to use computers or devices with similar functions (e.g
programming devices) under the Microsoft
Windows