You are on page 1of 57

Application for Communication

Serial Communication with ET 200S 1SI Module via


PROFIBUS/PROFINET CP


Application with Code





Warranty, Liability and Support
ET200S 1SI module via CP Entry ID: 26263724


Version - 1.0 Issued Oct16th 2007
2/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c




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 to use sound practices in application, installation,
operation and maintenance. By using these application examples you accept
that Siemens is not liable for any damages except for those specified in the
above liability clause. 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 the contents of the other documents have priority.


Warranty, Liability and Support
ET200S 1SI module via CP Entry ID: 26263724


Version - 1.0 Issued Oct16th 2007
3/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c



Warranty, Liability and Support

We accept no liability for information contained in this document.
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.
Copyright 2007 Siemens A&D. It is not permissible to transfer or copy these
Application Examples or excerpts of them without first having prior
authorization from Siemens A&D in writing.
For questions about this document please use the following
e-mail-address:
mailto:csweb@ad.siemens.de


Foreword
ET200S 1SI module via CP Entry ID: 26263724


Version - 1.0 Issued Oct16th 2007
4/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c



Foreword
Objective of this application
The standard blocks for the serial interface module of the ET 200S (1SI module)
only enable a communication with SIMATIC S7-300 via the integrated PROFIBUS
and PROFINET interfaces of the S7-CPUs. Operation via respective
communication processors (CP as DP master or PN controller) can only be
managed by the customer after substantial programming works. To fill this gap new
communication blocks have been developed.
Main contents of this application
This application contains
A description of the new blocks in the library
S_SEND_CP V1.0 (FB13)
S_RCV_CP V1.0 (FB12)
Two examples which show the blocks in practice
connection of a barcode scanner
bi-directional communication between two ET 200 1SI modules
Delimitation
This application does not contain a description of
the SIMATIC STEP 7 engineering tool
serial communication in general
PROFIBUS DP or PROFINET IO
the mechanisms of the used communication protocols
Basic knowledge of these topics is required.


Foreword
ET200S 1SI module via CP Entry ID: 26263724


Version - 1.0 Issued Oct16th 2007
5/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c



Structure of the document
The documentation of this application is divided into the following main parts.
Part Description
Application Description Provides a general overview of the contents. You will
learn about the components used (standard hardware
and software components and the specially created
software).
Function Principles and
Program Structures
This part describes the detailed function processes of the
involved hardware and software components, the
solution structures and where useful the specific
implementation of this application. This part is necessary
if you want to learn about the interaction of the solution
components, for example in order to use them as the
basis for own development.
Structure, Configuration and
Operation of the Application
This part leads you step by step through the structure,
important configuration steps, commissioning and
operation of the application.
Appendix This section of the documentation includes further
information,
e.g. bibliographic references


Reference to Automation and Drives Service & Support
This entry originates from the internet application portal of the A&D Service and
Support. The following link takes you directly to the download page of this
document.
http://support.automation.siemens.com/WW/view/en/26263724

Foreword
ET200S 1SI module via CP Entry ID: 26263724


Version - 1.0 Issued Oct16th 2007
6/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c



Table of Contents
Table of Contents ................................................................................................ 6
Application Description............................................................................................... 9
1 Automation Task .................................................................................. 9
2 Automation Solution ........................................................................... 11
2.1 Overview of the overall solution ......................................................... 11
2.2 Description of the Automation Task ................................................... 12
2.3 Required hardware and software components .................................. 13
2.3.1 Hardware components ....................................................................... 13
2.3.2 Software components......................................................................... 15
2.4 Alternative solutions ........................................................................... 16
2.4.1 Blocks................................................................................................. 16
2.4.2 Interfacing for ET 200S ...................................................................... 16
2.4.3 Interfacing the serial devices.............................................................. 16
Function Principles and Program Structures ......................................................... 17
3 Explanations on the library................................................................. 17
3.1 Differences to the 1SI standard blocks .............................................. 17
3.2 New blocks in the ET 200S SI library................................................. 18
3.3 Call parameters of the blocks............................................................. 19
3.3.1 S_RCV_CP (FB12) ............................................................................ 19
3.3.2 S_SEND_CP (FB13) .......................................................................... 21
3.3.3 S_VSTAT_CP (FB14) ........................................................................ 22
3.3.4 S_VSET_CP (FB15)........................................................................... 25
3.3.5 S_XON_CP (FB16) ............................................................................ 27
3.3.6 S_RTS_CP (FB17)............................................................................. 29
3.3.7 S_V24_CP (FB18).............................................................................. 31
3.4 Error recognition of the blocks ........................................................... 33
4 Function Mechanisms of this Application........................................... 34
4.1 Basic principle of the data flow........................................................... 34
4.2 Program example 1 Barcode scanner............................................. 36
4.3 Program example 2 two 1SI modules ............................................. 40
Structure, Configuration and Operation of the Application .................................. 45
5 Installation and Commissioning ......................................................... 45
5.1 Installation of Hardware and Software ............................................... 45
5.1.1 Installation of the hardware................................................................ 45
5.1.2 Installation of the standard software .................................................. 46
5.1.3 Installation of the application software ............................................... 46
5.2 Wiring the serial interfaces................................................................. 47
6 Configuration Process........................................................................ 49
6.1 Assigning IP addresses...................................................................... 49
6.2 Configuration of the S7-300 central control station............................ 49
6.3 Configuration of the ET 200S stations ............................................... 50
6.4 Configuration of the Hawkeye HE40T scanner.................................. 52
7 Operating the Application................................................................... 53
7.1 Program example 1 Barcode scanner............................................. 53
7.1.1 Variable table ..................................................................................... 53
7.1.2 Data Matrix Codes.............................................................................. 53
7.2 Program example 2 two 1SI modules ............................................. 54

Foreword
ET200S 1SI module via CP Entry ID: 26263724


Version - 1.0 Issued Oct16th 2007
7/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c



7.2.1 Variable table ..................................................................................... 54
7.3 Restrictions......................................................................................... 55
Appendix and List of Further Literature.................................................................. 56
8 Literature ............................................................................................ 56
8.1 Bibliographic References ................................................................... 56
8.2 Internet links....................................................................................... 56
9 History ................................................................................................ 57
Table of Contents ................................................................................................ 6
Application Description............................................................................................... 9
1 Automation Task .................................................................................. 9
2 Automation Solution ........................................................................... 11
2.1 Overview of the overall solution ......................................................... 11
2.2 Description of the Automation Task ................................................... 12
2.3 Required hardware and software components .................................. 13
2.3.1 Hardware components ....................................................................... 13
2.3.2 Software components......................................................................... 15
2.4 Alternative solutions ........................................................................... 16
2.4.1 Blocks................................................................................................. 16
2.4.2 Interfacing for ET 200S ...................................................................... 16
2.4.3 Interfacing the serial devices.............................................................. 16
Function Principles and Program Structures ......................................................... 17
3 Explanations on the library................................................................. 17
3.1 Differences to the 1SI standard blocks .............................................. 17
3.2 New blocks in the ET 200S SI library................................................. 18
3.3 Call parameters of the blocks............................................................. 19
3.3.1 S_RCV_CP (FB12) ............................................................................ 19
3.3.2 S_SEND_CP (FB13) .......................................................................... 21
3.3.3 S_VSTAT_CP (FB14) ........................................................................ 22
3.3.4 S_VSET_CP (FB15)........................................................................... 25
3.3.5 S_XON_CP (FB16) ............................................................................ 27
3.3.6 S_RTS_CP (FB17)............................................................................. 29
3.3.7 S_V24_CP (FB18).............................................................................. 31
3.4 Error recognition of the blocks ........................................................... 33
4 Function Mechanisms of this Application........................................... 34
4.1 Basic principle of the data flow........................................................... 34
4.2 Program example 1 Barcode scanner............................................. 36
4.3 Program example 2 two 1SI modules ............................................. 40
Structure, Configuration and Operation of the Application .................................. 45
5 Installation and Commissioning ......................................................... 45
5.1 Installation of Hardware and Software ............................................... 45
5.1.1 Installation of the hardware................................................................ 45
5.1.2 Installation of the standard software .................................................. 46
5.1.3 Installation of the application software ............................................... 46
5.2 Wiring the serial interfaces................................................................. 47
6 Configuration Process........................................................................ 49
6.1 Assigning IP addresses...................................................................... 49
6.2 Configuration of the S7-300 central control station............................ 49
6.3 Configuration of the ET 200S stations ............................................... 50

Foreword
ET200S 1SI module via CP Entry ID: 26263724


Version - 1.0 Issued Oct16th 2007
8/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c



6.4 Configuration of the Hawkeye HE40T scanner.................................. 52
7 Operating the Application................................................................... 53
7.1 Program example 1 Barcode scanner............................................. 53
7.1.1 Variable table ..................................................................................... 53
7.1.2 Data Matrix Codes.............................................................................. 53
7.2 Program example 2 two 1SI modules ............................................. 54
7.2.1 Variable table ..................................................................................... 54
7.3 Restrictions......................................................................................... 55
Appendix and List of Further Literature.................................................................. 56
8 Literature ............................................................................................ 56
8.1 Bibliographic References ................................................................... 56
8.2 Internet links....................................................................................... 56
9 History ................................................................................................ 57

Application Description
Automation Task
ET200S 1SI module via CP Entry ID: 26263724


