Vous êtes sur la page 1sur 47

Cover Sheet

Communication between WinAC MP


and a SIMATIC S7
Application for the PUT and GET Function Blocks of
the S7 Communication
Application Description y September 2009

Applications & Tools


Answers for industry.

Industry Automation and Drive Technologies Service & Support Portal


This document is from the Internet service portal of Siemens AG, Industry
Automation and Drive Technologies. The link below takes you directly to the
download page of this document.
http://support.automation.siemens.com/WW/view/en/38066687
0

For questions about this document please use the following e-mail address:
online-support.automation@siemens.com

Copyright Siemens AG 2009 All rights reserved

Application for the "PUT" and "GET" Function Blocks of the S7 Communication
V1.0, ID Number: 38066687

Copyright Siemens AG 2009 All rights reserved

SIMATIC
Application for the "PUT" and
"GET" Function Blocks of the
S7 Communication

Automation Problem

Automation Solution

Basics

Functional Mechanisms
of this Application

Configuring

Installing

Commissioning the
Application

Operating the Application

References

9
10

History

Application for the "PUT" and "GET" Function Blocks of the S7 Communication
V1.0, ID Number: 38066687

Warranty and liability

Warranty and liability


Note

The application examples are not binding and do not claim to be complete
regarding the circuits shown, equipping and any eventuality. The application
examples do not represent customer-specific solutions. They are only intended
to provide support for typical applications. You are responsible for ensuring that
the described products are correctly used. These application examples do not
relieve you of the responsibility of safely and professionally using, installing,
operating and servicing equipment. When using these application examples, you
recognize that we cannot be made liable for any damage/claims beyond the
liability clause described. We reserve the right to make changes to these
application examples at any time without prior notice. If there are any deviations
between the recommendations provided in these application examples and other
Siemens publications e.g. Catalogs then the contents of the other documents
have priority.

We do not accept any liability for the information contained in this document.

Copyright Siemens AG 2009 All rights reserved

Any claims against us based on whatever legal reason resulting from the use of
the examples, information, programs, engineering and performance data etc.
described in this application example shall be excluded. Such an exclusion shall
not apply in the case of mandatory liability, e.g. under the German Product Liability
Act (Produkthaftungsgesetz), in case of intent, gross negligence, or injury of life,
body or health, guarantee for the quality of a product, fraudulent concealment of a
deficiency or breach of a condition which goes to the root of the contract
(wesentliche Vertragspflichten). However, claims arising from a breach of a
condition which goes to the root of the contract shall be limited to the foreseeable
damage which is intrinsic to the contract, unless caused by intent or gross
negligence or based on mandatory liability for injury of life, body or health. The
above provisions do not imply a change in the burden of proof to your detriment.
It is not permissible to transfer or copy these application examples or excerpts of
them without first having prior authorization from Siemens Industry Sector in
writing.

Application for the "PUT" and "GET" Function Blocks of the S7 Communication
V1.0, ID Number: 38066687

Table of Contents

Table of Contents
Warranty and liability................................................................................................... 4
2

Table of Contents......................................................................................................... 5
3

Automation Problem ......................................................................................... 7

1.1
5

Automation Solution ......................................................................................... 8

2.1

Overall solution overview .................................................................. 8

2.2

Description of the core functionality ................................................... 10

2.3

Hardware and software components used......................................... 12

2.4

Performance data............................................................................... 13

2.5
2.5.1
2.5.2
2.5.3

Alternative solutions ........................................................................... 13


Alternative solution for the MP 377 12 Touch Multi Panel................ 13
Alternative solution for the S7-300 station ......................................... 14
Alternative solution to S7 communication with the PUT / GET services14

Basics ............................................................................................................... 15

3.1
1

Copyright Siemens AG 2009 All rights reserved

Overview .............................................................................................. 7

S7 communication basics .................................................................. 15


8

Functional Mechanisms of this Application ................................................. 16

4.1
4.1.1
4.1.2
4.1.3
4.1.4
4.1.5
4.1.6
1

FB4 GET_PUT................................................................................. 18
Overview of input and output parameters .......................................... 18
Sequence ........................................................................................... 19
Connection ID..................................................................................... 19
Control and sequence of the write and read services........................ 20
Source and destination address of the write and read services ........ 22
Error analysis of the SFB14 GET and SFB15 PUT system function
blocks ................................................................................................. 23
8

Configuring ...................................................................................................... 25

5.1
2

Configuring the S7 connection for WinAC MP ................................... 25


9

Installing ........................................................................................................... 28

6.1

Installing the hardware ....................................................................... 28

6.2

Installing the software......................................................................... 31

6.3

Installing the application software ...................................................... 31

Commissioning the Application..................................................................... 32

7.1

Preparing............................................................................................ 32

7.2
7.2.1
7.2.2
7.2.3
7.2.4

Commissioning the MP377 12 Touch Multi Panel............................ 32


Downloading the hardware configuration........................................... 32
Downloading the S7 connection......................................................... 34
Parameterizing FB4 GET_PUT and downloading the user program34
Downloading WinCC flexible Runtime ............................................... 35

7.3
7.3.1
7.3.2

Commissioning the S7-300 station .................................................... 37


Downloading the hardware configuration........................................... 37
Downloading S7 connection and user program ................................. 38

Operating the Application............................................................................... 39

8.1
4

Overview ............................................................................................ 39

Application for the "PUT" and "GET" Function Blocks of the S7 Communication
V1.0, ID Number: 38066687

Table of Contents
8.2

Controlling the input parameters via WinCC flexible Runtime ........... 39

8.3

Controlling the input parameters in STEP 7 using the variable table 43

9.1
4

10

References ....................................................................................................... 46

Internet links ....................................................................................... 46


1

History............................................................................................................... 47
1

Copyright Siemens AG 2009 All rights reserved

Application for the "PUT" and "GET" Function Blocks of the S7 Communication
V1.0, ID Number: 38066687

Automation Problem
1.1 Overview

Automation Problem
1.1

Overview

Introduction
The exchange of small data volumes between an S7-300 station and the WinAC
MP software PLC via Industrial Ethernet is realized with little configuration and
programming overhead.
Overview of the automation problem
The figure below provides an overview of the automation problem.
Figure 1-1

Copyright Siemens AG 2009 All rights reserved

S7 station A (server)

Transfer of small data


volumes based on
S7 communication

S7 station B (client)

Industrial Ethernet

Description of and requirements for the automation problem


Based on S7 communication, this application is to be able to exchange small data
volumes between two S7 stations via an interface that is easy to parameterize and
control. Data exchange via Industrial Ethernet is initiated cyclically or
process-controlled from the client.
One of the two S7 stations (S7 station B) acts as a client. The client actively
establishes the communication connection to transfer the data.
The second S7 station (S7 station A) acts as a server. The server is passively
involved in establishing the connection.
The configuration of the communication connections and the call of necessary
communication function blocks or system function blocks are performed only in the
client. This ensures that there is little configuration and programming overhead for
the user.

Application for the "PUT" and "GET" Function Blocks of the S7 Communication
V1.0, ID Number: 38066687

Automation Solution
2.1 Overall solution overview

Automation Solution
2.1

Overall solution overview

Diagrammatic representation
The following figure schematically shows the most important components of the
solution:
Figure 2-2
Server

Client
MP377 12Touch

S7-300 with CP343-1

