Escolar Documentos
Profissional Documentos
Cultura Documentos
Programming example
Warranty, Liability and Support
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. In using these Application Examples, you recognize that
Siemens 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 the contents
of the other documents have priority.
Table of Contents
Table of Contents ........................................................................................................... 3
1 Introduction....................................................................................................... 4
2 Quick Start ........................................................................................................ 6
2.1 Physical connection .......................................................................................... 6
2.2 Parameterization SIMATIC RF660R read/write device .................................... 7
2.3 Configuration and settings for the SIMATIC controller...................................... 8
2.4 Short description of the user interface ............................................................ 10
3 System Description ........................................................................................ 13
3.1 Physical connection ........................................................................................ 13
3.2 Parameterization SIMATIC RF660R read/write device .................................. 14
3.3 Configuration and settings for the SIMATIC controller.................................... 16
3.3.1 Parameterization of the connection ................................................................ 17
3.3.2 Parameter for the filter block........................................................................... 18
Copyright Siemens AG 2006 All rights reserved
23626344_RF600toPNCPU_DOKU_V10_e.doc
1 Introduction
For goods receipt, stock keeping, production logistics and distribution, RFID (Radio
Frequency Identification) provides complete tracking and documentation of all
delivered, stored and sent goods. To do this, a small data carrier referred to as
smartlabel or tag and which stores all relevant information is attached to each item.
The data carrier receives the required electronic energy via the antennae which is also
used for data transmission.
A so-called read/write device is used for reading and writing the tags.
In many cases, a connection to an automation system is necessary for providing
complete tracking and documentation and to benefit from using the RFID technology.
Copyright Siemens AG 2006 All rights reserved
23626344_RF600toPNCPU_DOKU_V10_e.doc
The document on hand explains how a PLC user programmer can control one or
several SIMATIC RF660R read/write devices, which are connected to a SIMATIC S7
controller with Profinet interface via (Industrial) Ethernet.
The SIMATIC RF660R read/write device for SIMATIC control can be connected via
HUB, Switch or directly via cross-link cable 1 .
1
For connection via cross-link cable, no further device can be connected to the Profinet interface of the
SIMATIC controller.
interface, hence this should enable using them on controllers with Profinet interfaces
different to the ones mentioned here.
Transfer to another controller with Profinet interface is performed by creating a
respective project with the desired controller and copying the blocks.
To provide the PLC user programmer with a starting point regarding the usage of the
interface with the SIMATIC RF660R read/write device, a simple example application is
available in the OB1 of the here described Step7 project.
Copyright Siemens AG 2006 All rights reserved
23626344_RF600toPNCPU_DOKU_V10_e.doc
2 Quick Start
The quick start described in the following chapter is intended for persons which are
already familiar with the SIMATIC RF660R read/write device and also have experience
in handling SIMATIC controllers as well as the respective configuration and
programming envirionmentStep7.
The description enables the user to quickly and establish a connection between the
SIMATIC RF660R read/write device and the SIMATIC controller, without going into
details.
For users new to this environment or interested in detailed information, it is
recommended to proceed with chapter 3.
Copyright Siemens AG 2006 All rights reserved
23626344_RF600toPNCPU_DOKU_V10_e.doc
The SIMATIC RF660R read/write device can be connected directly with the Profinet
interface of the SIMATIC controller via HUB, Switch (see Figure 2-1) or directly via
cross-link cable.
If more than one SIMATIC RF660R read/write device shall be connected to the
respective SIMATIC controller, a HUB or a Switch must be used, using a cross-link
cable is then not possible.
To facilitate configuration using a cross-link cables is not recommended (see chapter
2.2).
Industrial Ethernet
TCP/IP
Copyright Siemens AG 2006 All rights reserved
23626344_RF600toPNCPU_DOKU_V10_e.doc
Figure 2-1: Physical connection with Ethernet via Switch incl. configuration PG
For using the SIMATIC RF660R read/write device in conjunction with the SIMATIC
controller, the following parameters must be set as follows:
Ethernet settings according to the network structure, these settings must be consistent
with the settings in the program of the SIMATIC controller (see chapter 2.3).
The Read Trigger Mode must be set to On Application Request . The adjusted read
time must be set according to the respective task and is irrelevant for the general
program sequence on the SIMATIC controller.
For the communication with the SIMATIC S7 the Notify Channel Config must be set to
"none".
All other parameters of the SIMATIC RF660R read/write device must be set according
to the respective task and are irrelevant for the connection with the SIMATIC controller
and the general program sequence.
Copyright Siemens AG 2006 All rights reserved
23626344_RF600toPNCPU_DOKU_V10_e.doc
For a faster input of the values, the variable table (VAT) existing in the Step7 project
can be used.
Example for entering IP address and Port number (via variable table):
// IP adress Reader
Copyright Siemens AG 2006 All rights reserved
// Port Reader
// e.g. 10001 --> 2711 --> Byte1=11 Byte2=27
DB300.DBB 154 Conparam_1.CONPARAM.rem_tsap_id[1] HEX B#16#11
DB300.DBB 155 Conparam_1.CONPARAM.rem_tsap_id[2] HEX B#16#27
Further settings only affect the behavior regarding the user program and are therefore
described in the following chapter.
Read, this call initiates the SIMATIC RF660R read/write device to perform a
tag reading according to the set configuration. A positive edge at the input
starts the read process. The running read process is displayed as a 1 at the
Busy output, the Ready output is 0 during the process. At the end of the
read process (Busy output: 0 / Ready output: 1) the user has the data
available in the data block DBOUT (DB100).
Disconnect, cancels the connection with the connected SIMATIC RF660R
read/write device. Also a positive edge
Figure 2-2: User interface with the SIMATIC RF660R read/write device
Copyright Siemens AG 2006 All rights reserved
23626344_RF600toPNCPU_DOKU_V10_e.doc
Activate conenction
Connect hostGreetings
Connected
Read tags
tagRead
Read
tagRead(response)
tagRead(response)
endNotify
Ready
Disconnect
Connected Read
Ready
Connect
t
Figure 2-4: Timing diagram for establishing and canceling the connection
Copyright Siemens AG 2006 All rights reserved
23626344_RF600toPNCPU_DOKU_V10_e.doc
1)
Trigger time
Reader
Busy
Ready
Read
t
Figure 2-5: Timing diagram for read job
3 System Description
Since the previous chapter Quick Start only described how a connection can be
established as fast as possible from a user program on a SIMATIC to a SIMATIC
RF660R read/write device, the next chapters describes this in greater detail and
provides detailed information on the delivered blocks.
The SIMATIC RF660R read/write device can be connected directly with the Profinet
interface of the SIMATIC controller via HUB, Switch (see Figure 3-1) or directly via
Copyright Siemens AG 2006 All rights reserved
23626344_RF600toPNCPU_DOKU_V10_e.doc
cross-link cable.
If more than one SIMATIC RF660R read/write device shall be connected to the
respective SIMATIC controller, a HUB or a Switch must be used, using a cross-link
cable is then not possible.
To facilitate configuration using a cross-link cables is not recommended (see chapter
3.2).
Industrial Ethernet
TCP/IP
Copyright Siemens AG 2006 All rights reserved
23626344_RF600toPNCPU_DOKU_V10_e.doc
All other settings are unimportant for the specific type of connection and should only be
adjusted depending on the task to be fulfilled.
How to do this is available in the respective documentation on the CD attached to the
SIMATIC RF660R read/write device.
Important:
This means, that the SIMATIC controller should be configured according to their
possible additional tasks.
The configuration of the connection with the SIMATIC S7 occurs via the instance data
block of the RF600connect. To facilitate configuration, the variable table contained in
the example can be used. It refers to the Conparam_1 (DB300) as instance data block
(not possible for Multireader application, see chapter 4).
The following chapters the configuration is explained using the data block.
Parameters relevant for the connection with the SIMATIC RF660R read/write device
(IP address and Port number) must be entered in the data block Conparam_1 (DB300)
as described below.
Local port on the S7, different ones for Multireader, otherwise select any
Copyright Siemens AG 2006 All rights reserved
23626344_RF600toPNCPU_DOKU_V10_e.doc
IP address reader
The filter block (FB111) has 2 parameters, which are also set via the respective
instance data block Conparam_1 (DB300) of the RF600connect.
deactivate (100.1). If this parameter is set, the filter loop is jumped and the
user can directly access the raw data. This is necessary for direct access to
the raw data, as the filter changes the raw data.
append (104.3). If this parameter is set, the newly read tag IDs are entered
Copyright Siemens AG 2006 All rights reserved
23626344_RF600toPNCPU_DOKU_V10_e.doc
in addition to those already entered at the tag ID data block (DB100) during
the last read job. If this parameter is not set, the tag ID data block (DB100)
is emptied at the start of the new read job, i.e. only those tag IDs are
available in the tag ID data block (DB100) which have been read at the
respective read job.
These are described in greater detail after a brief overview of the function and data
blocks necessary for communication and reading of the tags.
3.4.1 Overview
The program package consists of several function and data blocks (see Figure 3-2),
which are described in greater detail in the following chapters, as well as a small user
example program to illustrate the benefits of the user interface.
The used function blocks TCON (FB 65), TSEND (FB 63), TRCV (FB64) and
TDISCON (FB66) are contained in the standard S7 library for Profinet.
Copyright Siemens AG 2006 All rights reserved
23626344_RF600toPNCPU_DOKU_V10_e.doc
Figure 3-2: Block diagram of the involved function and data blocks
Figure 3-3: User interface with the SIMATIC RF660R read/write device
As described in greater detail in chapter 3.3, all parameter and setting necessary for
the communication with the SIMATIC RF660R read/write device for reading the tag IDs
are stored in this data block.
The function blocks TCON (FB 65), TSEND (FB 63), TRCV (FB64) and TDISCON
(FB66) are the standard blocks for TCP/IP communication with a SIMATIC controller
with Profinet interface.
They are called in RF600connect and also supplied with the required parameters.
Copyright Siemens AG 2006 All rights reserved
23626344_RF600toPNCPU_DOKU_V10_e.doc
This data block contains the required XML commands for reader control.
Respectively one message for connection setup, read job and disconnection.
Depending on the parameter defined by the FB RF600 per call, the TSEND block
accesses the respective XML message and sends it to the SIMATIC RF660R
read/write device.
These are:
<message>
<name type="c">hostGreetings</name>
<paramGroup name="hostGreetings">
<messagingVersion>GR_XML_2.0</messagingVersion>
<appVersion>Moby Control App V xyz</appVersion>
<userName>RF660RAdmin</userName>
<password>****</password>
</paramGroup>
Copyright Siemens AG 2006 All rights reserved
23626344_RF600toPNCPU_DOKU_V10_e.doc
</message>
<message>
<name type="c">tagRead</name>
</message>
<message>
<name type="c">hostGoodbye</name>
</message>
All of the data received by the function block TRCV (FB 64) are filed here.
Storage occurs as ring buffer, i.e. the data are cyclically written, so that there is no
overflow. Accordingly, the required data must be processed, which occurs parallel
through the filter block (FB111).
The filter block searches the tag IDs received by the SIMATIC RF660R read/write
device as well as the XML messages stored in the data block for raw data (DB10) and
Copyright Siemens AG 2006 All rights reserved
23626344_RF600toPNCPU_DOKU_V10_e.doc
This block stores the number of various read out tag IDs (without duplicates) as well as
the read tag IDs themselves.
As apparent in the sequence diagram below, a Connect call must initially be made
from the user program.
The Read jobs can be released on demand and the read out tag IDs be
evaluated/processed accordingly.
If the connection with the SIMATIC RF660R read/write device is no longer necessary,
the connection can be cancelled via the Disconnect call.
The application of the individual calls, as well as the things to be considered is
available in the respective sub-chapters.
Copyright Siemens AG 2006 All rights reserved
S7 Program RF600
23626344_RF600toPNCPU_DOKU_V10_e.doc
Function blocks
Activate connection
Connect hostGreetings
Connected
Tags lesen
tagRead
Read
tagRead(response)
tagRead(response)
endNotify
Ready
Connect
Preconditions: none.
The Connect call is triggered by a positive edge at the Connect input of the FB
RF600Connect (FB300), see Figure 3-3.
The existing connection is signaled with a 1 signal at the Connected output of the FB
RF600Connect (FB300).
At the same time the Ready signal is set, which signals the user that a read job or a
Disconnect can be initialized, see Figure 3-5.
A new edge change (even a renewed positive one) at the Connect input is ignored, as
long as the connection has not previously been canceled with a Disconnect call.
Copyright Siemens AG 2006 All rights reserved
23626344_RF600toPNCPU_DOKU_V10_e.doc
Disconnect
Ready
Connect
Figure 3-5: Timing diagram for establishing and canceling the connection
Read
Preconditions: Signal Connected and Ready have been set at the FB RF600connect
(FB300).
A positive edge at the Read input of the FB RF600connect (FB300) triggers a read
job.
While the read job is being processed, the Ready is set to 0 and the Busy to 1.
The end of the read job is signaled to the user by switching the Ready to 1 or Busy
to 0, see Figure 3-6.
This means that the read tag-IDs are available to the user consistently in the data block
Tag-ID Memory (DB100).
Copyright Siemens AG 2006 All rights reserved
23626344_RF600toPNCPU_DOKU_V10_e.doc
Trigger duration)
Reader
Busy
Ready
Read
Disconnect
Preconditions: connection existing, Connected and Ready outputs have been set to
1 at the FB RF600connect (FB300). Ready output of the FB RF600Connect (FB300)
must be have been set to 1 and the Busy output to 0.
A positive edge at the Disconnect input of the FB RF600connect (FB300) triggers the
disconnection process.
Note:
If the connection is cancelled during a read process by means of a Disconnect call,
then an End Notify message is not sent by the reader. The filter can therefore not
Copyright Siemens AG 2006 All rights reserved
23626344_RF600toPNCPU_DOKU_V10_e.doc
recognize, that the read job has been terminated and is unable to pass this on to
the user.
For the user this means filter block or read job are hung.
This status can only be exited via a new Connect call.
4 Multireader Mode
Should there be more than one SIMATIC RF660R read/write device connected to a
SIMATIC controller, the physical connection must be made via HUB or Switch in any
case.
If the configuration of the SIMATIC RF660R read/write devices is exclusively made via
Ethernet, then the SIMATIC RF660R read/write devices must be connected
successively.
For the configuration of the SIMATIC RF660R read/write devices nothing must be
observed or set differently for the Multireader operation, only the IP addresses must be
set differently.
Copyright Siemens AG 2006 All rights reserved
23626344_RF600toPNCPU_DOKU_V10_e.doc
Neither does the SIMATIC controller require specific configuration, except a possibly
necessary adjustment of the cycle time, see note at the end of this chapter.
For each connected SIMATIC RF660R read/write device, the following function and
data blocks must exist:
The FBs or DBs in the project are copied and added as many times (rename) and must
be adjusted according to the following description:
Filter call:
Specify according copy of the DB raw data at DBRCV
Specify according copy of the DB Tag-ID Memory at DBOUT
Specify according copy from the instance DB
Copyright Siemens AG 2006 All rights reserved
23626344_RF600toPNCPU_DOKU_V10_e.doc
Additionally, the copy of the DB Raw Data must be specified at the FB T_RECV.
Note:
The minimal adjustable cycle time (without user program) is 2:
1 SIMATIC RF660R read/write device approx. 150ms
2 SIMATIC RF660R read/write devices approx. 200ms
2
Determined with a SIMATIC S7 315-2PN/DP MLFB:315-2EG10-0AB0 with one or two SIMATIC
RF600 read/write devices.
The "Connect", "Read" and "Disconnect" buttons thereby control the respective call of
the communication block in the example user program. The "Ready/Busy" display
indicates the feedback of the block to the example user program during/after the read
process.
The connection with the SIMATIC RF600 read/write device is established via the
"Connect" button and cancelled with "Disconnect".
The current connection status is depicted as green (connected) or red (disconnected).
"Read" sends the read command to the reader.
The filtered IDs in the data block are displayed in the list, their number appears in the
counter on the left.
The "Filter active/inactive" button enables activating or deactivating the filter. If the filter
has been deactivated, no IDs are written to the data block and are not displayed.
"Append on/off" enables selecting whether newly read IDs should be attached to
already existing ones in the data block, or whether data block and counter are to be
deleted for each new read process. Additionally, counter and data block can be deleted
manually with the "Clear" button.
Copyright Siemens AG 2006 All rights reserved
23626344_RF600toPNCPU_DOKU_V10_e.doc
6 S7 Program (Appendix)
RF660R
Version - 1.0
BID: 23626344
Ausgabe 06.07.2006
35/53
S7 Program (Appendix)
S7 Program (Appendix)
RF660R
Version - 1.0
BID: 23626344
Ausgabe 06.07.2006
37/53
S7 Program (Appendix)
Copyright Siemens AG 2006 All rights reserved
23626344_RF600toPNCPU_DOKU_V10_e.doc
RF660R
Version - 1.0
BID: 23626344
Ausgabe 06.07.2006
38/53
S7 Program (Appendix)
Copyright Siemens AG 2006 All rights reserved
23626344_RF600toPNCPU_DOKU_V10_e.doc
RF660R
Version - 1.0
BID: 23626344
Ausgabe 06.07.2006
39/53
S7 Program (Appendix)
Copyright Siemens AG 2006 All rights reserved
23626344_RF600toPNCPU_DOKU_V10_e.doc
RF660R
Version - 1.0
BID: 23626344
Ausgabe 06.07.2006
40/53
S7 Program (Appendix)
Copyright Siemens AG 2006 All rights reserved
23626344_RF600toPNCPU_DOKU_V10_e.doc
RF660R
Version - 1.0
BID: 23626344
Ausgabe 06.07.2006
41/53
S7 Program (Appendix)
Copyright Siemens AG 2006 All rights reserved
23626344_RF600toPNCPU_DOKU_V10_e.doc
RF660R
Version - 1.0
BID: 23626344
Ausgabe 06.07.2006
42/53
S7 Program (Appendix)
Copyright Siemens AG 2006 All rights reserved
23626344_RF600toPNCPU_DOKU_V10_e.doc
RF660R
Version - 1.0
BID: 23626344
Ausgabe 06.07.2006
43/53
S7 Program (Appendix)
Copyright Siemens AG 2006 All rights reserved
23626344_RF600toPNCPU_DOKU_V10_e.doc
RF660R
Version - 1.0
BID: 23626344
Ausgabe 06.07.2006
44/53
S7 Program (Appendix)
Copyright Siemens AG 2006 All rights reserved
23626344_RF600toPNCPU_DOKU_V10_e.doc
RF660R
Version - 1.0
BID: 23626344
Ausgabe 06.07.2006
45/53
S7 Program (Appendix)
Copyright Siemens AG 2006 All rights reserved
23626344_RF600toPNCPU_DOKU_V10_e.doc
RF660R
Version - 1.0
BID: 23626344
Ausgabe 06.07.2006
46/53
S7 Program (Appendix)
Copyright Siemens AG 2006 All rights reserved
23626344_RF600toPNCPU_DOKU_V10_e.doc
RF660R
Version - 1.0
BID: 23626344
Ausgabe 06.07.2006
47/53
S7 Program (Appendix)
Copyright Siemens AG 2006 All rights reserved
23626344_RF600toPNCPU_DOKU_V10_e.doc
RF660R
Version - 1.0
BID: 23626344
Ausgabe 06.07.2006
48/53
S7 Program (Appendix)
S7 Program (Appendix)
RF660R
Version - 1.0
BID: 23626344
Ausgabe 06.07.2006
50/53
S7 Program (Appendix)
S7 Program (Appendix)
7 History
Table 7-1 History
Version Data Change
V1.0 07/2006 First edition
Copyright Siemens AG 2006 All rights reserved
23626344_RF600toPNCPU_DOKU_V10_e.doc