Sei sulla pagina 1di 38

MPI communikation

Chapter 1

Chapter 1

MPI communication
1.1 Introduction to MPI

MPI (Multipoint Interface) communication is a kind of simple and economical


communication method, which is adopted when the requirement of baud rate is not high and the
communication data quantity is not great.
MPI communication can exchange data by using PLC S7-200/300/400, operation panel
TP/OP and MPI/PROFIBUS communication card of host computer, such as CP5512/CP5611/
CP5613 etc.
MPI baud rate is 19.2Kbit/s~12Mbit/s, and usually the default setting is 187.5Kbit/s. Only
the MPI interface that can be configured as PROFIBUS interface can support 12Mbit/s.
MPI network, whose maximum communication distance is 50 meters, can link 32 nodes at
most. Besides, its length can be extended via repeaters.

1.2 MPI Network

1. MPI network structure


The RS485 interface in Siemens PLC S7-200/300/400 CPU is not only for programming,
but also for MPI communication. Without additional hardware investment, it can implement
communication functions such as PG/OP, global data communication and the S7
communication with a little data exchange etc.
The nodes of the network usually include network components such as S7 PLC, TP/OP,
PG/PC, intelligent ET200S and RS485 repeater etc. The network configuration structure is
shown in Figure 1-1.

Figure 1-1 MPI Network Structure


2. Extending the network length via repeaters
The MPI maximum communication distance is 50 meters. Also it can be extended via
RS485 repeaters, and there are two extension methods:
1) As shown in Figure 1-2, there is no other station between two stations.

version 1.0 page 1 of 38 04/04/2005


MPI communikation
Chapter 1

Figure 1-2 Extending MPI network length via RS485 repeaters


The maximum communication distance between MPI station and repeater is 50 meters, and
the maximum distance between two repeaters is 1000 meters. As MPI can connect 10 repeaters
at most, so the maximum distance between two MPI stations is 9100 meters.
2) If other MPI stations exist between two repeaters, then each repeater can extend only 50
meters. MPI interface is RS485 interface, and it requires the PROFIBUS bus connector (with
terminal resistance) and PROFIBUS cable (see Figure 1-3). If using other cables and
connectors, then the communication quality and distance will not be guaranteed.

Figure 1-3 Standard PROFIBUS Cable And Bus Connector


There are 32 stations at most in MPI network, but repeaters also occupy MPI nodes when
used for extension. And the connection method is shown in Figure 1-4.

version 1.0 page 2 of 38 04/04/2005


MPI communikation
Chapter 1

Figure 1-4 Connecting PROFIBUS Cable with Connector

1.3 MPI Configuration

1.3.1 Configuration of MPI parameters

It can be divided into two parts: MPI parameter configuration of PC side and PLC side.
1.Parameter configuration of PLC side
During hardware configuration, the user can click the "Properties" button (see in Figure 1-
5) to configure properties of MPI, including address and baud rate. The detailed operation refers
to Figure 1-5.

version 1.0 page 3 of 38 04/04/2005


MPI communikation
Chapter 1

Figure 1-5 MPI Network Parameter Configurations


Suggestion: Do not change the MPI baud rate in normal application. Please note that baud
rate must be kept consistent in whole MPI network, and the MPI addresses cannot be conflicted.
2. Configuration of PC side parameters
MPI parameters should be also configured in the PC side. In the "control panel"→"Set
PG/PC Interface", select the using program card and "S7_ONLINE" as access point. For
instance, PC Adapter can be selected as the programming card, as shown in Figure 1-6. After
finishing configuration, download configured information in STEP 7 into CPU.

version 1.0 page 4 of 38 04/04/2005


MPI communikation
Chapter 1

Figure 1-6 Configurations of MPI Programming Interface in PG/ PC

1.3.2 MPI communication card type of PC side