Copyright Siemens AG 2009 All rights reserved

S7 com

munica
tion

- PUT / GET
- WinCC flexible
Runtime

IP address: 192.168.0.19
Passive connection
establishment
Industrial Ethernet

IP address: 192.168.0.18
Active connection
establishment

Configuration
The small data volumes with max. 160 bytes are transferred between two S7
stations, for example using an S7-300 station with Industrial Ethernet CP and
MP377 Multi Panel. In this application, the following hardware components are
connected to each other using Industrial Ethernet cables:

MP377 12 Touch Multi Panel with installed WinAC MP 377 software PLC

S7-300 station with CP343-1

The MP377 12 Touch Multi Panel is located in the same IP subnet as the S7-300
station with CP 343-1.
The FB4 GET_PUT function block is called in the user program of the WinAC MP
software PLC. This function block encapsulates the SFB14 GET and SFB15
PUT system function block calls for the data transfer and provides the user with a
simple interface. Thus, S7 communication with the PUT and GET services is used
for the data exchange between the WinAC MP software PLC and the S7-300
station.
The WinAC MP software PLC acts as a client for the S7 communication. The
connection configuration and the realization of the PUT and GET services are
performed in the client that actively establishes the communication connection.
The S7-300 station acts as a server for the S7 communication, i.e. it is passively
involved in establishing the connection. In the S7-300 station, a connection
configuration and a call of communication function blocks or system function blocks
are not necessary to realize write and read services.
In addition, the send and receive data of the Win AC MP software PLC is visualized
in WinCC flexible Runtime on the MP377 Multi Panel.

Application for the "PUT" and "GET" Function Blocks of the S7 Communication
V1.0, ID Number: 38066687

Automation Solution
2.1 Overall solution overview
Scope
This application does not include a description of the configuration in
WinCC flexible.
It is assumed that the reader has basic knowledge of this field.
The WinCC flexible 2008 manual can be downloaded from the Internet (see \7\).
Required knowledge
It is assumed that the reader has basic knowledge of handling WinCC flexible
Runtime and the WinAC MP software PLC.
The WinCC flexible 2008 Runtime manual can be downloaded from the Internet
(see \8\).

Copyright Siemens AG 2009 All rights reserved

The WinCC MP 2008 software PLC manual can be downloaded from the Internet
(see \4\).

Application for the "PUT" and "GET" Function Blocks of the S7 Communication
V1.0, ID Number: 38066687

Automation Solution
2.2 Description of the core functionality

2.2

Description of the core functionality

Overview and description of the user interface

Copyright Siemens AG 2009 All rights reserved

Figure 2-3

The send and receive data of the WinAC MP software PLC is visualized in WinCC
flexible Runtime.
The send data that is written from WinAC MP to the S7-300 station via Industrial
Ethernet is stored in the DB100 data block.
The receive data that is read from the S7-300 station by WinAC MP via Industrial
Ethernet is stored in the DB200 data block.
The unidirectional write and read services are controlled in WinCC flexible Runtime
using the following switches and buttons:

M10.0 and M11.0 to enable the unidirectional write and read services

M10.1 and M11.1 for cyclic data transfer

M20.1 and M20.2 for single data transfer

Sequence of the core functionality


Table 2-1
No.

10

Action

Note

1.

Set the M10.0 and M11.0 switches


to enable to enable the unidirectional
write and read services.

When the switches are in the enable


position, they are displayed in green.

2.

Set the M10.1 and M11.1 switches


to enable to cyclically write the data to
the S7-300 or read the data from the
S7-300 station.

When the switches are in the enable


position, they are displayed in green.

Application for the "PUT" and "GET" Function Blocks of the S7 Communication
V1.0, ID Number: 38066687

Automation Solution
2.2 Description of the core functionality
No.
3.

Action
Click on the M20.1 or M20.2 button
to write the data once to the S7-300
station or to read the data once from
the S7-300.

Note
The M20.1 and M20.2 buttons can
be used only when the M10.1 and
M11.1 switches are in the disable
position.
When the switches are in the disable
position, they are displayed in red.

Advantages of this solution


Multi Panels have an operating system that is designed for embedded, does not
require much main memory and meets real-time and deterministic requirements.

Their rugged construction and compact design makes Multi Panels suitable for
use in harsh industrial environments.

WinAC MP is the economical solution for small and medium-sized applications


and automation problems.

Copyright Siemens AG 2009 All rights reserved

Concerning communication, there is only little configuration and programming


overhead for the user, since:

the S7 connection has to be configured only in the WinAC MP software PLC.

the communication functions for the unidirectional write and read services are
called only in the user program of the WinAC MP software PLC.

the FB4 GET_PUT function block encapsulates all system function block calls
for executing the unidirectional write and read services and thus provides an
interface that is easy to paramaterize and control.

Since there is little configuration and programming overhead with regard to


communication, the user saves time and costs.
Advantages of S7 communication
The Internet service portal of Siemens AG, Industry Automation and Drive
Technologies, provides information on the properties, advantages and
characteristic features of the S7 protocol (see \11\).

Application for the "PUT" and "GET" Function Blocks of the S7 Communication
V1.0, ID Number: 38066687

11

Automation Solution
2.3 Hardware and software components used

2.3

Hardware and software components used


The application was created using the following components:

Hardware components
Table 2-2
Component

No.

MLFB/order number

Note

MP 377 12 Touch

6AV6644-0AA01-2AX0

CPU315-2DP

6ES7315-2AG10-0AB0

FW V2.6

CP343-1

6GK7343-1EX21-0XE0

FW V1.3.3

Standard software components


Table 2-3

Copyright Siemens AG 2009 All rights reserved

Component

No.

MLFB/order number

WinAC MP 2008
(V4.1.1)

6ES7671-7EG01-0YA0

WinCC flexible 2008


SP1 STANDARD

6AV6612-0AA51-3CA5

WinCC flexible
Runtime 2008 SP1

6AV6613-1BA51-3CA0

STEP 7 V5.4 SP4

6ES7810-4CC08-0YA5

Note

SP4 or higher

Sample files and projects


The following list contains all files and projects that are used in this example.
Table 2-4
Component

12

Note

38066687_WinAC_MP.zip

This zip file contains


the STEP 7 project for
configuring the S7-300 and the
WinAC MP software PLC.

38066687_PUT_GET_WinAC_MP_v10_e.pdf

This document describes the


functionality and the
startup of the STEP 7
project.

Application for the "PUT" and "GET" Function Blocks of the S7 Communication
V1.0, ID Number: 38066687

Automation Solution
2.4 Performance data

2.4

Performance data

Hardware
The SFBs/FBs for the following S7 communication services must not exceed a
specific user data length:

PUT / GET

BSEND / BRCV

USEND / URCV

The maximum user data length depends on

the used block type and

communication partner.

The guaranteed user data length for an SFB/FB is listed in the table below:
Table 2-5

Copyright Siemens AG 2009 All rights reserved

FB/SFB

Partner: S7-300

Partner: S7-400 or
WinAC MP

PUT / GET

160 bytes

400 bytes

USEND / URCV

160 bytes

440 bytes

BSEND / BRCV

32 Kbytes

64 Kbytes

Please note the user data size restrictions in the technical data of the respective
CPU.
Application software
In this example, max. 160 bytes of user data are transferred since an S7-300 is
used as a communication partner of the WinAC MP software PLC. These bytes are
transferred consistently.