Application Description
1 Automation Task
Introduction
A number of periphery devices, such as measuring devices, barcode scanners, etc.
are still equipped with the traditional RS232 interface. In the SIMATIC environment
the most cost-efficient possibility is to connect a serial device to an S7-300 station
via a 1SI module in a ET 200S station.
Connecting the ET200 1SI module in the ET 200S station to an S7-CPU via
PROFINET or PROFIBUS is, using the standard interface block of the delivery
scope, only possible via the integrated interfaces of the S7-CPU.
The task here is connecting ET 200S stations with 1SI module via PROFIBUS or
PROFINET CPs instead of via the integrated interfaces of an S7-CPU.
Possible reasons for this are
Version - 1.0 Issued Oct16th 2007
9/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c



existing S7-CPUs with or without otherwise used PROFIBUS / PROFINET
interface
existing S7-CPUs shall be used
already existing ET 200S stations connected via CPs shall be supplemented
with 1SI modules
Schematic setup
Figure 1-1
S
7
-
C
P
U
S7-300
Station
ET200S Station
mit 1SI-Modulen
P
R
O
F
I
N
E
T

/

P
R
O
F
I
B
U
S
S
7
-
C
P
ET200S station
with 1SI modules
E
m
T200S Station
it 1SI-Modulen
serielle Gerte
serial devices
ET
wit
200S station
h 1SI modules
serielle Gerte
serial devices

Requirements
Interfacing via communication processors

Application Description
Automation Task
ET200S 1SI module via CP Entry ID: 26263724


Version - 1.0 Issued Oct16th 2007
10/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c



compatible software for PROFIBUS or PROFINET interfacing
bi-directional communication should be possible
possibly identical user interface for the communication blocks


Application Description
Automation Solution
ET200S 1SI module via CP Entry ID: 26263724


2 Automation Solution
2.1 Overview of the overall solution
Introduction
The following setups were used to show you how to deal with the new
communication bocks:
Connecting a barcode/data matrix scanner (type: HE40T) to the 1SI module
and receiving the data provided by the scanner in a data block
Connecting two 1SI modules for bi-directional data exchange between the
modules.
Display
The following graphics provide you with an overview of the automation tasks
contained in this document.
Setup with barcode / data matrix scanner
Version - 1.0 Issued Oct16th 2007
11/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c




Figure 2-1
C
P

3
4
3
-
1
C
P

3
4
2
-
5
I
M
1
5
1
-
3
1
S
I
-
M
o
d
u
l
I
M
1
5
1
-
1
1
S
I
-
M
o
d
u
l
C
P
U

3
1
5
RS232-Verbindung
S7-300
Station
PROFINET
PROFIBUS
HE40T
Scanner
ET 200S
ET 200S

RS2 n 32 Connectio

Application Description
Automation Solution
ET200S 1SI module via CP Entry ID: 26263724


Setup with two 1SI modules
Figure 2-2
Version - 1.0 Issued Oct16th 2007
12/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c



C
P

3
4
3
-
1
C
P

3
4
2
-
5
I
M
1
5
1
-
3
1
S
I
-
M
o
d
u
l
I
M
1
5
1
-
1
1
S
I
-
M
o
d
u
l
C
P
U

3
1
5
RS232-Verbindung
S7-300
Station
PROFINET
PROFIBUS
ET 200S
ET 200S

RS232 Connection
2.2 Description of the Automation Task
Program example 1 Barcode scanner
The example shows
how data can be received using the S_RCV_CP block
the handling of CP blocks required for transferring the process image from CP
to CPU
The scanner can either be connected to the ET 200S interfaced via PROFIBUS or
to the ET 200S connected via PROFINET. Details for connecting the scanner to
the terminal module of the ET 200S are discussed in chapter 5.2.
Program example 2 Two 1SI modules
The example shows
how data can be sent and received using the blocks S_SEND_CP and
S_RCV_CP.
the handling of CP blocks required for transferring the process image from CP
to CPU.
Details for wiring are discussed in chapter 5.2.

Application Description
Automation Solution
ET200S 1SI module via CP Entry ID: 26263724


Version - 1.0 Issued Oct16th 2007
13/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c



2.3 Required hardware and software components
2.3.1 Hardware components
S7-300 central control station
Table 2-1
Component Qty. MLFB / Order number Note
S7-300
Power supply
1 6ES7 307-1EA00-0AA0 or any other suitable
source
S7-300
CPU 315-2
1 6ES7 315-2AG10-0AB0 or any other
S7-300 CPU
SIMATIC S7 Memory
card 64k
1 6ES7 953-8LF11-0AA0 or larger
S7-300 CP 342-5
PROFIBUS-CP
1 6GK7 342-5DA02-0XE0
S7-300 CP 343-1
PROFINET-CP
1 6GK7 343-1EX30-0XE0
ET 200S station PROFIBUS
Table 2-2
Component Qty. MLFB / Order number Note
IM151-1 1 6ES7 151-1AA04-0AB0
Terminal module for
power module
1 6ES7 193-4CD20-0AA0
Power module 1 6ES7 138-4CA01-0AA0 DC 24V with
diagnostics
Terminal module 1 6ES7 193-4CB20-0AA0 Package content:
5 terminal modules
1SI module ASCII 1 6ES7 138-4DF01-0AB0 1 serial interface


Application Description
Automation Solution
ET200S 1SI module via CP Entry ID: 26263724


Version - 1.0 Issued Oct16th 2007
14/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c



ET 200S station PROFINET
Table 2-3
Component Qty. MLFB / Order number Note
IM151-3 1 6ES7 151-3AA20-0AB0
SIMATIC S7 Memory
card 64k
1 6ES7 953-8LF11-0AA0 or larger
Terminal module for
power module
1 6ES7 193-4CD20-0AA0
Power module 1 6ES7 138-4CA01-0AA0 DC 24V with
diagnostics
Terminal module 1 6ES7 193-4CB20-0AA0 Package content:
5 terminal modules
1SI module ASCII 1 6ES7 138-4DF01-0AB0 1 serial interface
Barcode / data matrix scanner
Table 2-4
Component Qty. MLFB / Order number Note
Hawkeye HE40T 1 6GF3020-0HT40-0XX4 or any other serial
device
Various
Furthermore you need cabling material for PROFIBUS, Ethernet, power supply
etc., as well as a ET 200S terminal module.
Alternatives for the setup of the S7-300 station
When selecting the S7-300 CPU an enable for the used communication processors
must be ensured. Restrictions and notes are available in the respective CP device
manual (e.g. \6\ and \7\).
How to adjust the configuration when using another CPU or another CP is
described in chapter 6.
Alternatives to the setup of the ET 200S stations
Most other PROFIBUS and PROFINET heads of the ET 200S system can operate
the 1SI module. Chapter 6 explains which configuration steps need to be
performed when using a different IM head.

Application Description
Automation Solution
ET200S 1SI module via CP Entry ID: 26263724


Version - 1.0 Issued Oct16th 2007
15/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c



2.3.2 Software components
Standard software components
Table 2-5
Component Qty. MLFB / Order number Note
SIMATIC STEP 7 from
version
5.4 SP 2
1 various various licensing types
possible
ET 200S 1SI standard
library
1 free download,
see \2\


The ET 200S 1SI standard library is only necessary due to the contained online
help for the 1SI blocks. Differences to the 1SI-CP blocks are marginal and are
explained in chapter 3.

Example files and projects
The following list contains all files and projects used in this example.
Table 2-6
Component Note
26263724_SI_Modul_via_CP_CODE_v10.zip Projects and library
26263724_SI_Modul_via_CP_DOKU_v10_d.pdf This document

The file 26263724_SI_Modul_via_CP_CODE_v10.zip contains the following
components:
Table 2-7
Component Note
SI_Modul_via_CP_LIB_v10.zip The 1SI module blocks
required for DP/PN-CPs.
SI_Modul_via_CP_REG_v10.zip Registry import file for
connecting the help of the 1SI
standard blocks with the new
blocks
STEP7_Barcode_HE40T_CODE_v10.zip The STEP 7 project with the
bar code scanner application.
STEP7_SI_bidirektional_CODE_v10.zip The STEP 7 project with the
1SI module communication.


Application Description
Automation Solution
ET200S 1SI module via CP Entry ID: 26263724


Version - 1.0 Issued Oct16th 2007
16/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c



2.4 Alternative solutions
2.4.1 Blocks
Alternatives to the new blocks introduce here, the S_SEND_CP and S_RCV_CP
blocks, are the own implementation of the protocol between dual port RAM of the
communication processor and the ET 200S 1SI module. A description is available
in the manual for the 1SI module (\3\) in chapter 2.12.
Advantages
none
Disadvantages
programming expenses and
extensive testing required
2.4.2 Interfacing for ET 200S
An ET 200S can also be operated at the integrated PROFIBUS and PROFINET
interfaces of an S7-CPU.
Advantages
using the 1SI standard blocks possible
simple programming due to omitting the CP blocks
2.4.3 Interfacing the serial devices
As an alternative for interfacing via 1SI modules in an ET 200 station, serial
devices can also be connected via a CP 340 / CP 341 in the central rack of an
S7-300.
Advantages
no PROFIBUS / PROFINET cabling necessary
using the 1SI standard blocks for serial CPs possible
simple programming
Disadvantages
restricted to central structure

Function Principles and Program Structures
Explanations on the library
ET200S 1SI module via CP Entry ID: 26263724


Version - 1.0 Issued Oct16th 2007
17/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c