(1) PC Adapter One end is connected to RS232 port or universal serial bus (USB) port of
PC, while the other is connected to MPI interface of CPU. It has no network diagnostic
function, and its maximum baud rate is 1.5Mbit/s, with a lower price.
(2) CP55 11 PCMCIA TYPE II card, used for programming and communication of
notebook computer. It has network diagnosis function, and its maximum baud rate is 12Mbit/s,
with a comparatively higher price.
(3) CP55 12 PCMCIA TYPE II Cardbus (32 bit) card, used for programming and
communication of notebook computer. It has network diagnosis function, and its
maximum baud rate is 12Mbit/s, with a comparatively higher price.
(4) CP56 11 PCI card, used for programming and communication of the desk computer. It
has network diagnosis function, and the maximum baud rate is 12Mbit/s, with a proper price.
(5) The CP56 13 PCI card (replace the original CP5412card), used for programming and
communication of the desk computer. It has network diagnosis function, and the maximum baud
rate is 12Mbit/s. It has processor, which can maintain stability of communication with a large
amount of data. Usually it is used in PROFIBUS network, and it has MPI function, with a
comparatively higher price.
After figuring out functions mentioned above, it is easy to select the proper communication
card. In the code of CP communication card, ‘5’represents PCMCIA interface, ‘6’represents
PCI bus, ‘3’represents that it has processor.

version 1.0 page 5 of 38 04/04/2005


MPI communikation
Chapter 1

1.3.3 Remote programming via public telephone network

In addition to local connection, the telephone network can also be used for remote
programming. The detailed network structure refers to Figure 1-7.

Figure 1-7 Network Configurations via Remote Programming by Telephone Network


1. MPI of configuration programmer side
Click "Set PG/PC Interface" in the "control panel", select "S7ONLINE (STEP 7)" as
access point, and point to "TS Adapter", whose property configuration selection is shown in
Figure 1-8: Select communication interface and baud rate, which is easy to configure TS
Adapter, and the "Modem connection" can be selected automatically when dial-up (version
above the STEP 7 V5.2s).

Figure 1-8 TS Adapter Parameter Configurations


2. Configuring parameters of TS Adapter
1) Select "Direct connection" in "Set PG/PC Interface". One end of TS Adapter requires a
RS232 cable to connect PC serial port.

version 1.0 page 6 of 38 04/04/2005


MPI communikation
Chapter 1

2) The other end of TS Adapter connects to MPI interface of PLC, which enables CPU
supply power for TS Adapter.
Click the "Start"→"SIMATIC"→"STEP 7"→"TeleService", enter menu configuration.
On the left side of menu, create a new Folder, such as "test", then insert "Plant" and add
remote telephone number. As Figure 1-9 show, on the left side of menu, insert "test", then on
the right side, create "MY plant". In this case, it configures remote telephone number as 010
64721888.

Figure 1-9 TeleService Configuring-Creating New Project


Then the user click "MY plant" properties in Figure 1-9, and can modify project name and
telephone number, double-click project name to select the modem connected to programmer
side, as shown in Figure 1-10.

version 1.0 page 7 of 38 04/04/2005


MPI communikation
Chapter 1

Figure 1-10 TeleService Configuring-Selecting Modem


As for dial-up access, considering system security, there are three methods that can avoid
unauthorized access:
Disconnect TS Adapter connected with PLC MPI interface.
Configure username and password in TS Adapter.
Add callback function.
After dialing through, TS Adapter verifies username and password, then disconnect
automatically, callback the user appointed number. That means if user want to modify the
program, after verification of username and password, he must dial the number TS Adapter
appointed to ensure the system security.
The latter two methods must use the TeleService for configuration.
Detailed is as follows:
Connect TS Adapter, click "Options" and "Assign adapter parameters" to enter menu
configuration as Figure 1-11.

version 1.0 page 8 of 38 04/04/2005


MPI communikation
Chapter 1

Figure 1-11 TeleService Configuring-Configuring TS Adapter parameters


Configure MPI address of TS Adapter as shown in Figure 1-12.

version 1.0 page 9 of 38 04/04/2005


MPI communikation
Chapter 1

Figure 1-12 Configuring MPI Address of TS Adapter


3) After configuration, connect the programmer and TS Adapter to public telephone
network, select project name, click the "Connection"→"Establish" or press shortcut key "F7",
and then establish dial-up connection for remote programming access, as Figure 1-13 show.

version 1.0 page 10 of 38 04/04/2005


MPI communikation
Chapter 1

Figure 1-13 TeleService configuring-creating a connection