2.5

Alternative solutions

2.5.1

Alternative solution for the MP 377 12 Touch Multi Panel


The WinAC MP software PLC is released for the following multi panels:
Table 2-6
Operator panel
MP 177 6 Touch

Order number
6AV6 642-0EA01-3AX0

MP 277 8 Touch

6AV6 643-0CB01-1AX1

MP 277 8 Key

6AV6 643-0DB01-1AX1

MP 277 10 Touch

6AV6 643-0CD01-1AX1

MP 277 10 Key

6AV6 643-0DD01-1AX1

MP 377 12 Touch

6AV6 644-0AA01-2AX0

MP 377 12 Key

6AV6 644-0BA01-2AX0

MP 377 15 Touch

6AV6 644-0AB01-2AX0

MP 377 19 Touch

6AV6 644-0AC01-2AX0

You can use these multi panels (see table 2-6) instead of the MP 377 12 Touch
Multi Panel.
4

Application for the "PUT" and "GET" Function Blocks of the S7 Communication
V1.0, ID Number: 38066687

13

Automation Solution
2.5 Alternative solutions

2.5.2

Alternative solution for the S7-300 station


To connect the S7-300 station to the Industrial Ethernet network, you can use one
of the following communications processors (CP):

CP343-1 Lean,

CP343-1 Standard or

CP343-1 IT / Advanced

Instead of a CP, you can also use a CPU with integrated PROFINET interface:

CPU 315-2 PN/DP / CPU 315F-2 PN/DP

CPU 317-2 PN/DP / CPU 317F-2 PN/DP

CPU 319-3 PN/DP / CPU 319F-3 PN/DP

S7-400 as an alternative to S7-300


Instead of an S7-300 station, you can use an S7-400 station:

Copyright Siemens AG 2009 All rights reserved

To connect the S7-400 station to the Industrial Ethernet network, you can use one
of the following communications processors (CP):

CP443-1 Standard or

CP443-1 IT / Advanced

Instead of a CP, you can also use a CPU with integrated PROFINET interface:

CPU 414-3 PN/DP

CPU 416-3 PN/DP / CPU 416F-3 PN/DP

Multi panel as an alternative to S7-300


Instead of an S7-300 station, you can use an multi panel with the WinAC MP 2008
software PLC (see table 2-6).
4

2.5.3

Alternative solution to S7 communication with the PUT / GET services


Table 2-7 shows an overview of communication options you can use as an
alternative to S7 communication with the PUT and GET services.
5

Table 2-7
Protocol

14

Communication
block

Configuration
overhead

Transferable data
volume

S7 communication

PUT / GET

Low

Small data volumes

S7 communication

BSEND/BRCV

High

Large data volumes

S7 communication

USEND/RECV

High

Small data volumes

Open TCP/IP
communication

AG_SEND /
AG_RECV

High

Medium data
volumes

Open TCP/IP
communication

T blocks

High

Medium data
volumes

PROFINET CBA

Low

Medium
data volume

Application for the "PUT" and "GET" Function Blocks of the S7 Communication
V1.0, ID Number: 38066687

Basics
3.1 S7 communication basics

Basics
3.1

S7 communication basics
Among other things, the Communication with SIMATIC S7 manual describes the
S7 communication basics.
The manual can be downloaded from the Internet (see \6\).
The System Software for S7-300/400 System and Standard Functions manual
provides information on the system function blocks, e.g. SFB14 GET and SFB15
PUT, and on S7 communication.

Copyright Siemens AG 2009 All rights reserved

The manual can be downloaded from the Internet (see \5\).

Application for the "PUT" and "GET" Function Blocks of the S7 Communication
V1.0, ID Number: 38066687

15

Functional Mechanisms of this Application


3.1 S7 communication basics

Functional Mechanisms of this


Application
General view
Figure 4-4

Server
S7-300 with CP343-1

WinAC MP 377
Client
WinCC flexible Runtime
MP377 12Touch

S7 connection

FB4
GET_PUT
IP address: 192.168.0.19
Passive connection
establishment

Copyright Siemens AG 2009 All rights reserved

SIMATIC Field PG

Industrial Ethernet

IP address: 192.168.0.18
Active connection
establishment

STEP 7
WinCC flexible
IP address: 192.168.0.100

Data exchange between the WinAC MP software PLC and the S7-300 station
takes place via a onesided configured S7 connection with connection ID 1.
The configuration of the S7 connection and the call of the SFB14 GET and
SFB15 PUT system function blocks for reading and writing the data are
performed in the WinAC MP software PLC. The software PLC actively establishes
the S7 connection.
The S7-300 station is passively involved in establishing the connection. Only data
blocks in which the send and receive data is stored are required in the S7-300
station.
Program overview
Figure 4-5
S7-300 station

WinAC MP software PLC


OB1

Send data

DB4

Receive data

FB4
DB100

Read data (32 words)

SFB14
GET

DB200