Function Principles and Program Structures
3 Explanations on the library
The blocks contained in the 1SI standard block library are FB 2 (S_RCV) and FB 3
(S_SEND). As a delimitation to the above, the blocks developed for CPs are given
the numbers FB 12 and FB 13 as well as the names S_RCV_CP and
S_SEND_CP.
The blocks FB14 to FB18 also contained in the library are not part of the
application examples.
3.1 Differences to the 1SI standard blocks
Access to the process image
Since no direct access to the process image is possible for the application of S7-
300 CPs instead of the integrated interfaces of an S7-300 CPU, the standard
function blocks for the 1SI modules cannot be used here. Instead, the 1SI blocks
delivered with this application should be used.
Reading and writing the process image requires the respective CP blocks for the
PROFIBUS or PROFINET CPs. For CP 342-5 the blocks FC1 (DP_SEND) as well
as FC2 (DP_RECV) are required, for CP 343-1 the blocks FC11 (PNIO_SEND) as
well as FC12 (PNIO_RECV). These CP blocks are located in the block library
SIMATIC_NET_CP delivered with STEP 7.
Note
This is described in greater detail in chapter 4.
Call interface
Due to their different operating principle the new 1SI blocks for CPs do not have
the same user interface as the 1SI blocks for integrated interfaces.
the parameter LADDR does not apply
it is used to point directly to the I/O address of the ET 200S 1SI module for 1SI
standard blocks
instead there are two new parameter DP_IN and DP_OUT
these point to data areas which contain the process image of the 1SI module
which is transferred from and to the ET 200S with the CP blocks
The further parameters of the blocks are identical with the standard blocks. The
new blocks are discussed in greater detail below.

Function Principles and Program Structures
Explanations on the library
ET200S 1SI module via CP Entry ID: 26263724


Version - 1.0 Issued Oct16th 2007
18/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c



3.2 New blocks in the ET 200S SI library
Table 3-1
FB Name Meaning
FB12 S_RCV_CP Function block S_RCV_CP enables you to receive data from
a communication partner and store them in a data block.
FB13 S_SEND_CP Function block S_SEND_CP enables you to send an entire
area or partial area of a data block to a communication
partner.
FB14 S_VSTAT_CP Function block S_VSTAT_CP enables you to read the signal
status at the RS-232C interface of module ET 200S 1SI.
FB15 S_VSET_CP Function block S_VSET_CP enables you to set/reset the
outputs of the RS-232C interface of module ET 200S 1SI.
FB16 S_XON_CP Function block S_XON_CP enables you to set additional
parameter if the module for the XON/XOFF flow control has
been configured.
FB17 S_RTS_CP Function block S_RTS_CP enables you to set additional
parameter if the module for the RTS/CT flow control has been
configured.
FB18 S_V24_CP Function block S_V24_CP enables you to set additional
parameter if the module for automatic operation of V.24
signals has been configured.

Note
In this example only blocks S_SEND_CP and S_RCV_CP are used.



Function Principles and Program Structures
Explanations on the library
ET200S 1SI module via CP Entry ID: 26263724


3.3 Call parameters of the blocks
3.3.1 S_RCV_CP (FB12)
Interface of the block
Figure 3-1
S_RCV_CP
Instanz-DB
ENO
NDR
ERROR
STATUS
EN
EN_R
R
DP_IN
DP_OUT
DB_NO
DBB_NO
LEN
COM_RST

Version - 1.0 Issued Oct16th 2007
19/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c



Parameters EN and ENO only exist in the graphic display (for LAD or FBD).
Parameters of the block

Table 3-2
Name Type Data type Description Permitted assignment, Comment
EN_R INPUT BOOL Read enable for data
R INPUT BOOL Cancel job Current job is cancelled. Reception
blocked.
DP_IN INPUT ANY Input area of the CP
DP_OUT INPUT ANY Send area of the CP
DB_NO INPUT INT Data block number Receive-DB no.: CPU-specific, zero
is not permitted
DBB_NO INPUT INT Data byte number 0 DBB_NO 8190 receive data
from offset on
NDR
1)
OUTPUT BOOL Job completed without error,
data adopted
Parameter STATUS == 16#00
ERROR
1)
OUTPUT BOOL Job completed with error Parameter STATUS contains the
error information.
LEN
1)
OUTPUT INT Length of received telegram 1 LEN 200, specified in number
of bytes
STATUS
1)
OUTPUT WORD Specification of the error For ERROR == 1 the error
information is presented here.
COM_RST IN_OUT BOOL New start of the FB
1)
Parameter DONE, ERROR and STATUS are available after the send job for one CPU cycle!

Function Principles and Program Structures
Explanations on the library
ET200S 1SI module via CP Entry ID: 26263724


Code example
The following graphic illustrates an example of a block call of the FB12 S_RCV_CP
block.
Figure 3-2
CALL "S_RCV_CP" , "I_S_RCV_DPCP"
EN_R :="Parameter".S_RCV_CP_DP.EN_R
R :="Parameter".S_RCV_CP_DP.R
DP_IN :="Parameter".DP_RECV.RECV
DP_OUT :="Parameter".DP_SEND.SEND
DB_NO :="Parameter".S_RCV_CP_DP.DB_NO
DBB_NO :="Parameter".S_RCV_CP_DP.DBB_NO
NDR :="Parameter".S_RCV_CP_DP.NDR
ERROR :="Parameter".S_RCV_CP_DP.ERROR
LEN :="Parameter".S_RCV_CP_DP.LEN
STATUS :="Parameter".S_RCV_CP_DP.STATUS
COM_RST:="Parameter".S_RCV_CP_DP.COM_RST

Programming notes
The user program must be structured as follows:
Version - 1.0 Issued Oct16th 2007
20/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c



Using the communication block of the CP, the input data of the ET 200S
station are read into the user memory of the CPU via the CP (call DP_RECV or
PNIO_RECV).
Call S_RCV_CP, thereby interconnect the parameters DP_IN and DP_OUT
with the correct areas in the user memory of the CPU.
Using the communication block of the CP, the output data from the user
memory of the CPU are transferred to the ET 200S station via the CP (call
DP_SEND or PNIO_SEND).
Parameter COM_RST must be set to 1 in the startup OB (OB100) so the block can
initialize.
The examples were realized according to this scheme.
Note
This is described in greater detail in chapter 4.



Function Principles and Program Structures
Explanations on the library
ET200S 1SI module via CP Entry ID: 26263724


3.3.2 S_SEND_CP (FB13)
Interface of the block
Figure 3-3
S_SEND_CP
Instanz-DB
ENO
DONE
ERROR
STATUS
EN
REQ
R
DP_IN
DP_OUT
DB_NO
DBB_NO
LEN
COM_RST

Version - 1.0 Issued Oct16th 2007
21/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c



Parameters EN and ENO only exist in the graphic display (for LAD or FBD).
Parameters of the block

Table 3-3
Name Type Data
type
Description Permitted assignment, Comment
REQ INPUT BOOL Trigger job at positive edge
R INPUT BOOL Cancel job Current job is cancelled. Sending
blocked.
DP_IN INPUT ANY Receive area of the CP
DP_OUT INPUT ANY Send area of the CP
DB_NO INPUT INT Data block number Send-DB no.: CPU-specific, zero is
not permitted
DBB_NO INPUT INT Data byte number 0 DBB_NO 8190 send data from
offset on
LEN INPUT INT Data length 1 LEN 200, specified in number
of bytes
DONE
1)
OUTPUT BOOL Job completed without error Parameter STATUS == 16#00
ERROR
1)
OUTPUT BOOL Job completed with error Parameter STATUS contains the error
information.
STATUS
1)
OUTPUT WORD Specification of the error For ERROR == 1 the error
information is presented here.
COM_RST IN_OUT BOOL New start of the FB
1)
Parameter DONE, ERROR and STATUS are available after the send job for one CPU cycle!

Function Principles and Program Structures
Explanations on the library
ET200S 1SI module via CP Entry ID: 26263724


Code example
The following graphic illustrates an example of a block call of the FB13
S_SEND_CP block.
Figure 3-4
CALL "S_SEND_CP" , "I_S_SEND_DPCP"
REQ :="Parameter".S_SEND_CP_DP.REQ
R :="Parameter".S_SEND_CP_DP.R
DP_IN :="Parameter".DP_RECV.RECV
DP_OUT :="Parameter".DP_SEND.SEND
DB_NO :="Parameter".S_SEND_CP_DP.DB_NO
DBB_NO :="Parameter".S_SEND_CP_DP.DBB_NO
LEN :="Parameter".S_SEND_CP_DP.LEN
DONE :="Parameter".S_SEND_CP_DP.DONE
ERROR :="Parameter".S_SEND_CP_DP.ERROR
STATUS :="Parameter".S_SEND_CP_DP.STATUS
COM_RST:="Parameter".S_SEND_CP_DP.COM_RST

Programming notes
The user program must be structured as follows:
Version - 1.0 Issued Oct16th 2007
22/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c



Using the communication block of the CP, the input data of the ET 200S
station are read into the user memory of the CPU via the CP (call DP_RECV or
PNIO_RECV).
Call S_SEND_CP, thereby interconnect the parameters DP_IN and DP_OUT
with the correct areas in the user memory of the CPU.
Using the communication block of the CP, the output data from the user
memory of the CPU are transferred to the ET 200S station via the CP (call
DP_SEND or PNIO_SEND).
Parameter COM_RST must be set to 1 in the startup OB (OB100) so the block can
initialize.
The examples were realized according to this scheme.
Note
This is described in greater detail in chapter 4.
3.3.3 S_VSTAT_CP (FB14)
Interface of the block
Figure 3-5
S_VSTAT_CP
Instanz-DB
ENO
DONE
ERROR
STATUS
EN
REQ
R
DP_IN
DP_OUT DTR_OUT
DSR_IN COM_RST
RTS_OUT
CTS_IN
DCD_IN

Parameters EN and ENO only exist in the graphic display (for LAD or FBD).

Function Principles and Program Structures
Explanations on the library
ET200S 1SI module via CP Entry ID: 26263724


Version - 1.0 Issued Oct16th 2007
23/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c



Parameters of the block

