Академический Документы
Профессиональный Документы
Культура Документы
Legal information
Use of application examples
Application examples illustrate the solution of automation tasks through an interaction of several
components in the form of text, graphics and/or software modules. The application examples are
a free service by Siemens AG and/or a subsidiary of Siemens AG (“Siemens”). They are non-
binding and make no claim to completeness or functionality regarding configuration and
equipment. The application examples merely offer help with typical tasks; they do not constitute
customer-specific solutions. You yourself are responsible for the proper and safe operation of the
products in accordance with applicable regulations and must also check the function of the
respective application example and customize it for your system.
Siemens grants you the non-exclusive, non-sublicensable and non-transferable right to have the
application examples used by technically trained personnel. Any change to the application
examples is your responsibility. Sharing the application examples with third parties or copying the
application examples or excerpts thereof is permitted only in combination with your own products.
The application examples are not required to undergo the customary tests and quality inspections
of a chargeable product; they may have functional and performance defects as well as errors. It is
your responsibility to use them in such a manner that any malfunctions that may occur do not
result in property damage or injury to persons.
Disclaimer of liability
Siemens shall not assume any liability, for any legal reason whatsoever, including, without
limitation, liability for the usability, availability, completeness and freedom from defects of the
application examples as well as for related information, configuration and performance data and
any damage caused thereby. This shall not apply in cases of mandatory liability, for example
under the German Product Liability Act, or in cases of intent, gross negligence, or culpable loss of
life, bodily injury or damage to health, non-compliance with a guarantee, fraudulent non disclosure
of a defect, or culpable breach of material contractual obligations. Claims for damages arising
from a breach of material contractual obligations shall however be limited to the foreseeable
damage typical of the type of agreement, unless liability arises from intent or gross negligence or
© Siemens AG 2017 All rights reserved
is based on loss of life, bodily injury or damage to health. The foregoing provisions do not imply
any change in the burden of proof to your detriment. You shall indemnify Siemens against existing
or future claims of third parties in this connection except where Siemens is mandatorily liable.
By using the application examples you acknowledge that Siemens cannot be held liable for any
damage beyond the liability provisions described.
Further Notes
Siemens reserves the right to make changes to the application examples at any time without
notice. In case of discrepancies between the suggestions in the application examples and other
Siemens publications such as catalogs, the content of the other documentation shall have
precedence.
The Siemens terms of use (https://support.industry.siemens.com) shall also apply.
Security information
Siemens provides products and solutions with Industrial Security functions that support the secure
operation of plants, systems, machines and networks.
To protect plants, systems, machines and networks against cyber threats, it is necessary to
implement (and continuously maintain) a holistic, state-of-the-art Industrial Security concept.
Products and solutions from Siemens are only one part of such a concept.
It is the customer’s responsibility to prevent unauthorized access to the customer’s plants,
systems, machines and networks. Systems, machines and components should only be connected
with the company’s network or the Internet, when and insofar as this is required and the
appropriate protective measures (for example, use of firewalls and network segmentation) have
been taken.
In addition, Siemens’ recommendations regarding appropriate protective action should be
followed. For additional information on industrial security measures that may be implemented,
please visit https://www.siemens.com/industrialsecurity.
Siemens’ products and solutions undergo continuous development to make them even more
secure. Siemens strongly recommends to carry out updates as soon as the respective updates
are available and always only to use the current product versions. Use of product versions that
are no longer supported, and failure to apply latest updates may increase customer’s exposure to
cyber threats.
To stay informed about product updates, subscribe to the Siemens Industrial Security RSS Feed
at: http://www.siemens.com/industrialsecurity.
LRfidIOL
Entry ID: 73565887, 3.1, 12/2017 2
Table of Contents
Table of Contents
Legal information ......................................................................................................... 2
1 Library Overview ................................................................................................ 4
1.1 Areas of application .............................................................................. 4
1.2 Functions .............................................................................................. 5
1.3 Hardware and software requirements .................................................. 5
1.4 Overview with IO-Link .......................................................................... 6
2 Blocks of the Library ......................................................................................... 7
2.1 Block list ............................................................................................... 7
2.2 Explanation of the blocks ..................................................................... 8
2.2.1 FB "LRfidIOL_Read" ............................................................................ 8
2.2.2 FB "LRfidIOL_Write" ........................................................................... 11
2.2.3 FB "LRfidIOL_Antenna"...................................................................... 14
2.3 Function chart ..................................................................................... 15
2.4 Error and status display...................................................................... 16
2.4.1 Error messages of the library’s function blocks.................................. 16
2.4.2 Error messages of the connected RF200 IO-Link reader .................. 16
3 Working with the Library................................................................................. 17
3.1 Preparation ......................................................................................... 17
3.2 Integrating the library in STEP 7 ........................................................ 18
3.3 Integrating the library blocks into the STEP 7 project ........................ 18
© Siemens AG 2017 All rights reserved
LRfidIOL
Entry ID: 73565887, 3.1, 12/2017 3
1 Library Overview
1 Library Overview
This present document describes the "LRfidIOL" block library. This library provides
you with tested SIMATIC blocks including clearly defined interfaces. They can be
used as a basis for the task you want to implement.
The main focus of this document is to describe the blocks contained in the block
library and the functionality to be implemented.
Furthermore, this documentation shows possible areas of application and helps
you to integrate the library into your STEP 7 project.
Note This library description also applies for using an S7-300/400 CPU. The
corresponding blocks can also be found in the "LRfidIOL" library and on the
HTML page of this entry \1\.
Schematic layout
© Siemens AG 2017 All rights reserved
The following figure below shows the most important components for the possible
use of the library.
Figure 1-1
S7-400
S7-1500
S7-300
S7-1200
PROFINET IO
RF210R/220R RF240R/250R/260R
IO-Link Master
IO-Link Reader (V1.0/V1.1)
Note The blocks presented here can be used for the S7-1200 CPU with firmware V4.2
and higher only.
LRfidIOL
Entry ID: 73565887, 3.1, 12/2017 4
1 Library Overview
1.2 Functions
The communication between S7-1500 CPU and RF200 Reader with IO-Link
interface is realized via a respective IO-Link master module by reading the
respectively configured address areas (input and output areas) of the RF200 IO-
Link reader. The following table describes the core functions of the RF200 IO-Link
reader. Each individual function is realized from the library in a separate block.
Table 1-1
Function Description
READ Reading data from the transponder.
WRITE Writing data to the transponder.
Antenna off/on This command switches the antenna field on the reader off and
back on again.
Hardware
Table 1-2 Hardware components
No. Component Article number Number
1. ET 200SP IM 155-6PN HF 6ES7155-6AU00-0CN0 1
2. CM 4xIO-Link 6ES7137-6BD00-0BA0 1
3. Reader of the RF200 family RF210R: 6GT 821-1AC32 Up to 4
with IO-Link interface V1.0 RF220R: 6GT 821-2AC32
RF240R: 6GT 821-4AC32
RF250R: 6GT 821-5AC32
RF260R: 6GT 821-6AC32
Reader of the RF200 family RF210R: 6GT 821-1BC32
with IO-Link interface V1.1 RF220R: 6GT 821-2BC32
RF240R: 6GT 821-4BC32
RF250R: 6GT 821-5BC32
RF260R: 6GT 821-6BC32
4 Reader cable 6GT2891-4LH50 Up to 4
5 RF Transponder MDS Dxyz n
LRfidIOL
Entry ID: 73565887, 3.1, 12/2017 5
1 Library Overview
Software
Table 1-3 Software
No. Component Article number Number
1. TIA Portal V14 SP1 6ES7822-1..04-.. 1
2. S7-PCT Port Configuration Available for download in the 1
Tool (as of V3.4 HF2) Online Support \3\
3. IODD file RF200R Available for download in the 1
Online Support \5\, \6\
Note A detailed description of the different IO-Link versions and the associated
readers is available in the corresponding manual.
Comprehensive performance measurements with regard to the transmission
times of RFID configurations can be found in the Siemens Industry Online
Support (\10\).
LRfidIOL
Entry ID: 73565887, 3.1, 12/2017 6
2 Blocks of the Library
Note The central library "LRfidIOL" includes all blocks for the IO-Link reader V1.0 and
V1.1 as well as for the S7-1200/S7-1500 and S7-300/S7-400 CPUs.
© Siemens AG 2017 All rights reserved
LRfidIOL
Entry ID: 73565887, 3.1, 12/2017 7
2 Blocks of the Library
2.2.1 FB "LRfidIOL_Read"
The "LRfidIOL_Read" library block reads a data block from the transponder. The
following figure and table show the call interface of the FB "LRfidIOL_Read" library
block.
Figure 2-1 LRfidIOL_Read
LRfidIOL_Read
presence Bool
identData
Variant Variant
© Siemens AG 2017 All rights reserved
LRfidIOL
Entry ID: 73565887, 3.1, 12/2017 8
2 Blocks of the Library
Table 2-2
Symbol Data type Explanation
execute BOOL Read job activated at positive edge.
adrTag WORD Start address of the data to be read on the
transponder.
length WORD Length of the data that is read from the transponder.
hwId HW_SUBMODULE Hardware identifier of the IO-Link communication
module.
done BOOL TRUE if the last job has been completed without
errors (for one cycle).
FALSE if a new command is started.
busy BOOL TRUE, if the LRfidIOL_Read block is active.
FALSE if the job was stopped or if an error occurred.
error BOOL FALSE, if a command was completed without errors.
OUTPUT
LRfidIOL
Entry ID: 73565887, 3.1, 12/2017 9
2 Blocks of the Library
Note For the S7-300 CPU, the input "hwId" (WORD) describes the start address of the
input and output areas of the IO-Link master.
When using an ET 200eco PN IO-Link master module, the parameter "portAdr"
must always be 0.
The data to be read by the transponder is stored in a data block from address x or
y on. The following figure shows the behavior for two READ calls.
Figure 2-2
Transponder 1
DATA
ADR_TAG IDENT_DATA:
Byte 0 DB
16#02 Byte 1 DBNr.DBB[x]
Byte 2 e.g. Data_Buffer
Byte x
LEN_DATA . Byte x+1 DBNr
16#04 . Byte x+3
.
Transponder 2 Byte x+3
Byte x+n
Byte n DATA
Byte y DBNr
Byte 0 Byte y+1
ADR_TAG Byte 1
16#00 Byte 2 Byte y+2
Byte 4 Byte y+n
© Siemens AG 2017 All rights reserved
LEN_DATA . IDENT_DATA:
16#0C .
DBNr.DBB[y]
Byte n
LRfidIOL
Entry ID: 73565887, 3.1, 12/2017 10
2 Blocks of the Library
2.2.2 FB "LRfidIOL_Write"
The library block "LRfidIOL_Write" writes a data block from the user program to a
transponder. The following figure and table show the call interface of the
"LRfidIOL_Write" FB library block.
Figure 2-3 LRfidIOL_Write
LRfidIOL_Write
presence Bool
identData
Variant Variant
Table 2-3
© Siemens AG 2017 All rights reserved
LRfidIOL
Entry ID: 73565887, 3.1, 12/2017 11
2 Blocks of the Library
done BOOL TRUE if the last job has been completed without
errors (for one cycle).
FALSE if a new command is started.
busy BOOL TRUE if the "LRfidIOL_Write" block is active.
FALSE if the job was stopped or if an error occurred.
error BOOL FALSE, if a command was completed without errors.
OUTPUT
Note For the S7-300 CPU, the input "hwId" (WORD) describes the start address of the
input and output areas of the IO-Link master.
When using an ET 200eco PN IO-Link master module, the parameter "portAdr"
must always be 0.
LRfidIOL
Entry ID: 73565887, 3.1, 12/2017 12
2 Blocks of the Library
The data to be written to the transponder is stored in a data block from address x
or y on. The following figure shows the behavior for two WRITE calls.
Figure 2-4
Ident Data
DB Transponder 1
e.g. Data_Buffer
DATA
Byte x
Byte x+1 DBNr Byte 0
Byte x+2 Byte 1
Byte x+3 Byte 2 ADR_TAG
Byte x+n 16#02
IDENT_DATA: .
Byte y DBNr DBNr.DBB[x] LEN_DATA
Byte y+1 . Transponder 2 16#04
Byte y+2 .
Byte y+n DATA
Byte n
Byte 0
Byte 1
Byte 2
Byte 4
ADR_TAG
.
© Siemens AG 2017 All rights reserved
16#00
IDENT_DATA: .
DBNr.DBB[y]
LEN_DATA
Byte n 16#0C
LRfidIOL
Entry ID: 73565887, 3.1, 12/2017 13
2 Blocks of the Library
2.2.3 FB "LRfidIOL_Antenna"
statusWord DWord
presence Bool
© Siemens AG 2017 All rights reserved
Table 2-4
LRfidIOL
Entry ID: 73565887, 3.1, 12/2017 14
2 Blocks of the Library
Note For the S7-300 CPU, the input "hwId" (WORD) describes the start address of the
input and output areas of the IO-Link master.
When using an ET 200eco PN IO-Link master module, the parameter "portAdr"
must always be 0.
identical.
Figure 2-6
Schreiben
Lesen
BUSY
DONE
16#00018102
ERROR
Antenne EIN
ANTENNE
LRfidIOL
Entry ID: 73565887, 3.1, 12/2017 15
2 Blocks of the Library
Table 2-5
STATUS Description Remedy
16#00018101 The transponder has left the Restart process.
field before the read/write
process was finished.
16#00018102 Previous order not yet Restart process.
completed. The job is finished at
the next possible time.
© Siemens AG 2017 All rights reserved
LRfidIOL
Entry ID: 73565887, 3.1, 12/2017 16
3 Working with the Library
3.1 Preparation
Before you start integrating the library, the following steps are necessary to
commission the RF200 IO-Link reader:
• Installing the IODD file of the connected reader (see \5\, \6\
• Configuring the IO-Link master.
Note For the CM 4xIO-Link module a new potential group has to be enabled.
“Properties > Module Parameters > Potential group > Enable new potential
group”
LRfidIOL
Entry ID: 73565887, 3.1, 12/2017 17
3 Working with the Library
Note In the following section it is assumed that a STEP 7 project has been created.
Below, you will find the steps of how to integrate the "LRfidIOL"
library blocks into your STEP 7 project. Subsequently, you can use the blocks of
library.
© Siemens AG 2017 All rights reserved
Table 3-3
No. Procedure
1. Open an already existing STEP 7 V14 SP1 project.
2. In the “Global Libraries” palette, click on “Open global library” in the toolbar or select
“Global libraries > Open library...” in the “Options” menu. The “Open global library”
dialog opens.
LRfidIOL
Entry ID: 73565887, 3.1, 12/2017 18
3 Working with the Library
No. Procedure
4. Drag and drop the function blocks matching your configuration to the “Program
blocks” folder of your device.
5. In the “Program blocks” folder of your device, open the organization block OB1 and
drag the function blocks to any network of your choice.
© Siemens AG 2017 All rights reserved
6. Enter the name and number of the associated instance data block. Click “OK” to exit
the dialog.
1 The newly compiled instance data blocks are set to “non-retain” so that they are overwritten by
the start values when restarting the CPU.
LRfidIOL
Entry ID: 73565887, 3.1, 12/2017 19
3 Working with the Library
No. Procedure
8. Create a new global data block (Array [1..n] of Bytes) for saving the data.
LRfidIOL
Entry ID: 73565887, 3.1, 12/2017 20
3 Working with the Library
2. If you want to update the library, integrate the latest library as described in chapter
© Siemens AG 2017 All rights reserved
3.2.
3. Delete all blocks of the old library in the “Program blocks” folder of your STEP 7
project.
Do not delete the function block call in OB1.
U U
4. Insert the elements of the new library as described in Chapter 3.3, steps 1-4.
5. The updated blocks are now included in the library. In the toolbar, click “Update
inconsistent block calls” to update or regenerate the instance DBs.
6. Once you have inserted the updated blocks into your STEP 7 project, compile the
software and save the project.
7. The library update is now complete.
LRfidIOL
Entry ID: 73565887, 3.1, 12/2017 21
4 Appendix
4 Appendix
4.1 Service and Support
Industry Online Support
Do you have any questions or need support?
Siemens Industry Online Support offers access to our entire service and support
know-how as well as to our services.
Siemens Industry Online Support is the central address for information on our
products, solutions and services.
Product information, manuals, downloads, FAQs and application examples – all
information is accessible with just a few mouse clicks at
https://support.industry.siemens.com
Technical Support
Siemens Industry's Technical Support offers quick and competent support
regarding all technical queries with numerous tailor-made offers
– from basic support right up to individual support contracts.
Please address your requests to the Technical Support via the web form:
© Siemens AG 2017 All rights reserved
www.siemens.en/industry/supportrequest
Service offer
Our service offer includes the following:
• Plant Data Services
• Spare Parts Services
• Repair Services
• On Site and Maintenance Services
• Retrofit and Modernization Services
• Service Programs and Agreements
Detailed information on our service offer is available in the Service Catalog:
https://support.industry.siemens.com/cs/sc
LRfidIOL
Entry ID: 73565887, 3.1, 12/2017 22
4 Appendix
LRfidIOL
Entry ID: 73565887, 3.1, 12/2017 23