Modbus TCP Wizard DOKU v14 en
Modbus TCP Wizard DOKU v14 en
Modbus TCP Wizard DOKU v14 en
Generating the Parameters for the Modbus TCP Communication using the Modbus TCP Wizard
Modbus TCP Wizard Application May 2013
Siemens Industry Online Support This article is taken from the Siemens Industry Online Support. The following link takes you directly to the download page of this document: http://support.automation.siemens.com/WW/view/en/31535566 Caution The functions and solutions described in this article confine themselves to the realization of the automation task predominantly. Please take into account furthermore that corresponding protective measures have to be taken up in the context of Industrial Security when connecting your equipment to other parts of the plant, the enterprise network or the Internet. Further information can be found under the Item-ID 50203404. http://support.automation.siemens.com/WW/view/en/50203404
Copyright
Problem
1 2 3 4 5 6 7
Related Literature
History
Siemens AG 2013 All rights reserved Copyright
Copyright
Table of contents
Table of contents
Warranty and liability ...............................................................................................4 1 2 Problem...........................................................................................................6 Solution...........................................................................................................7 2.1 2.2 3 4 5 Solution overview ..............................................................................7 Required Hardware and Software Components .................................7
Function mechanisms of this application .....................................................8 Installation ......................................................................................................9 Operation of the application ........................................................................ 10 5.1 5.2 5.3 5.4 5.5 Functions of the Modbus TCP Wizard as an overview...................... 10 General information on the dialog masks ......................................... 11 Step by step instruction: Create new connection .............................. 18 Step by step instruction: Change connection.................................... 22 Step by step instruction: Copy connection / use as template ............ 25
6 7
Siemens AG 2013 All rights reserved
Copyright
1 Problem
Problem
However, the configuration of the Modbus TCP communication via integrated PROFINET interface is only possible using the function blocks of the Modbus TCP communication. The connection description does not occur via a configuration (in NetPro), therefore the parameters for each connection must be specified in a data block.
Introduction
Copyright
2 2.1
Solution
Solution
Solution overview
Using the Modbus TCP Wizard tool enables simple and clear specification of the connection parameters. The tool then exports a DB with all parameters into your STEP 7 project.
Advantages The Modbus TCP Wizard provides the following advantages: simplified generation of new connection descriptions reduced susceptibility to errors reduces the parameter input to actually required parameters existing connections can be uploaded (upload) and represented Overview of the connection can be exported in a *.csv file.
Siemens AG 2013 All rights reserved
an existing connection can be used as template for a new connection (copy) an existing connection can be changed (change)
2.2
Copyright
Additional software components Operating the OC Wizard requires the installation of .NET Framework on your PG/PC. After Installation of STEP 7 at your PC this .NET Framework is already installed. Therefore it is not necessary to install .Net Framework manually. Sample files and projects The following list includes all files and projects that are used in this example.
Table 2-2 Component 31535566_Modbus_TCP_Wizard_CODE_V14.zip 31535566_Modbus_TCP_Wizard_DOKU_v14_en.pdf Note Installation program for the Tool Modbus TCP Wizard This document.
General overview
Copyright
4 Installation
Installation
The Modbus TCP Wizard is running under: MS Windows 7 Ultimate / Professional MS Windows XP Professional with SP2 or SP3 MS Vista 32bit Ultimate and Business with or without SP1 MS Windows Server 2003 SP2 Standard Edition with or without R2 as workstation
Software Preconditions
Installing the Wizard Retrieve the zip-file (31535566_Modbus_TCP_Wizard_CODE_V14.zip) and go through the setup process. The tool is available after installation at Start>SIMATIC. NOTE The Modbus TCP Wizard works with STEP 7 projects. For this reason, STEP 7 must have been installed on the computer. If STEP 7 has not been installed, the installation of the Modbus TCP Wizard will be aborted.
Copyright
5 Operation of the application 5.1 Functions of the Modbus TCP Wizard as an overview
5
5.1
Generating a new Modbus TCP connection The Modbus TCP Wizard enables you to configure new connections. The Modbus TCP connection data is stored directly in your project in a DB. Uploading the connections from a STEP 7 project Modbus TCP Wizard can read out the existing Modbus TCP connections from the STEP 7 project. In STEP 7 the Modbus TCP Wizard searches the blocks (UDT, DB) of a station for structures, which contain the connection data. The loaded data can be used for further processing. Exporting the overview of the uploaded connection
Siemens AG 2013 All rights reserved
An overview of the uploaded Modbus TCP connection of a station can be saved as *.csv file. This data can be used for example for your documentation. Creating data block with connection data The tool can save the connection data in a global data block. A new block can be created as well as connection data attached to an existing block. Change an existing connection Uploaded Modbus TCP connections can be changed with the tool. Subsequently, the data are filed at the same location in the STEP 7 project. NOTICE The Modbus TCP Wizard enables you to identify your connections by assigning a connection name in plain text. This connection name is saved in some comment lines of the connection data. These comment lines are not available for other usage!
Copyright
NOTE
In the overview the connection data are shaded in gray, if these data cannot be changed. This includes the following:
Connection data of the open communication. These data can be further used with the Open Communication Wizard. These connection data are represented in the overview in order to avoid conflicts with the connections of the open communication when generating the connection data for Modbus TCP communication. The connection data in an instance data block. Changing these data may cause time stamp conflicts.
10
5 Operation of the application 5.2 General information on the dialog masks Generate new connection by means of the copying function New Modbus TCP connections can be generated by copying and changing an uploaded connection. This facilitates the data input in case of many identical parameters. Modbus TCP connection data shaded in gray can be used during copying.
Specifying the connection name A name can be specified for a connection. This facilitates the clarity in case of several connections. This connection name is stored in the comment of the data block.
5.2
Copyright
The Modbus TCP Wizard starts with this dialog. Here you find information on the Modbus TCP Wizard. Further information on the Modbus TCP communication is available on the internet.
11
5 Operation of the application 5.2 General information on the dialog masks Dialog mask: STEP 7 project
Figure 5-2
The STEP 7 project selected in this dialog as well as the block folder can be considered as a source station. From this station connection data are uploaded. After using the Next Button the upload of the specified project starts automatically. This station is at the same time used as target station, if the details on the STEP 7 project and/or the block folder are not changed in the dialog mask Select Step 7 project and block folder in the further course of the configuration. The tool determines IP addresses of the selected station. These IP addresses can be considered as local IP addresses. The Modbus TCP communication generally only uses TCP/IP as connection type. For this reason, only the IP address of the integrated Ethernet interface is suitable as local IP address of the configuration.
Copyright
12
5 Operation of the application 5.2 General information on the dialog masks Dialog mask: Upload connections
Figure 5-3
In this dialog the uploaded connections in the overview are represented. Here you can switch between functions of the Modbus TCP Wizard. The upload starts automatically. This gives you an overview of the connections of the selected station. Furthermore the ID is preassigned with the next free value for a new connection The overview can be exported as *.csv file. To do this click export. The functions Change and Copy assume the selection of an uploaded connection in the overview. Dialog mask: Modbus general parameter
Figure 5-4
Copyright
Here you can enter general parameters for Modbus TCP communication.
Modbus TCP Wizard Version 1.4, Item-ID: 31535566
13
5 Operation of the application 5.2 General information on the dialog masks The option single write (Write values individually) is only available when the option SIMATIC S7 acts as Server has been selected. Changing the option SIMATIC S7 acts as Server causes a change of values in the further course of the configuration (i.e. connection establishment, etc.). Dialog mask: Communication partners
Figure 5-5
Here you enter connection parameters. Please ensure that the correct interface has been selected. If you do not enter a connection name, a name automatically generated by the tool is used (in the format Connection_x). The connection name is filed in the comment. In the following dialogs, changing the options causes some values to be reset (e.g. port number, etc.)
Copyright
14
5 Operation of the application 5.2 General information on the dialog masks Dialog mask: Connection parameters
Figure 5-6
In this dialog you enter the port number for the connection. The Modbus communication usually runs via port 502. Please note that not all CPU types can use port 502. We recommend using a port number from the range 2000 to 5000. Dialog mask: Modbus TCP address reference
Figure 5-7
Copyright
In this dialog you enter the Modbus TCP address reference. The first data range is always used. A seamless continuation is not required. The used data areas must not overlap. The values in the grayed fields are not considered in this check.
15
5 Operation of the application 5.2 General information on the dialog masks Dialog mask: Select destination project
Figure 5-8
In the dialog please specify to which project and to which block folder the generated DB should be imported. The selected STEP 7 project and the block folder can in this dialog be considered as target station. These details are preassigned here. You can accept this preassignment or also specify a different target project or target folder to which the completed block is compiled and inserted. If you specified a different target project and after using the Next Button a new upload of the specified project starts automatically. If a connection is changed (function Change), details in this dialog cannot be changed. The connection data are filed in the same data block and at the same location. Assign any DB name. When using a symbolic name ensure that the symbolic name is defined in your S7 program. The OC Wizard checks whether the specified block already exists in your S7 program. If the block does not yet exist in your S7 program, it will be generated. An existing data block is analyzed by the OC Wizard and, after a successful analysis, connection data can be assigned to the data block.
Copyright
16
5 Operation of the application 5.2 General information on the dialog masks Dialog mask: Overview
Figure 5-9
To check the performed changes the connections are again represented as an overview in this dialog. The changes are shaded in gray. Up to this dialog mask no changes have yet been made in the STEP 7 project. Continuing the Modbus TCP Wizard by pressing the Next button causes the compilation and insertion of the bock into your selected target project.
NOTE
Copyright
17
5 Operation of the application 5.3 Step by step instruction: Create new connection In this dialog the results of the compilation are displayed. If no errors are displayed in the report, the changes in the STEP 7 project are made successfully. In case of an error no changes are made. If an error message is displayed in the report, you check whether the used data block has not been opened otherwise. The AWL file displayed in the compilation report is created temporarily, compiled and subsequently deleted.
NOTE
5.3
NOTE
Siemens AG 2013 All rights reserved
If already configured Modbus TCP connections exist in your project, you can also create new connections via the Copy option. See: (Step by step instruction: Copy connection / use as template ).
Description 1. Click Next in this dialog. Further information on this dialog is available in chapter Dialog mask: Welcome mask.
Wizard
Copyright
2.
In this dialog you select a STEP 7 project and a block folder. Further information on this dialog is available in chapter Dialog mask: STEP 7 project or by calling the online help with the Help button.
18
5 Operation of the application 5.3 Step by step instruction: Create new connection
Description 3. In this dialog the option New has been selected as a standard. Click Next in to get to the next dialog. Further information on this dialog is available in chapter Dialog mask: Upload connections or by calling the online help with the Help button. Wizard
Copyright
19
5 Operation of the application 5.3 Step by step instruction: Create new connection
Description 4. In these dialogs you enter the parameters for Modbus TCP communication. Further information on this dialog is available in chapter Dialog mask: Modbus general parameter. Dialog mask: Communication partners, Dialog mask: Connection parameters, Dialog mask: Modbus TCP address reference or by calling the online help with the Help button. Wizard
Copyright
20
5 Operation of the application 5.3 Step by step instruction: Create new connection
Description 5. In this dialog you enter any DB name. Further information on this dialog is available in chapter Dialog mask: Select destination project or by calling the online help with the Help button. Wizard
6.
In this dialog you check your details and click Next. Further information on this dialog is available in chapter Dialog mask: Overview or by calling the online help with the Help button.
7.
Copyright
A new connection was configured. Click Finish. Further information on this dialog is available in chapter Dialog mask: Compilation report or by calling the online help with the Help button.
21
5.4
Description 1. Click Next in this dialog. Further information on this dialog is available in chapter Dialog mask: Welcome mask.
Wizard
Copyright
2.
In this dialog you select a STEP 7 project and a block folder. Further information on this dialog is available in chapter Dialog mask: STEP 7 project or by calling the online help with the Help button.
3.
In this dialog you select an uploaded connection in the overview. Activate the Change option and click Next. Further information on this dialog is available in chapter Dialog mask: Upload connections or by calling the online help with the Help button.
22
Copyright
23
6.
In this dialog you check your details and click Next. Further information on this dialog is available in chapter Dialog mask: Overview or by calling the online help with the Help button.
7.
Copyright
The selected connection was changed. Click Finish. Further information on this dialog is available in chapter Dialog mask: Compilation report or by calling the online help with the Help button.
24
5 Operation of the application 5.5 Step by step instruction: Copy connection / use as template
5.5
Description 8. Click Next in this dialog. Further information on this dialog is available in chapter Dialog mask: Welcome mask.
Wizard
9.
In this dialog you select a STEP 7 project and a block folder. Further information on this dialog is available in chapter Dialog mask: STEP 7 project or by calling the online help with the Help button.
Copyright
10.
In this dialog you select an uploaded connection in the overview. Activate the Copy option and click Next. Further information on this dialog is available in chapter Dialog mask: Upload connections or by calling the online help with the Help button.
25
5 Operation of the application 5.5 Step by step instruction: Copy connection / use as template
Description 11. In these dialogs you can change the parameters for Modbus TCP communication. Further information on this dialog is available in chapter Dialog mask: Modbus general parameter. Dialog mask: Communication partners, Dialog mask: Connection parameters, Dialog mask: Modbus TCP address reference or by calling the online help with the Help button. Wizard
Copyright
26
5 Operation of the application 5.5 Step by step instruction: Copy connection / use as template
Description 12. In this dialog you enter any DB name. Further information on this dialog is available in chapter Dialog mask: Select destination project or by calling the online help with the Help button. Wizard
13.
In this dialog you check your details and click Next. Further information on this dialog is available in chapter Dialog mask: Overview or by calling the online help with the Help button.
14.
Copyright
A new connection was configured from the template. Click Finish. Further information on this dialog is available in chapter Dialog mask: Compilation report or by calling the online help with the Help button.
27
Related literature
Related literature
This list is not complete and only represents a selection of relevant information.
Table 6-1 Subject \1\ Website HMI & Industrial Communication Title
http://www.siemens.com/s7modbus
History
Table 7-1 Version V1.0 V1.1 V1.3 Date 10.09.2008 24.06.2009 18.03.2010 28.11.2012 02/2013 First version Small changes Modification of GUI Small changes in Documentation Add-on with CPU314, CPU 412, CPU 41x-5H Modifications
V1.3 V1.4
Copyright
28