Table 3-4
Name Type Data
type
Description Permitted assignment,
Comment
REQ INPUT BOOL Trigger job at positive edge
R INPUT BOOL Cancel job Current job cancelled.
DP_IN INPUT ANY Receive area of the CP
DP_OUT INPUT ANY Send area of the CP
DONE
1)
OUTPUT BOOL Job completed without error Parameter STATUS == 16#00
ERROR
1)
OUTPUT BOOL Job completed with error Parameter STATUS contains the
error information.
STATUS
1)
OUTPUT WORD Specification of the error For ERROR == 1 the error
information is given here.
DTR_OUT
1)
OUTPUT BOOL Data terminal ready,
ET 200S 1SI ready for operation.
(Output ET 200S 1SI)

DSR_IN
1)
OUTPUT BOOL Data set ready, communication
partner ready for operation.
(Input ET 200S 1SI)

RTS_OUT
1)
OUTPUT BOOL Request to send, ET 200S 1SI is
ready to send.
(Output ET 200S 1SI)

CTS_IN
1)
OUTPUT BOOL Clear to send, communication
partner can receive data from
module ET 200S 1SI (response to
RTS = ON of ET 200S 1SI)
(Input ET 200S 1SI)

DCD_IN
1)
OUTPUT BOOL Data carrier detect, receive signal
level
(Input ET 200S 1SI)

COM_RST IN_OUT BOOL New start of the FB
1)
The Output parameters are available after the send job for one CPU cycle!
Code example
The following graphic illustrates an example of a block call of the FB14
S_VSTAT_CP block.

Function Principles and Program Structures
Explanations on the library
ET200S 1SI module via CP Entry ID: 26263724


Figure 3-6
CALL "S_VSTAT_CP" , "I_S_VSTAT_DPCP"
REQ :="Parameter".S_VSTAT_CP_DP.REQ
R :="Parameter".S_VSTAT_CP_DP.R
DP_IN :="Parameter".DP_RECV.RECV
DP_OUT :="Parameter".DP_SEND.SEND
DONE :="Parameter".S_VSTAT_CP_DP.DONE
ERROR :="Parameter".S_VSTAT_CP_DP.ERROR
STATUS :="Parameter".S_VSTAT_CP_DP.STATUS
DTR_OUT:="Parameter".S_VSTAT_CP_DP.DTR_OUT
DSR_IN :="Parameter".S_VSTAT_CP_DP.DSR_IN
RTS_OUT:="Parameter".S_VSTAT_CP_DP.RTS_OUT
CTS_IN :="Parameter".S_VSTAT_CP_DP.CTS_IN
DCD_IN :="Parameter".S_VSTAT_CP_DP.DCD_IN
COM_RST:="Parameter".S_VSTAT_CP_DP.COM_RST

Programming notes
The user program must be structured as follows:
Using the communication block of the CP, the input data of the ET 200S
station are read into the user memory of the CPU via the CP (call DP_RECV or
PNIO_RECV).
Version - 1.0 Issued Oct16th 2007
24/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c



Call S_VSTAT_CP, thereby interconnect the parameters DP_IN and DP_OUT
with the correct areas in the user memory of the CPU.
Using the communication block of the CP, the output data from the user
memory of the CPU are transferred to the ET 200S station via the CP (call
DP_SEND or PNIO_SEND).
Parameter COM_RST must be set to 1 in the startup OB (OB100) so the block can
initialize.

Function Principles and Program Structures
Explanations on the library
ET200S 1SI module via CP Entry ID: 26263724


3.3.4 S_VSET_CP (FB15)
Interface of the block
Figure 3-7
S_VSET_CP
Instanz-DB
ENO
DONE
ERROR
STATUS
EN
REQ
R
DP_IN
DP_OUT
RTS
DTR
COM_RST

Parameters EN and ENO only exist in the graphic display (for LAD or FBD).
Version - 1.0 Issued Oct16th 2007
25/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c



Parameters of the block

Table 3-5
Name Type Data type Description Permitted assignment, Comment
REQ INPUT BOOL Initiates job at positive edge
R INPUT BOOL Job cancellation Current job is cancelled.
DP_IN INPUT ANY Receive area of the CP
DP_OUT INPUT ANY Send area of the CP
RTS INPUT BOOL Request to send,
ET 200S 1SI is ready to send
(Control output ET 200S 1SI)

DTR INPUT BOOL Data terminal ready,
ET 200S 1SI is ready for
operation.
(Control output ET 200S 1SI)

DONE
1)
OUTPUT BOOL Job completed without error Parameter STATUS == 16#00
ERROR
1)
OUTPUT BOOL Job completed with error Parameter STATUS contains the
error information.
STATUS
1)
OUTPUT WORD Specification of the error For ERROR == 1 the error
information is given here.
COM_RST IN_OUT BOOL New start of FB
1)
Parameter DONE, ERROR and STATUS are available after the send job for one CPU cycle!

Function Principles and Program Structures
Explanations on the library
ET200S 1SI module via CP Entry ID: 26263724


Code example
The following graphic illustrates an example of a block call of the FB15
S_VSET_CP block.
Figure 3-8
CALL "S_VSET_CP" , "I_S_VSET_DPCP"
REQ :="Parameter".S_VSET_CP_DP.REQ
R :="Parameter".S_VSET_CP_DP.R
DP_IN :="Parameter".DP_RECV.RECV
DP_OUT :="Parameter".DP_SEND.SEND
RTS :="Parameter".S_VSET_CP_DP.RTS
DTR :="Parameter".S_VSET_CP_DP.DTR
DONE :="Parameter".S_VSET_CP_DP.DONE
ERROR :="Parameter".S_VSET_CP_DP.ERROR
STATUS :="Parameter".S_VSET_CP_DP.STATUS
COM_RST:="Parameter".S_VSET_CP_DP.COM_RST

Programming notes
The user program must be structured as follows:
Version - 1.0 Issued Oct16th 2007
26/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c



Using the communication block of the CP, the input data of the ET 200S
station are read into the user memory of the CPU via the CP (call DP_RECV or
PNIO_RECV).
Calling S_VSET_CP, thereby interconnecting the parameters DP_IN and
DP_OUT with the correct areas in the user memory of the CPU.
Using the communication block of the CP, the output data from the user
memory of the CPU are transferred to the ET 200S station via the CP (call
DP_SEND or PNIO_SEND).
Parameter COM_RST must be set to 1 in the startup OB (OB100) so the block can
initialize.

Function Principles and Program Structures
Explanations on the library
ET200S 1SI module via CP Entry ID: 26263724


3.3.5 S_XON_CP (FB16)
Interface of the block
Figure 3-9
S_XON_CP
Instanz-DB
ENO
DONE
ERROR
STATUS
EN
REQ
R
DP_IN
DP_OUT
COM_RST
WAIT_FOR_XON
XOFF
XON

Parameters EN and ENO only exist in the graphic display (for LAD or FBD).
Version - 1.0 Issued Oct16th 2007
27/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c



Parameters of the block

Table 3-6
Name Type Data type Description Permitted assignment, Comment
REQ INPUT BOOL Initiates job at positive edge
R INPUT BOOL Job cancellation Current job is cancelled.
DP_IN INPUT ANY Receive area of the CP
DP_OUT INPUT ANY Send area of the CP
XON INPUT BYTE

XON character

0 to 7FH (7 Data bits)
0 bis FFH (8 Data bits)
Default: 11 (DC1)
XOFF INPUT BYTE

XOFF character

0 to 7FH (7 Data bits)
0 to FFH (8 Data bits)
Default: 13 (DC3)
WAIT_FOR_
XON
INPUT

TIME Wait time for XON
after XOFF
20 ms to 10 min 55 s 350 ms
Default 2s
DONE
1)
OUTPUT BOOL Job completed without error,
data accepted
Parameter STATUS == 16#00
ERROR
1)
OUTPUT BOOL Job completed with error Parameter STATUS contains the
error information.
STATUS
1)
OUTPUT WORD Specification of the error For ERROR == 1 the error
information is given here.
COM_RST IN_OUT BOOL New start of FB
1)
Parameter DONE, ERROR and STATUS are available after the send job for one CPU cycle!

Function Principles and Program Structures
Explanations on the library
ET200S 1SI module via CP Entry ID: 26263724


Code example
The following graphic illustrates an example of a block call of the FB16 S_XON_CP
block.
Figure 3-10
CALL "S_XON_CP" , "I_XON_DPCP"
REQ :="Parameter".S_XON_CP_DP.REQ
R :="Parameter".S_XON_CP_DP.R
DP_IN :="Parameter".DP_RECV.RECV
DP_OUT :="Parameter".DP_SEND.SEND
XON :="Parameter".S_XON_CP_DP.XON
XOFF :="Parameter".S_XON_CP_DP.XOFF
WAIT_FOR_XON:="Parameter".S_XON_CP_DP.WAIT_FOR_XON
DONE :="Parameter".S_XON_CP_DP.DONE
ERROR :="Parameter".S_XON_CP_DP.ERROR
STATUS :="Parameter".S_XON_CP_DP.STATUS
COM_RST :="Parameter".S_XON_CP_DP.COM_RST

Programming notes
The user program must be structured as follows:
Version - 1.0 Issued Oct16th 2007
28/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c



Using the communication block of the CP, the input data of the ET 200S
station are read into the user memory of the CPU via the CP (call DP_RECV or
PNIO_RECV).
Call S_XON_CP, thereby interconnect the parameters DP_IN and DP_OUT
with the correct areas in the user memory of the CPU.
Using the communication block of the CP, the output data from the user
memory of the CPU are transferred to the ET 200S station via the CP (call
DP_SEND or PNIO_SEND).
Parameter COM_RST must be set to 1 in the startup OB (OB100) so the block can
initialize.