The new version of TS Adapter supports dial-up communication among PLC stations. First
PLC calls TeleService function function block FB47 to dial, then related MPI communication
function block (SFC65/66, SFC67/68) for communication.
Sample program refers to the CD, with the project name MPI-SFC-TS.

1.4 MPI Communication between PLC-PLC

There are three methods to implement communication between PLC-PLC via MPI: global
data package communication, non-configured connection communication, and configuration
connection communication.

1.4.1 Global data package communication

1.Introduction
As for data exchange between PLCs, only sending data area and receiving data area should
be concerned. Global data package communication mode means that in the process of
configuration of PLC hardware, it configures the sending data area and receiving data area
among communicating PLC stations, and need not any program processing. This mode can only
be applied to communication among S7-300/400 PLC stations. The detailed methods and steps
of global data package communication mode are given as follows.
2.Network configuration figuring
The network configuration of global data package communication mode is shown in Figure
1-14.

version 1.0 page 11 of 38 04/04/2005


MPI communikation
Chapter 1

Figure 1-14 Network Configuration Graph


3.Hardware and software requirement
Hardware:
(1) CPU 315-2 DP.
(2) CPU 416-2 DP.
(3) MPI cable.
Software: STEP 7 V5.2 SP1.
4.Network and parameter configuration
(1) Creating MPI network Create a new project in STEP 7, for example MPI_GD. Insert
two PLC stations under this project, which are STATION1 (CPU416-2DP) and STATION2
(CPU315-2DP). Insert CPU separately to finish hardware configuration. Then create MPI
network, and configure MPI address and baud rate. In this case, MPI addresses are configured
as STATION2 and STATION4, baud rate 187.5Kbit/s.
(2) Sending data area and receiving data area As it is shown in Figure 1-15, pick out MPI
network, select "Options"→"Define Global Data" to enter menu configuration shown in Figure
1-16.

Figure 1-15 Entering Global Configuration Menu

version 1.0 page 12 of 38 04/04/2005


MPI communikation
Chapter 1

Figure 1-16 Global Data Configuration Menu


(3) Inserting all CPUs required for communication Double-click the CPU column on the
right side of "GD ID" to select CPUs required for communication. Fill in sending data area and
receiving data area under each CPU column, for example: the sending data area of CPU416-
2DP is DB1.DBB0~DB1.DBB21, and can be filled as DB1.DBB0: 22 ("DB1.DBB0" represents
initial address, "22" represents data length), then under "Edit" menu, select "sender" and
configured as sending data area. While receiving data area of CPU315-2DP is DB1.DBB0~21,
and can be filled as DB1.DBB0: 22. After compiling and saving, download configuration data
into corresponding CPU. In this way, data communication can be processed, as shown in Figure
1-17.

Figure 1-17 Defining Data Sendting and Receiving Zone


The data area can be DB, M, I, Q , and the maximum length of S7-300 data area is 22 bytes,
while S7-400 54 bytes.
Sample program refers to the CD, with the project name MPI_GD (path name, file name).

version 1.0 page 13 of 38 04/04/2005


MPI communikation
Chapter 1

(4) Multiple CPU communication To implement multiple CPU communication, GD ID


parameters must be figured out first. After compiling, communication data area in each row has
a GD ID number, as shown in Figure 1-18.

Figure 1-18 Parameter Definition


1) Parameter A: cycle number of global data package. Each cycle number represents
communication with a CPU. For example, for S7-300 CPU, two transceiving processes is a
cycle, while for S7-400 CPU, three transceiving processes is a cycle.
The supported cycle number is related to CPU, the maximum number of S7-300 CPU is 4,
which means that it can communicate with 4 CPUs at most. While the maximum number of S7-
400 CPU 414-2 DP is 8, S7-400 CPU 416-2 DP is 16.
2) Parameter B: number of global data packages. It represents how many global data
packages are contained in one cycle. For example: there are two data packages in one cycle
when two S7 stations are communicating with each other, as is shown in Figure 1-19.

Figure 1-19 Global Data Package


3) Parameter C: the number of data area in one data package. Please refer to Figure 1-20,
CPU315-2DP send 4 groups of data to CPU416-2DP, and 4 data area constitute one data
package. As mentioned above, the maximum bytes of one data package is 22. Under this
circumstance, each extra data area occupies two bytes. Thus the maximum data amount is 16
bytes.

