Professional Documents
Culture Documents
Sitrain - India: Simatic Net
Sitrain - India: Simatic Net
D I A
I N
MPI COMMUNIACATION
-
A I N
IT R
Unrestricted
S © Siemens INDIA (I-CS-VS-TRG). All Rights Reserved.
D I A
Communication with MPI
- I N
A I N PG 720
IT R
S
Page 2 © Siemens INDIA (I-CS-VS-TRG). All Rights Reserved.
1
Sub networks in SIMATIC
A
P G 7 20
I
OPs PCs, OS PGs
MPI network
D
Profinet
Industrial Ethernet
N
PROFIBUS Point-to-point
Cell level
- I S7-300
-SINUMERIK, RCM
-TI 505
N
-3rd party PLC
I
Profinet Field level
DP/AS
Interface
A
ET Link
200L ET
R
ASI (Actuator Sensor Interface) 200B/L
ASI level
IT
ASI
ASI power
supply Submodules
Field device with ASI Sensors and
S
ASIC actuators
D I A
S7 Communication Methods
Global Data
- I N
Op. Sys.
of CPU
A I N cyclic or event-driven
with MPI
Op. Sys.
of CPU
IT R
Basic communication Extended communication
S
( non-configured connection ) (configured connection )
Event-driven Event-driven
2
Networking with MPI
D I A
2
R
PG 720
S
Page 5
IT
PG connection with MPI n Default MPI address
D I A
Connection Options to MPI
Bus connector
- I N
A I N
IT R
To MPI
interface
of
CPU
Connection for
PG/HMI
S To MPI
interface
of
CPU
Switch for terminating
resistor
3
Global Data: Overview
CPU 1
MW 10
CPU 2
MW 20
I A
CPU 3
D
MW 30
- I N
A I N Global Data
IT R
S
Page 7 © Siemens INDIA (I-CS-VS-TRG). All Rights Reserved.
D I A
GD Circles
CPU1 CPU2
- I N
CPU3 CPU4 CPU5
GD circle
1
I N
S GD 1.1
A
R GD 1.2
R GD 1.1
S GD 1.2
IT R 2
3
R GD 2.1 S GD 2.1
S GD 3.1
R GD 2.1
R GD 3.1
R GD 2.1 R GD 2.1
S
R GD 3.2 S GD 3.2
5
S GD 5.1 R GD 5.1 R GD 5.1
4
Global Data: Configuring the Hardware
A
Create stations
D I
N
"Accessible Nodes"
I
Network CPUs
N -
A I
IT R
S
Page 9 © Siemens INDIA (I-CS-VS-TRG). All Rights Reserved.
D I A
Editing the GD Table
Open GD Table
- I N Select CPUs
A I N
IT R
S Define Global Data
Replication factor
5
Compiling the GD Table
Compile GD Table
D I A
Define scan rates and
- I N
status information
A I N
IT R
S
Page 11 © Siemens INDIA (I-CS-VS-TRG). All Rights Reserved.
D I A
Downloading GD Configuration Data
- I N
A I N
IT R
S
Page 12 © Siemens INDIA (I-CS-VS-TRG). All Rights Reserved.
6
Preparing for Communication
A
SIEMENS
PG 740
D I
N
CPU-MPI
PG-MPI address: 3
Training area 2
address: 4
- I
SIEMENS
A I N
Station 2
R
PG 740
IT
CPU-MPI
address: 6
S
Page 13
PG-MPI address: 5
D I A
Monitoring the Addresses of Several Stations
- I N
Addresses of Station 1
A I N
IT R
S Addresses of Station 2
7
Global Data Communication
D I A
Station 1
- I N Station 2
0 8 1 5
I N
IW 4 (IW 2)
A
0 8 1 5
QW 12 (QW 6)
IT R 4 7 1 1
QW 12 (QW 6)
4 7 1 1
IW 4 (IW 2)
S
Page 15 © Siemens INDIA (I-CS-VS-TRG). All Rights Reserved.
D I A
Configuring with NETPRO
- I N
A I N Define global data
IT R
S
Page 16 © Siemens INDIA (I-CS-VS-TRG). All Rights Reserved.
8
SFC Communication: Overview
D I A
N
κThe connection to the partner is dynamically configured
I
and disconnected
N
κCan be used on all S7-300/400 CPUs
-
A I
κVariables can also be read and written in the S7-200 via
PROFIBUS-DP (X_GET, X_PUT)
IT R
κThe communication partners can also be found in
another S7 Project
S
Page 17 © Siemens INDIA (I-CS-VS-TRG). All Rights Reserved.
D I A
SFC Communication: Block Overview
SFC NAME
- I N
Short Description
SFC 65
SFC 66
A I N
X_SEND
X_RCV
Send block for sending data to the X_RCV (Client) block
IT R
SFC 67
SFC 68
X_GET
X_PUT
Read data from the partner PLC
S SFC 69
SFC 72
SFC 73
SFC 74
X_ABORT
I_GET
I_PUT
I_ABORT
Abort existing connection
9
SFC Communication: X_GET (SFC 67) Block
LAD/FBD Representation
STL Representation
With an example for the parameter assignment
REQ
D I A
SFC67 (X_GET)
RET_VAL
CALL SFC 67
REQ:= I 0.4
CONT:= FALSE
//Trigger
//Disc. connection
- I NCONT
DEST_ID
VAR_ADDR
BUSY
RD
N
DEST_ID:= W#16#3 //MPI_Address
RET_VAL:= MW100
A I
VAR_ADDR:= P#M20.0 BYTE 10 //Remote var.
//Error code
IT R
BUSY:= M 4.1
RD:= P#M0.0 BYTE 10
//SFC active
//Local variable
S
Page 19 © Siemens INDIA (I-CS-VS-TRG). All Rights Reserved.
D I A
SFC Communication: X_PUT (SFC 68) Block
- I N
LAD/FBD Representation
A I N
STL Representation
With an example for the parameter assignment
REQ
SFC68 (X_PUT)
RET_VAL
R
CALL SFC 68
CONT BUSY
IT
REQ:= I 0.5 //Trigger
CONT:= FALSE //Disc. connection DEST_ID
S DEST_ID:= W#16#3
10
SFC Communication: X_SEND (SFC 65) Block
A
STL Representation LAD/FBD Representation
D I
SFC65 (X_SEND)
RET_VAL
REQ:= M4.0
CONT:= FALSE
DEST_ID:= W#16#4
//Trigger
//Disc. connection
//MPI_addr.
- I N
CONT
DEST_ID
REQ_ID
BUSY
REQ_ID:= DW#16#1
I N //Identifier
SD:= P#M20.0 BYTE 10 //Variable
RET_VAL:= MW40
A //Error code
SD
IT R
BUSY:= M 4.1 //SFC active
S
Page 21 © Siemens INDIA (I-CS-VS-TRG). All Rights Reserved.
D I A
SFC Communication: X_RCV (SFC 66) Block
STL Representation
- I N
LAD/FBD Representation
A I N
With an example for the parameter assignment SFC66 (X_RSV)
EN_DT RET_VAL
IT R
CALL SFC 66
EN_DT:= TRUE
RET_VAL:= MW 50
//Trigger data trans.
//Error code
REQ_ID
NDA
S REQ_ID:= MD52
NDA:= M40.0
//Job ID
//Data exist
RD:= P#M20.0 BYTE 10 //Variable
RD
11
SFB Communication: Overview
A
Ethernet
D I
and exist permanently (even in STOP mode)
- I
κCommunications services also for controlling (Stop,
N
Start) the partner
A I N
κSFBs exist for all S7-400-CPUs
IT R
κData can also be read and written from an S7-300
(GET/PUT)
S
Page 23 © Siemens INDIA (I-CS-VS-TRG). All Rights Reserved.
D I A
One-sided Communication Services using S7 Connections
Logical
S7 connection
- I N S7-300/400
N
(one-sided or two-sided)
I
S7-400 CPU
R
CPU
1
A MPI=3
MPI=2
IT
Local ID MPI=2
Physical
S
MPI=2 connection, e.g. MPI
1
CPU‘s
SFB:
- GET oper.
- PUT system
- STOP
- START
- STATUS
12
Two-sided Communication Services using S7 Connections
Logical
S7-400
A
S7 connection
(two-sided)
I
CPU
S7-400 1
CPU
Local ID
2
MPI=2
I N
MPI=3
D MPI=2
MPI=2
N -Physical
connection, e.g. MPI
A
SFB:
I 1
SFBs
R - USEND - URCV
- USEND
IT
- URCV
- BSEND - BRCV
- BRCV - BSEND
S
Page 25 © Siemens INDIA (I-CS-VS-TRG). All Rights Reserved.
D I A
SFB Communication: BSEND (SFB 12) Block
STL Representation
- I N LAD Representation
A I N
With an example for the parameter assignment
//With Instance DB EN
DB 12 (Instance DB)
SFB 12 (BSEND)
ENO
R
REQ DONE
REQ:= I 0.4 //Start R
IT
ERROR
R:= I 0.5 //Reset BSEND ID STATUS
R_ID
S
ID:=W#16#3 //S7 Connection
SD_1
R_ID:=DW#16#B2 //Block pair
LEN
DONE:= #DONE_F //Successful end
ERROR:= #ERROR_F //End with error
STATUS:= #STATUS_W //Additional info
SD_1:=P#DB1.DBX0.0 BYTE 40000 //Send data
LEN:= #DB_LEN //Length of data
13
SFB Communication: BRCV (SFB 13) Block
A
DB 13 (Instance DB)
STL Representation
With an example for the parameter assignment
D I
LAD Representation
- I N EN
EN_R
ID
SFB 13 (BRCV)
ENO
NDR
N
ERROR
I
R_ID:=DW#16#B2 //Block pair R_ID STATUS
NDR:= #NDR_F //Receive new data
RD_1
ERROR:= #ERROR_F
R A
STATUS:= #STATUS_W
//End with error
//Additional info
LEN
S
Page 27
IT
RD_1:=P#DB2.DBX0.0 BYTE 40000 //Rec. mail box
LEN:= #DB_LEN //Rec. mail box length
D I A
- I N
A I N
IT R
S
14