Function Principles and Program Structures
Explanations on the library
ET200S 1SI module via CP Entry ID: 26263724


3.3.6 S_RTS_CP (FB17)
Interface of the block
Figure 3-11
S_RTS_CP
Instanz-DB
ENO
DONE
ERROR
STATUS
EN
REQ
R
DP_IN
DP_OUT
WAIT_FOR_CTS
COM_RST

Parameters EN and ENO only exist in the graphic display (for LAD or FBD).
Version - 1.0 Issued Oct16th 2007
29/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c



Parameters of the block

Table 3-7
Name Type Data type Description Permitted assignment, Comment
REQ INPUT BOOL Initiates job at positive edge
R INPUT BOOL Job cancellation Current job is cancelled.
DP_IN INPUT ANY Receive area of the CP
DP_OUT INPUT ANY Send area of the CP
WAIT_FOR_
CTS
INPUT TIME Wait time for
CTS = ON
20 ms to 10 min 55 s 350 ms
Default: 2s
DONE
1)
OUTPUT BOOL Job completed without error,
Data accepted
Parameter STATUS == 16#00
ERROR
1)
OUTPUT BOOL Job completed with error Parameter STATUS contains the
error information.
STATUS
1)
OUTPUT WORD Specification of the error For ERROR == 1 the error
information is given here.
COM_RST IN_OUT BOOL New start of FB
1)
Parameter DONE, ERROR and STATUS are available after the send job for one CPU cycle!

Function Principles and Program Structures
Explanations on the library
ET200S 1SI module via CP Entry ID: 26263724


Code example
The following graphic illustrates an example of a block call of the FB17 S_RTS_CP
block.
Figure 3-12
CALL "S_RTS_CP" , "I_S_RTS_DPCP"
REQ :="Parameter".S_RTS_CP_DP.REQ
R :="Parameter".S_RTS_CP_DP.R
DP_IN :="Parameter".DP_RECV.RECV
DP_OUT :="Parameter".DP_SEND.SEND
WAIT_FOR_CTS:="Parameter".S_RTS_CP_DP.WAIT_FOR_CTS
DONE :="Parameter".S_RTS_CP_DP.DONE
ERROR :="Parameter".S_RTS_CP_DP.ERROR
STATUS :="Parameter".S_RTS_CP_DP.STATUS
COM_RST :="Parameter".S_RTS_CP_DP.COM_RST

Programming notes
The user program must be structured as follows:
Version - 1.0 Issued Oct16th 2007
30/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c



Using the communication block of the CP, the input data of the ET 200S
station are read into the user memory of the CPU via the CP (call DP_RECV or
PNIO_RECV).
Calling S_RTS_CP, thereby interconnecting the parameters DP_IN and
DP_OUT with the correct areas in the user memory of the CPU.
Using the communication block of the CP, the output data from the user
memory of the CPU are transferred to the ET 200S station via the CP (call
DP_SEND or PNIO_SEND).
Parameter COM_RST must be set to 1 in the startup OB (OB100) so the block can
initialize.

Function Principles and Program Structures
Explanations on the library
ET200S 1SI module via CP Entry ID: 26263724


3.3.7 S_V24_CP (FB18)
Interface of the block
Figure 3-13
S_V24_CP
Instanz-DB
ENO
DONE
ERROR
STATUS
EN
REQ
R
DP_IN
DP_OUT
TIME_RTS_OFF
DATA_WAIT_TIME
COM_RST

Parameters EN and ENO only exist in the graphic display (for LAD or FBD).
Version - 1.0 Issued Oct16th 2007
31/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c



Parameters of the block

Table 3-8
Name Type Data
type
Description Permitted assignment,
Comment
REQ INPUT BOOL Initiates job at positive edge
R INPUT BOOL Job cancellation Current job is cancelled. Empfang
gesperrt.
DP_IN INPUT ANY Receive area of the CP
DP_OUT INPUT ANY Send area of the CP
TIME_RTS_OF
F
INPUT TIME

Time which must elapse before
RTS is switched off.
0 ms to 10 min 55 s 350 ms
Default: 10ms
DATA_WAIT_T
IME

INPUT TIME

Time waited for the partner to set
CTS = ON
after RTS was set.
0 ms to 10 min 55 s 350 ms
Default: 10ms
DONE
1)
OUTPUT BOOL Job completed without error, Data
accepted
Parameter STATUS == 16#00
ERROR
1)
OUTPUT BOOL Job completed with error Parameter STATUS contains the
error information.
STATUS
1)
OUTPUT WORD Specification of the error For ERROR == 1 the error
information is given here.
COM_RST IN_OUT BOOL New start of FB
1)
Parameter DONE, ERROR and STATUS are available after the send job for one CPU cycle!

Function Principles and Program Structures
Explanations on the library
ET200S 1SI module via CP Entry ID: 26263724


Code example
The following graphic illustrates an example of a block call of the FB18 S_V24_CP
block.
Figure 3-14
CALL "S_V24_CP" , "I_S_V24_DPCP"
REQ :="Parameter".S_V24_CP_DP.REQ
R :="Parameter".S_V24_CP_DP.R
DP_IN :="Parameter".DP_RECV.RECV
DP_OUT :="Parameter".DP_SEND.SEND
TIME_RTS_OFF :="Parameter".S_V24_CP_DP.TIME_RTS_OFF
DATA_WAIT_TIME:="Parameter".S_V24_CP_DP.DATA_WAIT_TIME
DONE :="Parameter".S_V24_CP_DP.DONE
ERROR :="Parameter".S_V24_CP_DP.ERROR
STATUS :="Parameter".S_V24_CP_DP.STATUS
COM_RST :="Parameter".S_V24_CP_DP.COM_RST

Programming notes
The user program must be structured as follows:
Version - 1.0 Issued Oct16th 2007
32/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c



Using the communication block of the CP, the input data of the ET 200S
station are read into the user memory of the CPU via the CP (call DP_RECV or
PNIO_RECV).
Calling S_V24_CP, thereby interconnecting the parameters DP_IN and
DP_OUT with the correct areas in the user memory of the CPU.
Using the communication block of the CP, the output data from the user
memory of the CPU are transferred to the ET 200S station via the CP (call
DP_SEND or PNIO_SEND).
Parameter COM_RST must be set to 1 in the startup OB (OB100) so the block can
initialize.



Function Principles and Program Structures
Explanations on the library
ET200S 1SI module via CP Entry ID: 26263724


Version - 1.0 Issued Oct16th 2007
33/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c



3.4 Error recognition of the blocks
Table 3-9
Error codes Explanation
1E50(h) - DP_IN does not point to PA, DB or memory bit area
- DP_OUT does not point to PA, DB or memory bit area
- Area length of DP_IN and DP_OUT unequal
- Area length of DP_IN and DP_OUT unequal 4, 8 or 32 byte
1E51(h) Error during access to the input data referenced via the DP_IN parameter at internal call
of system function SFC 20 "BLKMOV".
The error cause of "BLKMOV" is written in the statistic variable "SFCERR" of the
instance data block.
1E52(h) Error during access to the output data referenced via the DP_OUT parameter at internal
call of system function SFC 20 "BLKMOV".
The error cause of "BLKMOV" is written in the statistic variable "SFCERR" of the
instance data block.

Further error codes correspond to those of the standard blocks (respective
description in the Manual \3\ on pages 2-102 to 2-108).

Function Principles and Program Structures
Function Mechanisms of this Application
ET200S 1SI module via CP Entry ID: 26263724


4 Function Mechanisms of this Application
4.1 Basic principle of the data flow
Introduction
Communication and coordination between 1SI module and S7-CPU must be
directed via a memory block of the CP. In order to access the memory of the CP
special Send/Receive blocks are necessary. These data received by the CP are
processed by the S_SEND_CP / S_RCV_CP blocks. A description of the internal
mechanisms is available in the manual for the 1SI module (\3\) in chapter 2.12.
Schematic data flow
The following graphic illustrates various stations of usage and coordination data
from the process image of the CP.
Figure 4-1
Version - 1.0 Issued Oct16th 2007
34/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c



7
E
T
2
0
0
S
1
S
I

M
o
d
u
l
CP CPU
2
Prozeabbild der
Slaves/Devices
serielles
rtnerger Pa t
DP_RECV o.
PNIO_RECV
S_RCV_CP o.
S_SEND_CP
DP_SEND o.
PNIO_SEND
1
3
4
5
6
Nutzdatenbereich
50 Byte
Empfangsbereich
RECV 8 Byte
Sendebereich
SEND 8 Byte
Process image of
slaves/devices
Receive area
RECV 8 bytes
Abbild der ET200S
Image of ET 200S
8 Byte E/A fr 1SI
8 bytes I/O for 1SI
User data area
50 bytes
Send area
RECV 8 bytes
serial partner
device

The following table contains a closer description of the figure above.

Function Principles and Program Structures
Function Mechanisms of this Application
ET200S 1SI module via CP Entry ID: 26263724


Version - 1.0 Issued Oct16th 2007
35/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c



Process sequence
Table 4-1
No. Explanation
1 The process data of the 1SI module are fetched with the CP receive function
2 and written to a receive data area.
3 The 1SI function block fetches the process data from the receive data area and
processes it.
4 Received user data are written to a user data block or the data to be sent is
fetched from the data block
5 and new process data of the 1SI module is written to the send area of the CP
6 The CP send function fetches the process data of the 1SI module to be written
from the send area
7 to pass it to the CP.


Function Principles and Program Structures
Function Mechanisms of this Application
ET200S 1SI module via CP Entry ID: 26263724