version 1.0 page 14 of 38 04/04/2005


MPI communikation
Chapter 1

Figure 1-20 GD ID in One Data Package


The introduction above to A, B, C parameters is just for the sake of optimizing data
sending and receiving data area, and reduce CPU communication load. When in simple
application, these parameters need not to be considered. They will be generated automatically
after GD ID compiling.
(5) Communication diagnosis When multi-CPUs are communicating, sometimes the
communication will be interrupted, which can be detected by following methods:
After compiling, in the menu "View", click "Scan Rates" and "GD Status" separately to
examine scan rates and GD Status, as shown in Figure 1-21.

Figure 1-21 Examining Global Data Scan Rate and Status Word

version 1.0 page 15 of 38 04/04/2005


MPI communikation
Chapter 1

1) SR: Scan rate. In Figure 1-21, SR1.1 is 225, which means transmission update time is
225×CPU cycle time. The range of SR is 1~255. Communication interruption usually happens
when scan time is configured too fast. The user can prolong scan time properly according to
demand.
2) GDS: Status word (double word) of each data package. Please refer to Table 2-1.
Table 2-1 Programming Error-Processing Program According to Status Word
Status Word Respective program for error handling

1. Bit Length error in sending area

2. Bit Data block does not exist in sending area

4. Bit Loss of entire data package

5. Bit Grammatical error of total data package

6. Bit Data object of total data package lost

7. Bit Length of data object not identical in sending and


receiving area

8. Bit Length error in receiving area

9. Bit Data block does not exist in receiving area

12. Bit Restart at sender

32. Bit New data received in receiving area

3) GST: the result of "OR" all the GDSs. First the user can diagnose the reliability of
wiring by using communication cards such as CP5511/5611 etc. In the case above, S7-300 MPI
address is 2, and S7-400 MPI address is 4. NO.2 and NO.4 station address can be read by
connecting CP communication card to MPI network (having necessary PROFIBUS bus
connector with a programmable interface). The detailed method is as follows: click "control
panel"→"Set PG/PC Interface"→"Diagnostics"→"Read", and read all the site addresses in the
network, as shown in Figure 1-22.

version 1.0 page 16 of 38 04/04/2005


MPI communikation
Chapter 1

Figure 1-22 Diagnosis Function of PG/ PC Communication Connection


NO.0 station is the site address of CP5611. If NO.2 and NO.4 station addresses are not read,
then there may be some problems existing in hardware connection or software configuration,
which need further analysis.
(6) Event triggered data transmission If the user needs to control the data sending and
receiving process in some event or at a moment, then he can use event triggered data
transmission mode. This communication mode is implemented by calling CPU system function
SFC60 (GD_SND) and SFC61 (GD_RCV). It only supports S7-400 CPU, and configures SR
(scan rate) of CPU as 0 correspondingly. Please refer to menu configuration of global data in
Figure 1-23.

version 1.0 page 17 of 38 04/04/2005


MPI communikation
Chapter 1

Figure 1-23 SR of Global Data Configuration


Download into CPU after compiling and saving as mentioned above. Then call system
function SFC60/61 in S7-400 to control sending and receiving. The detailed program code is as
follows

Where CIRCLE_ID BLOCK_ID can refer to A, B C parameter in the GD.


In the program above, when M1.1 is 1, CPU416 receives the data from CPU315, and data
from MB20~MB29 of CPU315 is transmitted to MB40~MB49 of CPU416. When M1.0 is 1,
CPU416 send data, and the data from MB60~MB69 of CPU416 is sent to MB60~MB69 of
CPU315.
Sample program refers to the CD, with the project name MPI_GD_EVENT.

version 1.0 page 18 of 38 04/04/2005


MPI communikation
Chapter 1

1.4.2 Non-configured Connection Communication

Non-configured MPI communication is implemented by calling system function block