S7 connection
Receive data
words)
ata (32
Write d

DB200

16

SFB15
PUT

Send data

DB100

Application for the "PUT" and "GET" Function Blocks of the S7 Communication
V1.0, ID Number: 38066687

Functional Mechanisms of this Application


3.1 S7 communication basics
FB4 GET_PUT is called in the user program of the WinAC MP software PLC.
Internally, this function block calls the SFB14 GET and SFB15 PUT system
function blocks. The data is then read from the S7-300 station or written to the
S7-300 station.
The data transfer with FB4 GET_PUT is performed word by word. The maximum
number of data to be read or written is 80 words (=160 bytes).
In this application example, 32 words are read cyclically from DB100 of the S7-300
station. The start address is word 0 in DB100.
The read data is stored in DB200 of WinAC MP. The start address is word 0 in
DB200.
In this application example, 32 words are cyclically written to DB200 of the S7-300
station. The start address is word 0 in DB200.
The data that is written to the S7-300 is stored in DB100 of WinAC MP. The start
address is word 0 in DB100.
User program of the WinAC MP software PLC
The user program of the WinAC MP software PLC consists of the following blocks:
Table 4-8

Copyright Siemens AG 2009 All rights reserved

Block

Symbolic name

Description

OB1

CYCL_EXC

The FB4 GET_PUT function block including


the DB4 instance data block is called cyclically in
OB1.

FB4

GET_PUT

Internally, FB4 calls the SFB14 GET and


SFB15 PUT system function blocks.
Thus, the unidirectional PUT and GET write
and read services for exchanging small data
volumes are implemented together in one
function block.

DB4

iDB_GET_PUT

The static variables of FB4 are stored in the DB4


instance data block.

SFB14

GET

Using the SFB14 GET system function block,


the WinAC MP software PLC reads out the data
from DB100 of the S7-300. The read data is
stored in DB200 of WinAC MP.

SFB15

PUT

Using the SFB15 PUT system function block,


the WinAC MP software PLC writes the data to
DB200 of the S7-300. The data that is written to
the S7-300 is stored in DB100 of WinAC MP.

DB100

DB_send_data

The send data is stored in DB100.

DB200

DB_receive_data

The receive data is stored in DB200.

User program of the S7 station


The S7-300 user program consists of the following data blocks in which the send
and receive data is stored:
Table 4-9
Block

Symbolic name

Description

DB100

DB_send_data

The send data is stored in DB100.

DB200

DB_receive_data

The receive data is stored in DB200.

Application for the "PUT" and "GET" Function Blocks of the S7 Communication
V1.0, ID Number: 38066687

17

Functional Mechanisms of this Application


4.1 FB4 GET_PUT

4.1

FB4 GET_PUT

4.1.1

Overview of input and output parameters


FB4 GET_PUT has the following input and output parameters:
Figure 4-6

DB4
FB4

Copyright Siemens AG 2009 All rights reserved

INT
BOOL
BOOL
INT
INT
INT
INT
INT
BOOL
BOOL
INT
INT
INT
INT
INT
BOOL
BOOL

18

EN
Verbindung_ID
Start_lesen_GET
GET_zyklisch
Q_GET_DB_Nr
Q_GET_DB_AB_DW
Q_GET_DW_Anzahl
Z_GET_DB_Nr
Z_GET_DB_AB_DW
Start_schreiben_PUT
PUT_zyklisch
Q_PUT_DB_Nr
Q_PUT_DB_AB_DW
Q_PUT_DW_Anzahl
Z_PUT_DB_Nr
Z_PUT_DB_AB_DW
GET_Start_1x
PUT_Start_1x
I_ERROR_GET
I_STATUS_GET
I_ERROR_PUT
I_STATUS_PUT

INT
INT
INT
INT

Application for the "PUT" and "GET" Function Blocks of the S7 Communication
V1.0, ID Number: 38066687

Functional Mechanisms of this Application


4.1 FB4 GET_PUT

4.1.2

Sequence
Figure 4-7
Start_lesen_GET = true

Yes No

GET_Zyklisch = true or
GET_Start_1x = true

Enable of the SFB14 GET function

Yes No

Read data (max. 80 words)


Error analysis and

Copyright Siemens AG 2009 All rights reserved

reset of GET_Start_1x input


parameter

Start_lesen_PUT = true

Yes No

PUT_Zyklisch = true or
PUT_Start_1x = true

Enable of the SFB15 PUT function

Yes No

Write data (max. 80 words)


Error analysis and
reset of PUT_Start_1x input
parameter

4.1.3

Connection ID
On the following input parameter, enter the ID of the configured S7 connection via
which the data exchange takes place. The unidirectional PUT and GET write
and read services are realized together over one S7 connection.

Table 4-10
Input parameter
Verbindung_ID

Description
For the ID of the S7 connection,
please refer to the connection table
in NetPro.

Value
1 to 4095 (dec)
Here: 1

Application for the "PUT" and "GET" Function Blocks of the S7 Communication
V1.0, ID Number: 38066687

19

Functional Mechanisms of this Application


4.1 FB4 GET_PUT

4.1.4

Control and sequence of the write and read services

Input parameters
The SFB14 GET and SFB15 PUT system function blocks for reading and writing
the data are controlled via the following input parameters of FB4 GET_PUT:
Table 4-11
Input parameter

Description

Value

Enable of the SFB14 GET system


function block for reading the data

false = no enable
true = enable

GET_Zyklisch

Data is read cyclically

false = cyclic reading not active


true = cyclic reading active

GET_Start_1x

Data is read once

false = single reading of data not


active
true = single reading of data active

Start_schreiben_PUT

Enable of the SFB15 PUT system


function block for writing the data

false = no enable
true = enable

PUT_zyklisch

Data is written cyclically

false = cyclic writing not active


true = cyclic writing active

PUT_Start_1x

Data is written once

false = single writing of data not active


true = single writing of data active

Copyright Siemens AG 2009 All rights reserved

Start_lesen_GET

20

Application for the "PUT" and "GET" Function Blocks of the S7 Communication
V1.0, ID Number: 38066687

Functional Mechanisms of this Application


4.1 FB4 GET_PUT
In this application example, the following binary variables are assigned to the input
parameters:
Table 4-12
Input parameter

Data area

Data type

Variable

Symbolic name

Start_lesen_GET

Flag

BOOL

M10.0

Enable_GET

Start_lesen_PUT

Flag

BOOL

M11.0

Enable_PUT

GET_Zyklisch

Flag

BOOL

M10.1

GET_cyclic

PUT_Zyklisch

Flag

BOOL

M11.1

PUT_cyclic

GET_Start_1x

Flag

BOOL

M20.1

GET_once

PUT_Start_1x

Flag

BOOL

M20.2

PUT_once

After the SFB14 GET and SFB15 PUT system function blocks have been
enabled, the data can be written or read cyclically or once.
Cyclic reading of the data

Copyright Siemens AG 2009 All rights reserved

To read the data cyclically, enable the SFB14 GET system function block by
setting the Start_lesen_GET input parameter = true. In addition, set the
GET_Zyklisch input parameter = true.
Thus the receive job is executed cyclically, i.e. as soon as the receive job has been
completed successfully or with an error, another receive job is executed in the next
block cycle.
Data transfer is performed cyclically until one of the input parameters is reset.
Cyclic writing of the data
To write the data cyclically, enable the SFB15 PUT system function block by
setting the Start_lesen_PUT input parameter = true. In addition, set the
PUT_Zyklisch input parameter = true.
Thus the send job is executed cyclically, i.e. as soon as the send job has been
completed successfully or with an error, another send job is executed in the next
block cycle.
Data transfer is performed cyclically until one of the input parameters is reset.
Single reading of the data
To read the data once, set the Start_lesen_GET and GET_Start_1x input
parameters to true. The SFB14 GET system function block is enabled and a
receive job is executed.
As soon as the receive job has been completed successfully or with an error, the
GET_Start_1x input parameter is reset in FB4 GET_PUT. The system function
block is no longer enabled in the next block cycle and no further receive job is
executed, i.e. the receive job is executed exactly once.

Application for the "PUT" and "GET" Function Blocks of the S7 Communication
V1.0, ID Number: 38066687

21

Functional Mechanisms of this Application


4.1 FB4 GET_PUT
Single writing of the data
To write the data once, set the Start_lesen_PUT and PUT_Start_1x input
parameters to true. The SFB15 PUT system function block is enabled and a
send job is executed.
As soon as the send job has been completed successfully or with an error, the
PUT_Start_1x input parameter is reset in FB4 GET_PUT. The system function
block is no longer enabled in the next block cycle and no further send job is
executed, i.e. the send job is executed exactly once.

4.1.5

Source and destination address of the write and read services

Input parameters
On the following input parameters, enter the source and destination address for the
SFB14 GET and SFB15 PUT system function blocks.
The source and destination address are used to define the data blocks and the
start address in the actual data block from which the data is to be read or to which
the data is to be written and to specify the number of user data to be transferred.
Table 4-13

Copyright Siemens AG 2009 All rights reserved

Input parameter

Description

Value

Q_GET_DB_Nr

Number of the source data block for the SFB14


GET system function block, i.e.
the data block in the communication partner of
WinAC MP from which the data is read
(send data of the communication partner,
here: S7-300)

Here: 100

Q_GET_DB_AB_AW

Start address in the source data block. Start at this


address to read the data.

0 to max. DB size
number of user data
Here: 0

Q_GET_DW_Anzahl

Number of data words that are read from the


source data block

0 to 80 (dec)
Here: 32

Z_GET_DB_Nr

Number of the destination data block for the


SFB14 GET system function block, i.e.
the data block in WinAC MP in which the read data
is stored
(receive data of WinAC MP)

Here: 200

Z_GET_DB_AB_AW

Start address in the destination data block. Start at


this address to store the read data.

0 to max. DB size
number of user data
Here: 0

Q_PUT_DB_Nr

Number of the source data block for the SFB15


PUT system function block, i.e.
the data block in WinAC MP in which the data that
is written is stored
(send data of WinAC MP)

Here: 100:

Q_PUT_DB_AB_AW

Start address in the source data block. Start at this


address to write the data.

0 to max. DB size
number of user data
Here: 0

22

Application for the "PUT" and "GET" Function Blocks of the S7 Communication
V1.0, ID Number: 38066687

Functional Mechanisms of this Application


4.1 FB4 GET_PUT
Input parameter

Value

Q_PUT_DW_Anzahl

Number of data words that are written from the


source data block

0 to 80 (dec)
Here: 32

Z_PUT_DB_Nr

Number of the destination data block for the SFB


15 PUT system function block, i.e.
the data block in the communication partner of
WinAC MP in which the written data is stored
(receive data of the communication partner, here:
S7-300)

Here: 200

Z_PUT_DB_AB_AW

Start address in the destination data block. Start at


this address to store the written data.

0 to max. DB size
number of user data
Here: 0

Note

4.1.6
Copyright Siemens AG 2009 All rights reserved

Description

For the maximum DB size and the permitted number band, please refer to the
specifications of the CPU or WinAC MP you are using.

Error analysis of the SFB14 GET and SFB15 PUT system function
blocks

Output parameters
Table 4-14
Output parameter

Description

Value

I_ERROR_GET

Error while reading the data with the SFB14 GET


system function

0 = communication OK,
data is being
successfully read
<>0 error while reading
data with SFB14 GET

I_STATUS_GET

Status of the SFB14 GET system function

See STEP 7 online help


for SFB14 GET

I_ERROR_PUT

Error while writing the data with the SFB15 PUT


system function

0 = communication OK,
data is being
successfully written
<>0 error while writing
data with SFB15 PUT

I_STATUS_PUT

Status of the SFB15 PUT system function

See STEP 7 online help


for SFB15 PUT

Application for the "PUT" and "GET" Function Blocks of the S7 Communication
V1.0, ID Number: 38066687

23

Functional Mechanisms of this Application


4.1 FB4 GET_PUT
In this application example, the values of the output parameters are stored in the
following variables:
Table 4-15
Output parameter

Data area

Data type

Variable

Symbolic name

I_ERROR_GET

Flag

INT

MW100

ERROR_GET

I_ERROR_PUT

Flag

INT

MW102

ERROR_PUT

I_STATUS_GET

Flag

INT

MW200

STATUS_GET

I_STATUS_PUT

Flag

INT

MW202

STATUS_PUT

Diagnostics of the SFB14 GET system function block


When the data is successfully received, the status of the I_STATUS_GET output
parameter changes between the following values:
0 (dec) communication OK and
25 (dec) communication has been initiated. The job is being processed.
The I_ERROR_GET output parameter has the value 0.

Copyright Siemens AG 2009 All rights reserved

If an error occurs when reading the data, the status of the SFB14 GET system
function block is stored in the I_ERROR_GET and I_STATUS_GET output
parameters.
Diagnostics of the SFB15 PUT system function block
When the data is successfully written, the status of the I_STATUS_PUT output
parameter changes between the following values:
0 (dec) communication OK and
25 (dec) communication has been initiated. The job is being processed.
The I_ERROR_PUT output parameter has the value 0.
If an error occurs when writing the data, the status of the SFB15 PUT system
function block is stored in the I_ERROR_PUT and I_STATUS_PUT output
parameters.

24

Application for the "PUT" and "GET" Function Blocks of the S7 Communication
V1.0, ID Number: 38066687

Configuring
5.1 Configuring the S7 connection for WinAC MP

Configuring
5.1

Configuring the S7 connection for WinAC MP


In this application example, an unspecified S7 connection is configured for the
software PLC.
The unspecified S7 connection is configured only unilaterally in the WinAC MP
software PLC. No connection configuration is necessary in the S7-300 station.
When configuring the unspecified S7 connection, follow the instructions below:

Table 5-16
No.
1.

Action

Remark

In the SIMATIC Manager, open


NetPro using the Options
Configure Network menu or by
selecting the Configure
Network button.

Copyright Siemens AG 2009 All rights reserved

Configure Network

2.

In the MP377 12Touch HMI


station, select the WinAC
MP377 object. Use the Insert
New Connection menu to
insert a new connection.
The Insert New Connection
dialog box opens.

Application for the "PUT" and "GET" Function Blocks of the S7 Communication
V1.0, ID Number: 38066687

25

Configuring
5.1 Configuring the S7 connection for WinAC MP

Copyright Siemens AG 2009 All rights reserved

No.

Action

Remark

3.

In Connection Partner, select


Unspecified. Select the
S7 connection type. Then click
on the Apply button.
The Properties dialog box of the
S7 connection opens.

4.

Activate the Establish an active


connection function and enter
the IP address of the S7-300 for
the partner: 192.168.0.19.
Then click on the
Address Details... button.
The Address Details dialog
box opens.

5.

As a partner slot, enter the slot


of the S7-300 CPU. The slot of
the S7-300 CPU is 2.
The partners connection
resource is 3 since the S7
connection is unspecified and
oneside configured in the
WinAC MP software PLC.
This results in the following
partner TSAP: 03.02.
Confirm the entry with OK.

26

slot of the S7-300 CPU

Application for the "PUT" and "GET" Function Blocks of the S7 Communication
V1.0, ID Number: 38066687

Configuring
5.1 Configuring the S7 connection for WinAC MP
No.

Remark

Close the Properties


S7 connection dialog box and
the Insert New Connection
dialog box with OK.
In the MP377 12Touch HMI
station, select the
WinAC MP377 object.
The connection table shows the
S7 connection you have just
configured.

Copyright Siemens AG 2009 All rights reserved

6.

Action

Application for the "PUT" and "GET" Function Blocks of the S7 Communication
V1.0, ID Number: 38066687

27

Installing
6.1 Installing the hardware

Installing
6.1

Installing the hardware


The figure below shows the hardware configuration of the application.
Figure 6-8
MP 377 12 Touch
S7-300 with CP343-1

SCALANCE X208
192.168.0.18

192.168.0.19

192.168.0.30

SIMATIC Field PG

Copyright Siemens AG 2009 All rights reserved

192.168.0.100

The following table gives you an overview of the IP addresses used:


Table 6-17
Device

IP address

Subnet mask

SIMATIC Field PG

192.168.0.100

255.255.255.0

MP 377 12 Touch

192.168.0.18

255.255.255.0

CP343-1

192.168.0.19

255.255.255.0

SCALANCE 208

192.168.0.30

255.255.255.0

The descriptions, manuals and delivery information included in the delivery of the
respective products must be observed in any case.

Note

Installing the MP377 12 Touch operator panel


When installing the MP 377 12 Touch Multi Panel, the following activities have to
be performed:

Setting the IP address on the MP 377 12 Touch

Transferring the WinAC MP V4.1.1 option to the MP 377 12 Touch Multi


Panel to install the WinAC MP377 software PLC

When installing the MP 377 12 Touch, follow the instructions below:

28

Application for the "PUT" and "GET" Function Blocks of the S7 Communication
V1.0, ID Number: 38066687

Installing
6.1 Installing the hardware
Table 6-18

Copyright Siemens AG 2009 All rights reserved

No.

Action

1.

Set the IP address 192.168.0.18 and the


subnet mask 255.255.255.0 on the MP 377
12 Touch Multi Panel in Control Panel
Network and Dial-up Connections
ERTEC400.

2.

Open the SIMATIC ProSave tool on


SIMATIC Field PG in the Windows Start
menu SIMATIC ProSave.
Select the MP 377 12 Touch device type in
the General tab.
Select Ethernet for connection and enter the
IP address 162.168.0.18 of the
MP 377 12 Touch.

3.

In ProSave, go to the Options tab.


Click on the Device status button to establish
a connection to the MP 377 12 Touch Multi
Panel.
As soon as the connection to the MP377 12
Touch Multi Panel has been established, you
see the options that have already been
installed on the multi panel.

4.

Select the WinAC MP V4.1.1 option and


transfer it to the MP 377 12 Touch multi
panel.

Application for the "PUT" and "GET" Function Blocks of the S7 Communication
V1.0, ID Number: 38066687

Remark / picture

29

Installing
6.1 Installing the hardware
The WinAC MP manual provides information on setting up WinAC MP for your
application. Please also note the information regarding the STEP 7 configuration
and the communication options and the information on controlling a process with
WinAC MP.

Note

The WinAC MP manual can be downloaded from the Internet (see \4\).

Installing the S7-300 station


Assign the IP address to the CP343-1 according to the configuration (see
table 6-17).
5

To do this, open the SIMATIC Manager by selecting the Windows Start menu
SIMATIC SIMATIC Manager.
In the SIMATIC Manager, use the PLC Edit Ethernet Node menu to assign
IP address 192.168.0.19 and subnet mask 255.255.255.0 to the CP343-1.

Copyright Siemens AG 2009 All rights reserved

Figure 6-9

30

Application for the "PUT" and "GET" Function Blocks of the S7 Communication
V1.0, ID Number: 38066687

Installing
6.2 Installing the software

6.2

Installing the software


To be able to operate WinAC MP on the multi panel, the installation sequence
shown below is mandatory on the configuration computer, i.e. on the SIMATIC
Field PG.

6.3

Install STEP 7 V5.4 SP4 or higher.

Install WinCC flexible 2008 SP1.

Install WinAC MP 2008.

Installing the application software


The application software is a STEP 7 project that contains the complete hardware
configuration of the MP 377 12 Touch Multi Panel and of the S7-300 station.
In addition to the hardware configuration of the MP 377 12 Touch and the S7-300
station, the WinCC flexible project for the MP 377 12 Touch operator panel and
the S7 program for the S7-300 and WinAC MP are integrated in the STEP 7
project.

Copyright Siemens AG 2009 All rights reserved

The S7 connection between the MP 377 12 Touch and the S7-300 station is
configured in NetPro.
The STEP 7 project can be downloaded from the Internet as a ZIP file.
Extract the 38066687_WinAC_MP.zip file to a separate directory. The STEP 7
project is then automatically extracted with all associated subdirectories.
Subsequently, you can open and edit the extracted STEP 7 project with the
SIMATIC Manager.

Application for the "PUT" and "GET" Function Blocks of the S7 Communication
V1.0, ID Number: 38066687

31

Commissioning the Application


7.1 Preparing

Commissioning the Application


7.1

Preparing
Assign the IP address to the network card of the SIMATIC Field PG according to
the configuration (see table 6-17).
5

In Windows Network Connections, select the Properties dialog box of the


Local Area Network (LAN).
Enter IP address 192.168.0.100 and subnet mask 255.255.255.0.

Copyright Siemens AG 2009 All rights reserved

Figure 7-10

7.2

Commissioning the MP377 12 Touch Multi Panel

7.2.1

Downloading the hardware configuration


In the hardware configuration of the MP 377 12 Touch Multi Panel, enter the IP
address that has already been set on the panel for the Industrial Ethernet interface
(see chapter 6.1 Installing the hardware).
1

Open the Properties dialog box of the Industrial Ethernet interface. Click on the
Properties button.

32

Application for the "PUT" and "GET" Function Blocks of the S7 Communication
V1.0, ID Number: 38066687

Commissioning the Application


7.2 Commissioning the MP377 12 Touch Multi Panel

Copyright Siemens AG 2009 All rights reserved

Figure 7-11

In the Properties Ethernet interface ind. Ethernet Parameters tab, enter the
IP address and the subnet mask you have already set on the multi panel.
Figure 7-12

Subsequently, save and compile the hardware configuration of the MP377 12


Touch Multi Panel and download it to the WinAC MP software PLC.

Application for the "PUT" and "GET" Function Blocks of the S7 Communication
V1.0, ID Number: 38066687

33

Commissioning the Application


7.2 Commissioning the MP377 12 Touch Multi Panel

7.2.2

Downloading the S7 connection


When downloading the S7 connection, follow the instructions below:

Table 7-19

Copyright Siemens AG 2009 All rights reserved

No.

Action

Note

1.

In the SIMATIC Manager, open


NetPro using the Options
Configure Network menu or by
selecting the Configure Network
button.

2.

In the MP377 12Touch HMI station,


select the WinAC MP377 object.
The connection list shows the
configured S7 connection.

3.

Select the MP377 12Touch HMI


station. Subsequently, save and
compile the configuration and
download it to the MP377 12 Touch
Multi Panel.
Save and compile

7.2.3

Download

Parameterizing FB4 GET_PUT and downloading the user program


In the user program of the WinAC MP software PLC, call the FB4 GET_PUT
function block in OB1.
On its input parameters, specify the ID of the configured S7 connection, the
number of the source and destination data block for the SFB14 GET and SFB15
PUT system function blocks, the start address in the source and destination data
block and the number of user data to be transferred.

34

Application for the "PUT" and "GET" Function Blocks of the S7 Communication
V1.0, ID Number: 38066687

Commissioning the Application


7.2 Commissioning the MP377 12 Touch Multi Panel
Figure 7-13
// ID of the S7 connection
// Enable SFB14 GET
// Cyclic reading
// Source DB in communication partner for SFB14 GET
// Start address in source DB
// Number of data words to be read
// Destination DB in WinAC MP for SFB14 GET
// Start address in destination DB
// Enable SFB15 PUT
// Cyclic writting
// Source DB in WinAC MP for SFB15 PUT
// Start address in sourc DB
// Number of data words to be written
// Destination DB in communication partner for SFB15 PUT
// Start address in destination DB
// Error SFB14 GET
// Status SFB14 GET
// Error SFB15 PUT
// Status SFB15 PUT
// Single reading
// Single writting

Copyright Siemens AG 2009 All rights reserved

After parameterizing FB4 GET_PUT, download the user program to the


WinAC MP software PLC.

7.2.4

Downloading WinCC flexible Runtime


When downloading WinCC flexible Runtime to the MP377 12 Touch Multi Panel,
follow the instructions below:

Table 7-20
No.
1.

Action

Note

In the SIMATIC Manager under


the MP377 12Touch HMI
station object, right-click on the
WinCC flexible RT item and
select the Open Object menu.
The WinCC flexible project of the
MP377 12 Touch opens.

Application for the "PUT" and "GET" Function Blocks of the S7 Communication
V1.0, ID Number: 38066687

35

Commissioning the Application


7.2 Commissioning the MP377 12 Touch Multi Panel
No.
2.

Action

Note

In WinCC flexible, click on the


Define Transfer Settings and
Start Transfer button.
The Select devices for transfer
dialog box opens.

Define Transfer Settings and


Start Transfer

Select Ethernet mode and


enter the IP address
192.168.0.18 of the MP 377 12
Touch.
Click on the Transfer button to
transfer WinCC flexible Runtime
to the MP377 12 Touch.

Copyright Siemens AG 2009 All rights reserved

3.

36

Application for the "PUT" and "GET" Function Blocks of the S7 Communication
V1.0, ID Number: 38066687

Commissioning the Application


7.3 Commissioning the S7-300 station

7.3

Commissioning the S7-300 station

7.3.1

Downloading the hardware configuration


In the hardware configuration of the S7-300 station, enter the already assigned
IP address for the CP343-1 (see chapter 6.1 Installing the hardware).
5

Open the Properties dialog box of the CP343-1. Click on the Properties button.

Copyright Siemens AG 2009 All rights reserved

Figure 7-14

In the Properties CP343-1 dialog box Parameters tab, enter the IP address
and the subnet mask you have already assigned to the CP343-1 and confirm the
entry with OK.
Figure 7-15

Application for the "PUT" and "GET" Function Blocks of the S7 Communication
V1.0, ID Number: 38066687

37

Commissioning the Application


7.3 Commissioning the S7-300 station
Subsequently, save and compile the hardware configuration of the S7-300 station
and download it to your S7 CPU.

7.3.2

Downloading S7 connection and user program


In this application example, the S7 connection is configured onesided in the WinAC
MP software PLC. Therefore the S7 connection only has to be downloaded to the
WinAC MP software PLC.

Copyright Siemens AG 2009 All rights reserved

Download the user program to the S7-300 CPU.

38

Application for the "PUT" and "GET" Function Blocks of the S7 Communication
V1.0, ID Number: 38066687

Operating the Application


8.1 Overview

Operating the Application


8.1

Overview
The input parameters of the FB4 GET_PUT function block are controlled via
variables. You can set or reset the variables in WinCC flexible Runtime or in STEP
7 using the variable table.
Figure 8-16
MP377 12 Touch
S7-300 with CP343-1

SCALANCE X208
WinCC flexible Runtime

Copyright Siemens AG 2009 All rights reserved

SIMATIC Field PG
STEP 7
(Variable table)

8.2

Controlling the input parameters via WinCC flexible


Runtime
The figure below shows the user interface in WinCC flexible Runtime on the
MP377 12 Touch Multi Panel.
Figure 8-17

Enable of the system functions to write


or read the data

Cyclic reading or
writing of the data

Single reading or writing of


the data

Application for the "PUT" and "GET" Function Blocks of the S7 Communication
V1.0, ID Number: 38066687

39

Operating the Application


8.2 Controlling the input parameters via WinCC flexible Runtime
The binary variables that are used in the WinAC MP user program to control the
input parameters of FB4 GET_PUT (see table 4-12) are set or reset in WinCC
flexible Runtime using switches and buttons.
Thus you can enable the SFB14 GET and SFB15 PUT system function blocks
to write and read the data cyclically or once.
5

The table below provides an overview of the switches and buttons in WinCC
flexible Runtime and the assigned binary variables and of the meaning of the
switch positions.
Table 8-21
Switch /
Button
M10.0

Switch position

M10.0

M11.0

M11.0

M10.1
Copyright Siemens AG 2009 All rights reserved

Variable

M10.1

M11.1

M11.1

M20.1

M20.1

M20.2

M20.2

Color

Meaning

enable

green

The unidirectional GET read service


is enabled.

disable

red

The unidirectional GET read service


is disabled.

enable

green

The unidirectional PUT write


service is enabled.

disable

red

The unidirectional PUT write


service is disabled.

enable

green

Cyclic reading of data is enabled

disable

red

Cyclic reading of data is disabled

enable

green

Cyclic writing of data is enabled

disable

red

Cyclic writing of data is disabled

green

Single reading of data

gray

Single reading of data not active

green

Single writing of data

gray

Single writing of data not active

Click the M20.1 and M20.2 buttons to read or wite the data once. These buttons
can only be operated when cyclic reading or writing of the data is disabled. This
means that if the data is to be written or read once, the M10.1 or M11.1 switch
must be set to disable.
Cyclic reading of the data
Table 8-22
No.
1.

40

Action
Set the M10.0 switch to the enable position:

Result

The M10.0 switch is displayed in green.


The M10.0 variable has the value true.
The SFB14 GET system function block
is enabled.

Application for the "PUT" and "GET" Function Blocks of the S7 Communication
V1.0, ID Number: 38066687

Operating the Application


8.2 Controlling the input parameters via WinCC flexible Runtime
No.
2.

Action
Set the M10.1 switch to the enable position:

Result

3.

Set the M10.0 or M10.1 switch to disable


to stop the data transfer.

The M10.1 switch is displayed in green.


The M10.1 variable has the value true.
The data is read cyclically and stored in
DB200 of the WinAC MP software PLC.
You can monitor the receive data values,
word 0 to 32 of DB200, in the WinCC
flexible Runtime user interface.
The M10.0 or M10.1 switches are
displayed in red.
The M10.0 or M10.1 variables have the
value false.
The SFB14 GET system function block
is not enabled or cyclic data transfer is not
active.

Cyclic writing of the data


Table 8-23

Copyright Siemens AG 2009 All rights reserved

No.

Action

Result

1.

Set the M11.0 switch to the enable position:

The M11.0 switch is displayed in green.


The M11.0 variable has the value true.
The SFB15 PUT system function block
is enabled.

2.

Set the M11.1 switch to the enable position:

The M11.1 switch is displayed in green.


The M11.1 variable has the value true.
The data is written cyclically. The data
that is written cyclically is stored in DB100
of the WinAC MP software PLC.
You can monitor the send data values,
word 0 to 32 of DB100, in the WinCC
flexible Runtime user interface.

3.

Set the M11.0 or M11.1 switch to disable


to stop the data transfer.

The M11.0 or M11.1 switches are


displayed in red.
The M11.0 or M11.1 variables have the
value false.
The SFB15 PUT system function block
is not enabled or cyclic data transfer is not
active.

Application for the "PUT" and "GET" Function Blocks of the S7 Communication
V1.0, ID Number: 38066687

41

Operating the Application


8.2 Controlling the input parameters via WinCC flexible Runtime

Single reading of the data


Table 8-24
No.

Action

Result

1.

Set the M10.0 switch to the enable position:

The M10.0 switch is displayed in green.


The M10.0 variable has the value true.
The SFB14 GET system function block
is enabled.

2.

Set the M10.1 switch to the disable


position:

The M10.1 switch is displayed in red.


The M10.1 variable has the value false.
Cyclic data transfer is not active.

3.

Click the M20.1 button to read the data once.

A receive job is executed.


While the receive job is active, the
M20.1 button is displayed in green and
the M20.1 variable has the value true.
As soon as the receive job has been
completed successfully or with an error,
the M20.1 button is displayed in gray
and the M20.1 variable has the value
false.
The data that has been read once is
stored in DB200 of the WinAC MP
software PLC.
You can monitor the receive data values,
word 0 to 32 of DB200, in the WinCC
flexible Runtime user interface.

Copyright Siemens AG 2009 All rights reserved

4.

Click the M20.1 button again to execute


another receive job.

Single writing of the data


Table 8-25
No.

Action

Result

1.

Set the M11.0 switch to the enable position:

The M11.0 switch is displayed in green.


The M11.0 variable has the value true.
The SFB15 PUT system function block
is enabled.

2.

Set the M11.1 switch to the disable


position:

The M11.1 switch is displayed in red.


The M11.1 variable has the value false.
Cyclic data transfer is not active.

42

Application for the "PUT" and "GET" Function Blocks of the S7 Communication
V1.0, ID Number: 38066687

Operating the Application


8.3 Controlling the input parameters in STEP 7 using the variable table
No.
3.

Action
Click the M20.2 button to write the data once.

Result

4.

Copyright Siemens AG 2009 All rights reserved

8.3

A send job is executed.


While the send job is active, the M20.2
button is displayed in green and the
M20.2 variable has the value true.
As soon as the send job has been
completed successfully or with an error,
the M20.2 button is displayed in gray
and the M20.2 variable has the value
false.
The data that is written once is stored in
DB100 of the WinAC MP software PLC.
You can monitor the send data values,
word 0 to 32 of DB200, in the WinCC
flexible Runtime user interface.

Click the M20.2 button again to execute


another send job.

Controlling the input parameters in STEP 7 using the


variable table
Figure 8-18

In the variable table of the WinAC MP software PLC user program, you can set and
reset the binary variables to control the input parameters of FB4 GET_PUT, set
values for the send data in DB100 and monitor the receive data in DB200.

Application for the "PUT" and "GET" Function Blocks of the S7 Communication
V1.0, ID Number: 38066687

43

Operating the Application


8.3 Controlling the input parameters in STEP 7 using the variable table
Cyclic reading of the data
Table 8-26
No.

Action

Result

1.

In the user program of the WinAC MP software


PLC, open the variable table.

2.

Set the M10.0 variable to true.

The SFB14 GET system function block is


enabled.

3.

Set the M10.1 variable to true.

The data is read cyclically and stored in


DB200 of the WinAC MP software PLC.
You can monitor the receive data values, word
0 to 32 of DB200, in the variable table.

4.

Reset the M10.0 or M10.1 variable to


false to stop the data transfer.

The SFB14 GET system function block is not


enabled or cyclic data transfer is not active.

Cyclic writing of the data


Table 8-27

Copyright Siemens AG 2009 All rights reserved

No.

Action

Result

1.

In the WinAC MP user program, open the


variable table.

2.

Set the M11.0 variable to true.

The SFB15 PUT system function block is


enabled.

3.

Set the M11.1 variable to true.

The data is written cyclically. The data that is


written cyclically is stored in DB100 of the
WinAC MP software PLC.
In the variable table, you can set values for the
send data, word 0 to 32 of DB100.

4.

Reset the M11.0 or M11.1 variable to


false to stop the data transfer.

The SFB15 PUT system function block is not


enabled or cyclic data transfer is not active.

Single reading of the data


Table 8-28
No.

Action

Result

1.

In the WinAC MP user program, open the


variable table.

2.

Set the M10.0 variable to true.

The SFB14 GET system function block is


enabled.

3.

Set the M10.1 variable to false.

Cyclic data transfer is not active.

44

Application for the "PUT" and "GET" Function Blocks of the S7 Communication
V1.0, ID Number: 38066687

Operating the Application


8.3 Controlling the input parameters in STEP 7 using the variable table
No.
4.

Action
Set the M20.1 variable to true.

Result

5.

A receive job is executed.


While the receive job is active, the
M20.1 variable has the value true.
As soon as the receive job has been
completed successfully or with an error,
the M20.1 variable is reset to false.
The data that has been read once is
stored in DB200 of the WinAC MP
software PLC.
You can monitor the receive data values,
word 0 to 32 of DB200, in the variable
table.

Once again, set the M20.1 variable to true


to execute another receive job.

Single writing of the data


Table 8-29

Copyright Siemens AG 2009 All rights reserved

No.

Action

Result

1.

In the WinAC MP user program, open the


variable table.

2.

Set the M11.0 variable to true.

The SFB15 PUT system function block is


enabled.

3.

Set the M11.1 variable to false.

Cyclic data transfer is not active.

4.

Set the M20.2 variable to true.

5.

A send job is executed.


While the send job is active, the M20.2
variable has the value true.
As soon as the send job has been
completed successfully or with an error,
the M20.2 variable is reset to false.
The data that is written once is stored in
DB100 of the WinAC MP software PLC.
In the variable table, you can set values
for the send data, word 0 to 32 of DB100.

Once again, set the M20.2 variable to true


to execute another send job.

Application for the "PUT" and "GET" Function Blocks of the S7 Communication
V1.0, ID Number: 38066687

45

References

References
9.1

Internet links
This list is by no means complete and only provides a selection of useful
information.
Table 9-30
Topic
\1\

\2\

Title

Manual:
S7-300 CPUs
V2.6

S7-300, CPU 31xC and CPU 31x: Specifications Firmware


V2.6
http://support.automation.siemens.com/WW/view/en/36305149

Manual:
S7-300 CPUs

SIMATIC S7-300 CPU 31xC and CPU 31x:


Technical Specifications
http://support.automation.siemens.com/WW/view/en/12996906

\3\

Manual:
S7-400 CPUs

\4\

Manual:
WinAC MP

SIMATIC S7-400 S7-400 Automation System,


CPU Specifications
http://support.automation.siemens.com/WW/view/en/23904550

Copyright Siemens AG 2009 All rights reserved

\5\

SIMATIC WinAC MP 2008


http://support.automation.siemens.com/WW/view/en/26729818
5

System Software for S7-300/400 System and


Standard Functions
http://support.automation.siemens.com/WW/view/en/1214574

PUT / GET

\6\
\7\

SIMATIC S7
communication

Communication with SIMATIC S7


http://support.automation.siemens.com/WW/view/en/20982954

WinCC flexible
2008

SIMATIC HMI WinCC flexible 2008 WinCC flexible 2008


Compact/ Standard/ Advanced
http://support.automation.siemens.com/WW/view/en/18796010
6

\8\

WinCC flexible
2008 Runtime

SIMATIC HMI WinCC flexible 2008 WinCC flexible 2008


Runtime
http://support.automation.siemens.com/WW/view/en/18795593
6

\9\
\10\
\11\

WinCC flexible
communication
6

WinCC flexible
communication
6

SIMATIC HMI WinCC flexible 2008 Communication Part 1


http://support.automation.siemens.com/WW/view/en/18797552

S7
communication

SIMATIC HMI WinCC flexible 2008 Communication Part 2


http://support.automation.siemens.com/WW/view/en/18797249
What properties, advantages and special features does the S7
protocol offer?
http://support.automation.siemens.com/WW/view/en/26483647
6

\12\

46

Siemens I IA/DT
Customer
Support

http://support.automation.siemens.com/
6

Application for the "PUT" and "GET" Function Blocks of the S7 Communication
V1.0, ID Number: 38066687

History

10

History
Table 10-31
Version

09/23/09

Modification
First edition

Copyright Siemens AG 2009 All rights reserved

V1.0

Date

Application for the "PUT" and "GET" Function Blocks of the S7 Communication
V1.0, ID Number: 38066687

47

Vous aimerez peut-être aussi