4.2 Program example 1 Barcode scanner
Introduction
The example illustrates receiving of data of a serial barcode scanner. Data read in
via the scanner are filed in a data block and can be viewed via a variable table.
Program structure
Figure 4-2
Version - 1.0 Issued Oct16th 2007
36/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c



Instanz DB12
OB1
zyklisches
rogramm P
OB100
Neustart
FC21
Bearbeitung
PROFIBUS-CP
FC2
DP_RECV
Prozeabbild der ET 200S holen Fetch process image of ET 200S
Processing of
PROFIBUS CP
cyclical
program
Bearbeitung der ET 200S Daten
Nutzdaten in Empfangs-Datenbaustei
Koordinierungsinformationen setzen
FC22
Bearbeitung
PROFINET-CP
FB12
S_RCV_CP
n schreiben
Processing the ET 200S data
Write user data to receive data block
Set coordinating information
FC1
DP_SEND
FC12
PNIO_RECV
FC11
PNIO_RECV
FB12
S_RCV_CP
Prozeabbild der ET 200S zurckschreiben
Prozeabbild der ET 200S holen
Prozeabbild der ET 200S zurckschreiben
Bearbeitung der ET 200S Daten
Nutzdaten in Empfangs-Datenbaustei
Koordinierungsinformationen
n schreiben
setzen
Initialisierung des Bausteins
Instanz DB14
Write back process image of ET 200S
DB3
utzdaten N user data
Fetch process image of ET 200S
Processing of
PROFINET CP
Processing the ET 200S data
Write user data to receive data block
Set coordination information
Write back process image of ET 200S
New start
Initialize the block

OB1 calls the subprogram for the PROFIBUS CP. It successively calls the blocks
for reading the process image, processing this data and writing it back to the
process image.
Next, the subprogram of the PROFINET CP is run through which does the same.
The example uses both CPs, however, when using only one CP you can still
comment out the program part of the missing CP.

Function Principles and Program Structures
Function Mechanisms of this Application
ET200S 1SI module via CP Entry ID: 26263724


Version - 1.0 Issued Oct16th 2007
37/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c



Program procedure
Table 4-2
No. Action Note
1. The OB1 calls the subprogram FC21 for the 1SI
module in ET 200S PROFIBUS.
2. FC2 DP_RECV is called to fetch the process image
of the ET 200S.
3. FB12 S_RCV_CP is called.
4. FC2 DP_SEND is called to write the process image
of the ET 200S.


The user data are filed in
DB3, from byte 0 to byte
49.
5. The OB1 calls the subprogram FC22 for the 1SI
module in ET 200S PROFINET.
6. FC2 PNIO_RECV is called to fetch the process
image of the ET 200S.
7. FB12 S_RCV_CP is called.
8. FC2 PINO_SEND is called to write the process
image of the ET 200S.


The user data are filed in
DB3, from byte 50 to byte
99.
9. The program cycle start again.


Function Principles and Program Structures
Function Mechanisms of this Application
ET200S 1SI module via CP Entry ID: 26263724


Version - 1.0 Issued Oct16th 2007
38/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c



Block description
Table 4-3
Block Description
OB1 OB1 contains the cyclic user program.
OB100 OB100 is called during restart of the S7-CPU. Here the reset inputs of the
blocks are set.
FC21 Block SI_DPCP contains the program part for the PROFIBUS-CP.
FC22 Block SI_PNCP contains the program part for the PROFINET-CP.
FC1 Block DP_SEND transmits the outputs of the master to the CP to forward
them to the PROFIBUS slaves.
FC2 Block DP_RECV fetches the outputs from the slaves (inputs of the master)
from the CP.
FC11 Block PNIO_SEND transmits the outputs of the controller to the CP to
forward them to the PROFINET IO devices.
FC12 Block PNIO_RECV fetches the outputs from the PROFINET IO devices
(inputs of the controller) from the CP.
FB12 Block S_RCV_CP coordinates the protocol between S7-CPU and the 1SI
module when receiving the data.
DB1 This data block contains the program and block parameter.
DB3 This data block contains the received user data
DB12 DB12 is the instance data block for block S_RECV_CP for the program part
of the PROFIBUS CP.
DB14 DB14 is the instance data block for block S_RECV_CP for the program part
of the PROFINET CP.
Main program elements
The CP blocks and the 1SI CP blocks work together in the following way, here in
the example of PROFIBUS CP.
Note
For better understanding, here a note on block parameters: There is a DB
Parameter which contains the block parameters (again the same name as the
parameters themselves) and has a structure for each block (with identical or
similar names as the block).


Function Principles and Program Structures
Function Mechanisms of this Application
ET200S 1SI module via CP Entry ID: 26263724


Version - 1.0 Issued Oct16th 2007
39/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c



Table 4-4
Block call Function
CALL "DP_RECV"
CPLADDR :="Parameter".DP_RECV.CPLADDR
RECV :="Parameter".DP_RECV.RECV
NDR :="Parameter".DP_RECV.NDR
ERROR :="Parameter".DP_RECV.ERROR
STATUS :="Parameter".DP_RECV.STATUS
DPSTATUS:="Parameter".DP_RECV.DPSTATUS

Fetching process image
of the ET 200S
CALL "S_RCV_CP" , "I_S_RCV_DPCP"
EN_R :="Parameter".S_RCV_CP_DP.EN_R
R :="Parameter".S_RCV_CP_DP.R
DP_IN :="Parameter".DP_RECV.RECV
DP_OUT :="Parameter".DP_SEND.SEND
DB_NO :="Parameter".S_RCV_CP_DP.DB_NO
DBB_NO :="Parameter".S_RCV_CP_DP.DBB_NO
NDR :="Parameter".S_RCV_CP_DP.NDR
ERROR :="Parameter".S_RCV_CP_DP.ERROR
LEN :="Parameter".S_RCV_CP_DP.LEN
STATUS :="Parameter".S_RCV_CP_DP.STATUS
COM_RST:="Parameter".S_RCV_CP_DP.COM_RST

Processing the ET 200S
data

Writing user data to
receive DB

Setting coordination
information

CALL "DP_SEND"
CPLADDR:="Parameter".DP_SEND.CPLADDR
SEND :="Parameter".DP_SEND.SEND
DONE :="Parameter".DP_SEND.DONE
ERROR :="Parameter".DP_SEND.ERROR
STATUS :="Parameter".DP_SEND.STATUS

Writing process image
of the ET 200S

The S_RCV_CP block need not be called depending on the NDR output of
DP_RECV. Due to the coordination protocol between 1SI module and block,
S_RCV_CP realizes when new data were received immediately. Consistency is
given due to the 8 bytes I/O area.

Function Principles and Program Structures
Function Mechanisms of this Application
ET200S 1SI module via CP Entry ID: 26263724


4.3 Program example 2 two 1SI modules
Introduction
The example shows how a bi-directional communication between two 1SI modules
is realized. A data package is sent back and forth which is continuously changed
by one of the devices.
Program structure
Figure 4-3
Version - 1.0 Issued Oct16th 2007
40/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c



Instanz DB12
Instanz DB14
OB1
zykl
FC21 FC2
DP_RECV
isches
rogramm P
OB100
Neustart
Bearbeitung
PROFIBUS-CP
FB12
S_RCV_CP
FC1
DP_SEND
Prozeabbild der ET 200S holen
Prozeabbild der ET 200S
zurckschreiben
n schreiben
etzen
Bearbeitung der ET 200S Daten
Nutzdaten in Empfangs-Datenbaustei
Koordinierungsinformationen s
FC2
DP_RECV
FB13
S_SEND_CP
FC1
DP_SEND
Prozeabbild der ET2 00S holen
Prozeabbild der ET 200S zurckschreiben
earbeitung der ET 200S Daten
endedaten aus Sende-Datenbaustein holen
Koordinierungsinformationen setzen
B
S
Fetch process image of ET 200S
Processing of
PROFIBUS CP
cyclic
program
Processing the ET 200S data
Write user data to receive data block
Set coordinating information
Senden oder
Empfangen ?
Sending or
receiving ?
Initialisierung der Bausteine
FC22
Bearbeitung
PROFINET-CP
Write back process image of ET 200S
DB3
Nutzdaten user data
Fetch process image of ET 200S
Processing of
PROFINET CP
Processing the ET 200S data
W ock
Se
rite user data to receive data bl
t coordination information
Write back process image of ET 200S
New start Initialize the block

OB1 calls the subprogram for the PROFIBUS CP. After checking whether to sent
or receive it is directed to the appropriate network. It successively calls the blocks
for fetching the process image, processing this data and writing it back to the
process image.
When completing the S_SEND_CP or S_RCV_CP function (parameter DONE or
NDR) it is switched from sending to receiving.
Next, the subprogram of the PROFINET CP is run through (only indicated in the
above graphic); this process corresponds to the program part for the PROFIBUS
CP with an addition: if data were received, the first byte is incremented and copied
into the first byte of the send buffer.

Function Principles and Program Structures
Function Mechanisms of this Application
ET200S 1SI module via CP Entry ID: 26263724


Version - 1.0 Issued Oct16th 2007
41/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c



Program procedure
Table 4-5
No. Action Note
1. The OB1 calls the subprogram FC21 for the 1SI
module in ET 200S PROFIBUS.

2. After checking whether to sent or receive it is directed
to the appropriate network.
NW1: check
NW2: send
NW3: receive
3. FC2 DP_RECV is called to fetch the process image of
the ET 200S.
4. FB13 S_SEND_CP or FB12 S_RCV_CP is called.
When completing the function (parameter DONE or
NDR) it is switched from sending to receiving or from
receiving to sending respectively.
5. If data were received, the first byte of the receive buffer
is copied into the first byte of the send buffer.
6. FC2 DP_SEND is called to write the process image of
the ET 200S.