SFC65~69. This communication mode is applied in communication in S7-300, S7-400 and S7-
200, and there are mainly two methods: dual-side program communication mode and single-side
program communication mode. The communication mode, which is implemented by calling
system function, cannot mix with global data communication mode.
1. Dual-side program communication mode
(1) Introduction Both communication sides need to call communication function block,
and one side send data by calling sending function block, while the other side receives data by
calling receiving function block. This communication mode can be applied in communication in
S7-300/400, and sending function block is SFC65 (X_SEND), while receiving function block is
SFC66 (X_RCV). The following example will illuminate how to implement communication by
calling system function.
(2) Network configuration graph as shown in Figure 1-24.

Figure 1-24 Network Configuration Graph


(3) Hardware and software requirement
Hardware:
1) CPU 315-2 DP.
2) CPU 416-2 DP.
3) MPI cable.
Software: STEP 7 V5.2 SP1.
(4) Network and parameter configuration
1) Creating a new project: create STATION1 and STATION2 in STEP 7. The CPU of
STATION1 is S7 416-2 DP, MPI address 2; The CPU of STATION2 is S7315-2DP, MPI
address 4. In this case, No.2 station send two data packages to No.4 station. No.4 station put the
data packages into corresponding data area after judgment.
2) Programming: Call ”X_SEND” SFC65 in OB35 block of S7 416, and the detailed
program code is as follows

version 1.0 page 19 of 38 04/04/2005


MPI communikation
Chapter 1

Table 2-2 Parameter Instructions


REQ Send request, parameter 1 means sending.

CONT For 1 it means that data are sent as a continuous unit.

DEST_ID MPI-address of destination

REQ_ID User-defined ID of a data package. Identifiers of both data packages in the example
are “1“ and “2“.

SD Defining the data sending area in form of an index pointer. The first data package in
the example has 76 continuous bytes starting with DB1. DBB0. Maximum size of the
sending area is 76 Bytes.

RET_VAL Sending the status word.

BUSY History of communication, 1 means sending, 0 means sent.

The parameter instruction in the program refers to Table 2-2.


In the sample program above, when both M1.1 and M1.3 are ‘1’,CPU 416 will send two
data packages whose identifier are ‘1’ and ‘2’ respectively to CPU 315.
The number of connections one CPU can establish is related to communication resource,
which determines the calling number—dynamic link number. In this case, when both M1.1 and
M1.3 are ‘1’, the connection with NO.4 station is established; on the contrary, when NO.4
station send data and NO.2 station receives data, a connection will also need to be established,
which means when communication between two stations, if both need to send and receive data,
then two dynamic link resources need to be occupied. Please refer to Figure 1-25 to see
communication connection status.

version 1.0 page 20 of 38 04/04/2005


MPI communikation
Chapter 1

Figure 1-25 Establishing Communication Connection Status


When both M1.1 and M1.3 are ‘0’, the established connection NO.4 station is not released,
which can only be released by calling SFC69. In this case, when M1.5 is ‘1’, connection with
NO.4 station is disconnected, and the connection resource will be released, as shown in Figure
1-26.

version 1.0 page 21 of 38 04/04/2005


MPI communikation
Chapter 1

Figure 1-26 Releasing of Communication Connection


The receiving function block “X_RCV”SFC66 in OB1 of S7 315 is called, and the detailed
program code is as follows

version 1.0 page 22 of 38 04/04/2005


MPI communikation
Chapter 1

Table 2-3 Parameter Instructions


EN_DT Receiving the instructions

RET_VAL Receiving the status word

REQ_ID Identifier for receiving the data package

NDA 1 means there are new data packages, 0 means no new


package

RD Receiving area in the continuous 76 Bytes starting with


DBB0 within DB1
The parameter instruction in the program refers to Table 2-3.
Receiving function block only identifies the identifier of the data, and does not consider
which CPU send. In this case, it receives two data packages in NO.2 station. When identifier is
‘1’ and M1.3 is ‘1’, data from the receiving data area is copied to ex-76 words of DB2 (calling
SFC20). When identifier is ‘2’ and M1.4 is ‘1’, data from the receiving data area is copied to
ex-76 words of DB3 (calling SFC20).
Sample program refers to the CD, with the project name MPI_SFC_SR.
2. Single-side program communication mode
Different from dual-side program communication mode, single-side program
communication mode, which is an access mode between client and server, only write
communication program on one side. The CPU of the side that writes the programs is customer,
while the other is server. The customer accesses the server via SFC communication function

version 1.0 page 23 of 38 04/04/2005


MPI communikation
Chapter 1

block. This communication mode is applied in communications in S7-300/400/200. The S7-


300/400 CPU can be used as the customer and server at the same time, while S7-200 can only
be used as server. The SFC67 (X_GET) is used to read the data in the data area appointed by
server and store in local data area, SFC68 (X_PUT) is used to write the data from local data area
to data area appointed by server.
(1) Communication between S7-300/400.
1) Network configuration graph as shown in Figure 1-27.

Figure 1-27 Network Configuration Graph


2) Hardware and software requirement
Hardware:
CPU 315-2 DP.
CPU 416-2 DP.
MPI cable.
Software: STEP 7 V5.2 SP1.
3) Creating a new project: create STATION1 and STATION2 in STEP 7. The CPU of
STATION1, which serves as customer, is S7 416, MPI address 2; The CPU of STATION2,
which serves as server, is S7315-2DP, MPI address 4.
4) Programming: CPU416 calls SFC68, and send the continuous 76-bit data beginning with
DB1.DBB0 in local data area to the continuous 76-bit data beginning with DB1.DBB0 in
CPU315; CPU416 calls SFC67, and reads the continuous 76-bit data beginning with
DB1.DBB0 then puts into the continuous 76-bit data beginning with DB2.DBB0 in local data
area. The sample program is as follows:

version 1.0 page 24 of 38 04/04/2005


MPI communikation
Chapter 1

Table 2-4 Parameter Instructions


DEST_ID MPI-address of partner

VAR_ADDR Data area of partner (server side)

SD Local data area (data source). Data from this area are sent if
M1.1 is 1.

RD Local receiving area for data. Received data are stored in the
local area if M1.3 is 1.
The parameter instruction in the program refers to Table 2-4.
The maximum capacity of data area is 76 bytes. Call SFC67 and SFC68 in one CPU at the
same time will occupy one dynamic link source. When M1.5 is ‘1’, communication is
interrupted and the link is released. In the same way, S7-300 can also be used as the customer,
S7-400 the server.
Sample program refers to the CD, with the project name MPI_SFC_PG300.
(2) Communication between S7-300/400 and S7-200
1) Introduction
For S7-200 cannot call SFC communication function block, so it can only be used as
server. And S7-300/400 can serves as customer.
2) Network configuration graph as shown in Figure 1-28.

version 1.0 page 25 of 38 04/04/2005


MPI communikation
Chapter 1

Figure 1-28 Network Configuration Graph


3) Hardware and software requirement
Hardware:
CPU 315-2 DP.
CPU 416-2 DP.
CP56 11 communication card.
MPI cable.
Software:
STEP 7 V5.2 SP1.
MicroWin3.2.
4) Creating a new project: create S7-300 stations, and configured MPI address as 2, baud
rate 187.5Kbit/s. Open the MicroWIN32, and configure S7-200 parameters. In "System Block",
configure S7-200 station address as 4, baud rate 187.5Kbit/s. Download after finishing
configuration as shown in Figure 1-29.

version 1.0 page 26 of 38 04/04/2005


MPI communikation
Chapter 1

Figure 1-29 Configuring Station Address and Baud Rate of S7-200


5) Programming: Programming of S7-300
In OB1 of S7-300, call SFC68 and SFC67.

When M1.1 is ‘1’, S7-300 send input data IB0 to QB0 of S7-200; when M1.4 is ‘1’, S7-
300 reads input data IB0 of S7-200 and puts into local output data QB0.
Sample program refers to the CD, with the project name MPI_SFC_200_PPI.
If V data area of S7-200 is read and written, then when defining V data area of S7-200 in
S7-300, DB1 must replace V. For instance, if the latter 16 bytes of VB100 in S7-200 are read
and put into the latter 16 bytes of MB20 in S7-300, system function SFC67 (X_GET) must be
called, and in VAR_ADDR configures S7-200 data area as P # DB1.DBX100.0 BYTE 16,
while in parameter RD, configures S7-300 data area as P # MB20.0 BYTE 16.
Moreover, it also can communicate with the MPI of S7-300/400 via PROFIBUS- DP
module EM277 of S7-200. On S7-200 side, configure the EM277 station address by using
dialing-code switch (configuration becomes effective only when given an electric shock to
restart). When calling SFC67/68 on S7-300/400 side, station address parameter has to be
configured as MPI address of EM277.