The receive data are
stored in DB3, from byte
0 to byte 49. The send
data come from DB3,
from byte 100 to byte
149.
7. The OB1 calls the subprogram FC22 for the 1SI
module in ET 200S PROFINET.

8. After checking whether to sent or receive it is directed
to the appropriate network.
NW1: check
NW2: send
NW3: receive
9. FC2 PNIO_RECV is called to fetch the process image
of the ET 200S.
10. FB13 S_SEND_CP or FB12 S_RCV_CP is called.
When completing the function (parameter DONE or
NDR) it is switched from sending to receiving or from
receiving to sending respectively.
11. If data were received, the first byte is incremented and
copied into the first byte of the send buffer.
12. FC2 PINO_SEND is called to write the process image
of the ET 200S.


The receive data are
stored in DB3, from byte
50 to byte 99. The send
data come from DB3,
from byte 150 to byte
199.
13. The program cycle start again.

Function Principles and Program Structures
Function Mechanisms of this Application
ET200S 1SI module via CP Entry ID: 26263724


Version - 1.0 Issued Oct16th 2007
42/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c



Block description
Table 4-6
Block Description
OB1 OB1 contains the cyclic user program.
OB100 OB100 is called during restart of the S7-CPU. Here the reset inputs of the
blocks are set.
FC21 Block SI_DPCP contains the program part for the PROFIBUS-CP.
FC22 Block SI_PNCP contains the program part for the PROFINET-CP.
FC1 Block DP_SEND transmits the outputs of the master to the CP to forward
them to the PROFIBUS slaves.
FC2 Block DP_RECV fetches the outputs from the slaves (inputs of the master)
from the CP.
FC11 Block PNIO_SEND transmits the outputs of the controller to the CP to
forward them to the PROFINET IO devices.
FC12 Block PNIO_RECV fetches the outputs from the PROFINET IO devices
(inputs of the controller) from the CP.
FB12 Block S_RCV_CP coordinates the protocol between S7-CPU and the 1SI
module when receiving the data.
FB13 Block S_SEND_CP coordinates the protocol between S7-CPU and the 1SI
module when sending the data.
DB1 This data block contains the program and block parameter.
DB3 This data block contains the received user data and the user data to be
sent.
DB12 DB12 is the instance data block for block S_RCV_CP for the program part
of the PROFIBUS CP.
DB13 DB13 is the instance data block for block S_SEND_CP for the program part
of the PROFIBUS CP.
DB14 DB14 is the instance data block for block S_REV_CP for the program part
of the PROFINET CP.
DB15 DB15 is the instance data block for block S_SEND_CP for the program part
of the PROFINET CP.

Main program elements
The CP blocks and the 1SI CP blocks work together in the following way, here in
the example of PROFIBUS CP.
Note
For better understanding, here a note on block parameters: There is a DB
Parameter which contains the block parameters (again the same name as the
parameters themselves) and has a structure for each block (with identical or
similar names as the block).


Function Principles and Program Structures
Function Mechanisms of this Application
ET200S 1SI module via CP Entry ID: 26263724


Version - 1.0 Issued Oct16th 2007
43/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c



Table 4-7
Block call Function
CALL "DP_RECV"
CPLADDR :="Parameter".DP_RECV.CPLADDR
RECV :="Parameter".DP_RECV.RECV
NDR :="Parameter".DP_RECV.NDR
ERROR :="Parameter".DP_RECV.ERROR
STATUS :="Parameter".DP_RECV.STATUS
DPSTATUS:="Parameter".DP_RECV.DPSTATUS

Fetching process
image of the ET 200S
U "Takt 1Hz"
= "Parameter".S_SEND_CP_DP.REQ
Generate edge
CALL "S_SEND_CP" , "I_S_SEND_DPCP"
REQ :="Parameter".S_SEND_CP_DP.REQ
R :="Parameter".S_SEND_CP_DP.R
DP_IN :="Parameter".DP_RECV.RECV
DP_OUT :="Parameter".DP_SEND.SEND
DB_NO :="Parameter".S_SEND_CP_DP.DB_NO
DBB_NO :="Parameter".S_SEND_CP_DP.DBB_NO
LEN :="Parameter".S_SEND_CP_DP.LEN
DONE :="Parameter".S_SEND_CP_DP.DONE
ERROR :="Parameter".S_SEND_CP_DP.ERROR
STATUS :="Parameter".S_SEND_CP_DP.STATUS
COM_RST:="Parameter".S_SEND_CP_DP.COM_RST

Processing the ET
200S data

Fetching user data
from send DB

Setting coordination
information

U "Parameter".S_SEND_CP_DP.DONE
R "Parameter".Settings.FLAG_DPSEND
After receiving, switch
to sending.
CALL "DP_SEND"
CPLADDR:="Parameter".DP_SEND.CPLADDR
SEND :="Parameter".DP_SEND.SEND
DONE :="Parameter".DP_SEND.DONE
ERROR :="Parameter".DP_SEND.ERROR
STATUS :="Parameter".DP_SEND.STATUS

Writing process
image of the ET 200S


Function Principles and Program Structures
Function Mechanisms of this Application
ET200S 1SI module via CP Entry ID: 26263724


Version - 1.0 Issued Oct16th 2007
44/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c



The S_SEND_CP block need not be called depending on the NDR output of
DP_RECV. Due to the coordination protocol between 1SI module and block,
S_SEND_CP realizes when new data were received immediately. Consistency is
given due to the 8 bytes I/O area.

Data to be transferred are changed with this method.
Table 4-8
Block call Note
L "Daten".received_data_via_PNCP[1]
+ 1
T "Daten".data_to_send_via_PNCP[1]
Incrementing the
received data by one
and transferring it to
send block.
L 91 // character after 'Z'
L "Daten".data_to_send_via_PNCP[1]
<>I
SPB end
Checking whether the
alphabet has already
been run through.
L 65 // character 'A'
T "Daten".data_to_send_via_PNCP[1]
If yes, then start again
with A
end: BEA


Structure, Configuration and Operation of the Application
Installation and Commissioning
ET200S 1SI module via CP Entry ID: 26263724


Version - 1.0 Issued Oct16th 2007
45/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c



Structure, Configuration and Operation of the
Application
5 Installation and Commissioning
5.1 Installation of Hardware and Software
This chapter describes which hardware and software components have to be
installed. The descriptions and manuals as well as delivery information included in
the delivery of the respective products should be observed in any case.
5.1.1 Installation of the hardware
The hardware components are available in chapter 2.3. For the hardware setup,
proceed in accordance with the table below:
Table 5-1
No. Action
1. Mount the S7-300 and ET 200S stations according the STEP 7
configuration.
2. Connect the CP 342-5 and the IM 151-1 with a PROFIBUS cable
terminated on both ends.
3. Connect the CP 343-1 and the IM 151-3 with a RJ45 cable.
4. Connect the configuration computer and the IM 151-3 with a RJ45 cable.
5. Connect the serial interfaces as described in chapter 5.2.

Note
The installation guidelines for Industrial Ethernet networks, SIMATIC
S7 und ET 200S (\4\) always have to be observed.

Notes on barcode scanner
Instead of a scanner as data source, the COM interface of a PC or SIMATIC PG
can also be connected with an ET 200S 1SI module. Hyperterminal for example, a
program within the delivery scope of Windows, can serve as a Window application
for operating the COM interface.

Structure, Configuration and Operation of the Application
Installation and Commissioning
ET200S 1SI module via CP Entry ID: 26263724


Version - 1.0 Issued Oct16th 2007
46/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c



Notes on the configuration computer
Instead of connecting the SIMATIC field PG with the controller via Ethernet, the
connection can also be made via the onboard card CP 5611 with an MPI cable to
the MPI interface of the CPU.
Instead of using a SIMATIC PG, a notebook with Ethernet interface or CP 5512
card can also be used, a PC with network connection or CP 5611 card is also
possible.
First time assignment of the PROFINET device name of the IM 151-3, however, is
only possible via a network cards.
5.1.2 Installation of the standard software
Table 5-2
No. Action Comment
1. Install STEP 7 V5.4 + SP 2 Follow the instructions of the
installation program.
2. Install the ET 200S SI standard library (\2\). It is required for the online help.
5.1.3 Installation of the application software
Table 5-3
No. Action Comment
1. For this application you unzip the delivered
26263724_SI_Modul_via_CP_CODE_v10.zip.
Contains the following data.
2. Unzip the file
SI_Modul_via_CP_REG_v10_d.zip
and import the unzipped .reg file to the Windows Registry
via double-click.
Links the help file of the ET 200S
SI standard blocks
3. Retrieve the file
SI_Modul_via_CP_LIB_v10_d.zip
with STEP 7.
Library with the ET 200S 1SI
blocks for DP/PN CPs
4. Retrieve the file STEP7_Barcode_HE40T_CODE_v10.zip
with STEP 7.
Project for using the barcode
scanner
5. Retrieve the file STEP7_SI_bidirektional_CODE_v10.zip
with STEP 7.
Project for connecting two
ET 200S 1SI modules


Structure, Configuration and Operation of the Application
Installation and Commissioning
ET200S 1SI module via CP Entry ID: 26263724


5.2 Wiring the serial interfaces
The connection assignment of the ET 200S 1SI module is available in the manual
\3\ chapter 2.3 as well as directly on the module. A serial communication without
hardware flow control only requires wiring the TXD, RTS and PE signals.
Program example 1
For the example with the barcode scanner you need an adapter. The RS232 cable
of the Hawkeye HE40T has a 9-pole socket. For connecting to the terminal module
of the ET 200S 1SI module you can use a
blank connector; one piece of bell wire each is welded to its pins 2, 3 and 5
(alternatively a blank socket and an additional so-called gender changer).
The connection between terminal module and adapter is then wired as follows:
pin 3 of the adapter at terminal 1 of the terminal module
pin 2 of the adapter at terminal 5 of the terminal module
pin 5 of the adapter at terminal 8 of the terminal module
Version - 1.0 Issued Oct16th 2007
47/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c




Figure 5-1 Pin assignment terminal module adapter
1 5
6 9
Pinbelegung
gesehen von
der Ltseite

Pin assig
ed from
razed side
nment
view
b

Structure, Configuration and Operation of the Application
Installation and Commissioning
ET200S 1SI module via CP Entry ID: 26263724


Program example 2
For the example of connecting two 1SI modules you can connect as depicted in the
manual \3\ chapter 2.2 or omit a hardware flow control and wire the necessary
signals only:
Terminal 1 of module 1 to terminal 5 of module 2
Terminal 5 of module 1 to terminal 1 of module 2
Terminal 8 of module 1 to terminal 8 of module 2

Figure 5-2 Pin assignment terminal module terminal module

Version - 1.0 Issued Oct16th 2007
48/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c






Structure, Configuration and Operation of the Application
Configuration Process
ET200S 1SI module via CP Entry ID: 26263724


Version - 1.0 Issued Oct16th 2007
49/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c



6 Configuration Process
6.1 Assigning IP addresses
The IP addresses of the Ethernet stations have to be located in the same subnet.
In the example, the IP area 140.140.x.y is used.
If you wish to use your configuration computer to load the stations via Ethernet, the
following settings are possible to operate the stations in the same IP area:
Change IP address and subnet mask of CP 343-1 and
IM 151-3 according to the settings of your PC / notebook computer
Assign the entry TCP/IP(Auto) <name of the network card> to the STEP 7
access point S7ONLINE; in this case STEP 7 automatically searches a free IP
address in the IP area of the STEP 7 project
6.2 Configuration of the S7-300 central control station
Use the SIMATIC Manager to load the desired project of the S7-300 station. The
following passages deal with the aspects to be considered when using other
hardware.
Other PROFINET-CP
When using CP 343-1EX21 instead of CP 343-1EX30 you can simply place the
older CP from the hardware catalog above the existing CP via drag & drop. Since
the IM151-3 used in this example requires the support of the extended diagnostics,
it must be exchanged by a model supported by the CP. After save & compile the
S7-300 station can be loaded an used.
Other S7-300 CPU
If you wish to use another CPU the existing CPU must be deleted. A query appears
whether the S7 program should also be deleted, which you answer with No. Now
the new CPU from the hardware catalog is placed in the rack and saved and
compiled. Now you still need to copy the user blocks (OBs, FBs, FCs, DBs and
VATs) from the backup of the program container in the uppermost level of the
project to the program container of the newly added CPU.

Structure, Configuration and Operation of the Application
Configuration Process
ET200S 1SI module via CP Entry ID: 26263724


6.3 Configuration of the ET 200S stations
Device name of the PROFINET head
Operating the IM 151-3 requires assigning the PROFINET device name. To do this
you open the hardware configuration of the SIMATIC 300 station and mark the
IM151-3. The PLC contains the menu item Ethernet Assign Device Name .
In the displayed window with the found modules you select the respective entry for
the IM 151-3 and save the device name into the device via the Assign name
button.
Figure 6-1
Version - 1.0 Issued Oct16th 2007
50/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c





Structure, Configuration and Operation of the Application
Configuration Process
ET200S 1SI module via CP Entry ID: 26263724


Properties 1SI module
In the object properties of a 1SI module you can set various parameters. The
following screenshot illustrates the parameter selected in the examples.
Figure 6-2
Version - 1.0 Issued Oct16th 2007
51/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c




Other ET 200S head station
If another IM 151-1 or IM 151-3 shall be configured, please delete the existing DP
slave or IO device and add the desired device from the hardware catalog to the DP
system or IO system. Next you enter the power module as well as the 1SI module
1 SI ASCII (8 byte) to the ET 200S station.
As start address for the input and output area of the 1SI module you assign 0
respectively.


Structure, Configuration and Operation of the Application
Configuration Process
ET200S 1SI module via CP Entry ID: 26263724


6.4 Configuration of the Hawkeye HE40T scanner
Setting the parameters for the serial communication
The scanner is parameterized via the Data Matrix Codes printed in the manual
(\8\).
The following codes were used for the application example to configure the
scanner:
Table 6-1
Version - 1.0 Issued Oct16th 2007
52/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c



Data Matrix Code Meaning


The factory settings of the device are used.


The baud rate of the serial communication is set
to 19200 baud.


The device saves the set configuration.



Structure, Configuration and Operation of the Application
Operating the Application
ET200S 1SI module via CP Entry ID: 26263724


7 Operating the Application
7.1 Program example 1 Barcode scanner
Version - 1.0 Issued Oct16th 2007
53/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c



7.1.1 Variable table
Figure 7-1

VAT_Einstellungen (settings)
In the variable table VAT_Einstellungen you can if necessary adjust the system
addresses of the configured CPs. If the hardware setup was accepted unchanged,
no settings are required and the program can receive the data from the scanner.
VAT_DPCP_RECV
The variable table VAT_DPCP_RECV shows you data which were received from
ET 200S PB via the PROFIBUS CP using the 1SI module.
VAT_PNCP_RECV
The variable table VAT_PNCP_RECV shows you data which were received from
ET 200S PN via the PROFINET CP using the 1SI module.

7.1.2 Data Matrix Codes
They can read barcodes of products, for example. Furthermore, you can have your
own data matrix codes generated using the internet page \5\ , such as this:

Structure, Configuration and Operation of the Application
Operating the Application
ET200S 1SI module via CP Entry ID: 26263724


Figure 7-2

7.2 Program example 2 two 1SI modules
Version - 1.0 Issued Oct16th 2007
54/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c



7.2.1 Variable table
Figure 7-3


Structure, Configuration and Operation of the Application
Operating the Application
ET200S 1SI module via CP Entry ID: 26263724


Version - 1.0 Issued Oct16th 2007
55/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c



VAT_Einstellungen (settings)
In the variable table VAT_Einstellungen you can if necessary adjust the system
addresses of the configured CPs. Furthermore, the respective first byte of the send
and receive buffer is displayed to illustrate the roundabout of the data. Further
information displayed is the send cycle as well as the send and receive status of
the CPs. If the hardware setup was accepted unchanged, no settings are required
and the program starts sending and receiving the data.
VAT_DPCP_RECV
The variable table VAT_DPCP_RECV shows you data which were received from
ET 200S PB via the PROFIBUS CP using the 1SI module.
VAT_PNCP_RECV
The variable table VAT_PNCP_RECV shows you data which were received from
ET 200S PN via the PROFINET CP using the 1SI module.
VAT_DPCP_SEND
The variable table VAT_DPCP_SEND shows you data which are to be sent from
ET 200S PB via the PROFIBUS CP using the 1SI module. The sending length can
be set.
VAT_PNCP_SEND
The variable table VAT_PNCP_SEND shows you data which are to be sent from
ET 200S PN via the PROFINET CP using the 1SI module. The sending length can
be set.

7.3 Restrictions
Buffer sizes
Please note that in the example, the size of the send and receive areas in the data
block are restricted to 50 bytes.
Status evaluation
In order to keep the program as simple as possible as well as to keep the focus on
the main programming works, is was largely refrained from programming the status
evaluation of blocks and error OBs.

Appendix and List of Further Literature
Literature
ET200S 1SI module via CP Entry ID: 26263724


Version - 1.0 Issued Oct16th 2007
56/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c



Appendix and List of Further Literature
8 Literature
8.1 Bibliographic References
This list is by no means exhaustive and only gives a selection of appropriate
sources.
Table 8-1
Topic Title
/1/ STEP7 Automatisieren mit STEP7 in AWL und SCL
[Automation with STEP7 in STL and SCL]
Hans Berger
published by: Publicis MCD Verlag
ISBN 3-89578-113-4
8.2 Internet links
This list is by no means exhaustive and only gives a selection of appropriate
sources.
Table 8-2
Topic Title
\1\ Siemens A&D
Customer Support
Start page
http://support.automation.siemens.com
\2\ FBs, examples,
manual of ET 200S
1SI
http://support.automation.siemens.com/WW/view/en/
25358470
\3\ Manual of ET 200S
1SI
http://support.automation.siemens.com/WW/view/en/
9260793
\4\ Manual ET 200S http://support.automation.siemens.com/WW/view/en/
1144348
\5\ Data Matrix Barcode
Image Generator
http://www.idautomation.com/java/dmservlet.html
\6\ Device manual CP
343-1EX30
http://support.automation.siemens.com/WW/view/en/
24485272
\7\ Device manual CP
342-5DA02
http://support.automation.siemens.com/WW/view/en/
8773570
\8\ Manual HE40T
Scanner
http://support.automation.siemens.com/WW/view/en/
24675224


Appendix and List of Further Literature
History
ET200S 1SI module via CP Entry ID: 26263724


Version - 1.0 Issued Oct16th 2007
57/57

C
o
p
y
r
i
g
h
t


S
i
e
m
e
n
s

A
G

2
0
0
7

A
l
l

r
i
g
h
t
s

r
e
s
e
r
v
e
d

2
6
2
6
3
7
2
4
_
S
I
_
M
o
d
u
l
_
v
i
a
_
C
P
_
D
O
K
U
_
v
1
0
_
e
.
d
o
c



9 History
Table 9-1
Version Date Modification
V1.0 16.10.2007 First version