1.4.3 Configuration Connection Communication Mode

1. Introduction
In MPI network, this mode is only applied in the communication between S7-300/400 and
S7-400/400. When communicating between S7-300/400, S7-300 only can be used as server, and
S7-400 used as customer to read and write to S7-300; when communicating between S7-
400/400, S7-400 can be used as both customer and server. Communication by calling system
function block in MPI network, the maximum of data package length is 160 bytes. Take this
connection as example to introduce configuration connection communication mode is below.
2. Network configuration graph as shown in Figure 1-30.

version 1.0 page 27 of 38 04/04/2005


MPI communikation
Chapter 1

Figure 1-30 Network Configuration Graph


3. Hardware and software requirement
Hardware:
1) CPU 315-2 DP.
2) CPU 416-2 DP.
3) MPI cable.
Software: STEP 7 V5.2 SP1.
4. Creating a new project
Create STATION1 and STATION2 in STEP 7. The CPU of STATION1, which serves as
customer, is S7 416, MPI address 2; The CPU of STATION2, which serves as server, is S7315-
2DP, MPI address 4. Suppose S7-400station writes the continuous 20-bit data beginning with
DB1.DBB0 in local data area to the continuous 20-bit data beginning with DB1.DBB0 of S7-
300 station, then reads the continuous 20-bit data beginning with DB1.DBB0 of S7-300 station
and puts into the continuous 20-bit data beginning with DB2.DBB0 in local data area.
5. Connection and parameter configuration
In menu of STEP 7, click "Options"→"Configure Network" to enter into network
configuration window "NetPro", as shown in Figure 1-31.

Figure 1-31 Configuring Communication Connection


Click "CPU 416-2DP" of STATION1, and establish new connection in connection table
selecting "S7 connection" connection type. And select CPU of which needs to connect, and in
this case select CPU315, as shown in Figure 1-32.

version 1.0 page 28 of 38 04/04/2005


MPI communikation
Chapter 1

Figure 1-32 Configuring Connection Type


Click "Apply" to establish connection, and examine the detailed properties of connection
table, as shown in Figure 1-33.

version 1.0 page 29 of 38 04/04/2005


MPI communikation
Chapter 1

Figure 1-33 Properties of Connection Menu


Compile and save after configuration, and download the connection configuration to each
CPU respectively.
6. Configuration
Call communication system function block SFB15 in S7-400 station, and send the data to
S7-300 station. The program is as follows:

version 1.0 page 30 of 38 04/04/2005


MPI communikation
Chapter 1

REQ: Rising edge Trigger, and each rising edge triggers once.
Read the data of S7-300 by calling SFB14. The program is as follows.

Sample program refers to the CD, with the project name MPI_SFB_PG.
Compared with the communication of calling the system function block SFC, calling
system function block SFB has greater sending and receiving data quantity in each package, but
need to establish connection table in hardware configuration, and also will occupy
communication resource of S7-300. Under the premise of meeting communication requirement,
the user is suggested to use the non-configured connection communication mode.

1.5 MPI Communication between S7 PLC And HMI Products

MPI communication between S7-300/400 and HMI products needs neither STEP 7
software configuration, nor writing any program, and only need to configure related
communication parameters in HMI configuration software.

1.5.1 Communication between PLC and TP/OP

When TP/OP is communicating with PLC via MPI protocol, the user need to configure
communication parameters by using ProTool configuration software. For example, if the user
wants to connect TP270-10 with S7 PLC, then double-click "Controllers" in the ProTool
interface, and a dialog box as shown in Figure 1-34 will appear.

Figure 1-34 Configuring PLC Communication Parameter


Click the "Parameters" button, and configure the MPI address of CPU which needs to
connect, slot number and other parameters, as is shown in Figure 1-35.

version 1.0 page 31 of 38 04/04/2005


MPI communikation
Chapter 1

Figure 1-35 Configuring PLC Communication Parameter


In S7-400 multi-CPU system, the user only needs to fill the station number and slot
number of CPU, which needs to connect.

1.5.2 MPI Communication between S7 PLC and Monitoring Software WinCC

Similar to connecting TP/ OP, when communication between S7 PLC and monitoring
software WinCC via MPI protocol, the user also only need to configure station address, slot
number and net card of S7 CPU.
1. Installing and configuring MPI communication card in PC
First, insert CP5611 into PC, and start the computer, then double-click "Set PG/PC
Interface" icon in the control panel of PC, as shown in Figure 1-36.

version 1.0 page 32 of 38 04/04/2005


MPI communikation
Chapter 1

Figure 1-36 Installing CP5611 Communication Card


2. Adding SIAMTIC S7 communication protocol in WinCC
Open WinCC, and select "Tag Management". Right-click selecting "Add New Driver". In
the appearing window, select "SIAMTIC S7 protocol suite" connection driver, and add it under
"Tag Management", as shown in Figure 1-37.

version 1.0 page 33 of 38 04/04/2005


MPI communikation
Chapter 1

Figure 1-37 Configuring WinCC Communication Connection


S7 protocol group include S7 protocol applied in different networks, which include MPI
network, PROFIBUS network and the Industrial Ethernet.
3. Selecting WinCC communication card
Select MPI communication protocol and right-click to select "System Parameter", and
enter the system parameter configuration menu as shown in Figure 1-38.

Figure 1-38 Selecting WinCC Communication Card

version 1.0 page 34 of 38 04/04/2005


MPI communikation
Chapter 1

4. Establishing WinCC communication connection


Select MPI communication drive, and right-click to select "New Driver Connection" to
establish a connection. If connecting muti-CPUs, then one connection is established when
connecting to one CPU. The number of connected CPU is related to the network card applied in
host computer. For instance the maximum number supported by CP5611 is 8, and these
connection numbers can be found in relative product data sheet. In this case, the connection
parameters need modification, such as the station address and slot number of selected CPU, as
shown in Figure 1-39.

Figure 1-39 Configuring WinCC Communication Connection Parameter


When connecting to CPU S7-300, slot number is 2, while S7-400, slot number should refer
to the CPU slot number in STEP 7 hardware configuration.
5. Communication diagnosis
If there is something wrong with communication here, first the user should check if the
network card has been rightly installed, and the connections of communication cables and
junctions well contact. Then he should check whether configuration parameters are rightly
configured. Meantime, by using the self-diagnosis function of CP communication card, all the
station addresses in the MPI network can be read in "Set PG/PC Interface" of PC control panel,
as shown in Figure 1-40.

version 1.0 page 35 of 38 04/04/2005


MPI communikation
Chapter 1

Figure 1-40 Hardware Network Diagnosis via CP Communication Card


In this case, the MPI address of CP5611 is 0, and the MPI address of CPU is 4.
When WinCC cannot establish connection with CPU, if the diagnosis result is that NO.0
and NO.4 station can be read, then it can be judged that there may be some problems with
WinCC configuration, which needs further inspection.

1.5.3 Remote communication between WinCC and PLC

Remote communication, which means using public telephone network to access the data of
PLC, can be implemented by using TeleService software and hardware adapter. Like the remote
program access steps in STEP 7, first dial through PLC stations via TeleService, then configure
interface parameters in "Set PG/PC Interface" of PC control panel, as shown in Figure 1-41.

version 1.0 page 36 of 38 04/04/2005


MPI communikation
Chapter 1

Figure 1-41 Selecting TS Adapter


Select access point as MPI, and point to TS Adapter.
Finally select MPI under "SIAMTIC S7 Protocol Suite" of WinCC, and right-click
selecting "System Parameter". In the appearing window, select MPI. The selected name of
communication unit should be in accordance with the selected communication card in "Set
PG/PC Interface", as shown in Figure 1-42.

version 1.0 page 37 of 38 04/04/2005


MPI communikation
Chapter 1

Figure 1-42 Configuring TS Adapter System Parameter


Communication can be immediately established after PC dials through PLC.

version 1.0 page 38 of 38 04/04/2005

Potrebbero piacerti anche