Reading and Writing RFID Data With SIMATIC S7-1500 Via IO-Link

Download as pdf or txt
Download as pdf or txt
You are on page 1of 35

Reading and Writing

RFID Data with


SIMATIC S7-1500 via
IO-Link
Siemens
SIMATIC RF220R Reader, ET 200SP Industry
Online
https://support.industry.siemens.com/cs/ww/en/view/73565887 Support
Legal information

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
© Siemens AG 2020 All rights reserved

foreseeable damage typical of the type of agreement, unless liability arises from intent or gross
negligence or 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.

Other information
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.
In order 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.
Siemens’ products and solutions constitute one element of such a concept.
Customers are responsible for preventing unauthorized access to their plants, systems, machines
and networks. Such systems, machines and components should only be connected to an
enterprise network or the Internet if and to the extent such a connection is necessary and only
when appropriate security measures (e.g. firewalls and/or network segmentation) are in place.
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 more secure.
Siemens strongly recommends that product updates are applied as soon as they are available
and that the latest product versions are used. Use of product versions that are no longer
supported, and failure to apply the 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: https://www.siemens.com/industrialsecurity.

Read/write data with IO-Link


Entry ID: 73565887, V3.3, 09/2020 2
Table of Contents

Table of Contents
Legal information ......................................................................................................... 2
1 Task ..................................................................................................................... 4
2 Solution............................................................................................................... 6
2.1 Overview............................................................................................... 6
2.2 Description of the core functionality ..................................................... 8
2.2.1 Reading / writing of RFID data from / to a transponder ....................... 9
2.3 Hardware and software components ................................................. 12
2.3.1 Validity ................................................................................................ 12
2.3.2 Components used .............................................................................. 12
3 Mode of Operation ........................................................................................... 14
3.1 General overview ............................................................................... 14
3.2 Functionality ....................................................................................... 17
3.2.1 Program details on FB "IolReadAnt" (FB3) ........................................ 17
3.2.2 Program details on FB "IolWriteAnt" (FB5) ........................................ 18
3.2.3 Error and status display...................................................................... 20
4 Installation and Commissioning .................................................................... 21
4.1 Hardware installation .......................................................................... 21
4.2 Installing the software ......................................................................... 22
4.3 Commissioning ................................................................................... 22
© Siemens AG 2020 All rights reserved

4.3.1 Restore S7-1500 CPU factory setting ................................................ 22


4.3.2 Setting the IP addresses .................................................................... 23
4.3.3 Changing the IP addresses of the PC/PG .......................................... 23
4.3.4 Configuration of the IO-Link Master ................................................... 24
4.3.5 Change the IP address of the CPU .................................................... 26
4.3.6 Changing IP address of the ET 200SP .............................................. 26
4.3.7 Loading the STEP 7 project into the S7 CPU .................................... 27
5 Operating the Application ............................................................................... 28
5.1 Menu navigation of the HMI ............................................................... 28
5.2 Reading RFID data from the transponder .......................................... 29
5.3 Writing RFID data to the transponder ................................................ 30
5.4 Error states ......................................................................................... 31
6 Appendix .......................................................................................................... 33
6.1 Service and support ........................................................................... 33
6.2 Industry Mall ....................................................................................... 34
6.3 Links and literature ............................................................................. 34
6.4 Change documentation ...................................................................... 35

Read/write data with IO-Link


Entry ID: 73565887, V3.3, 09/2020 3
1 Task

1 Task
Introduction
With RFID, complete tracking and documentation of all delivered, stored and
shipped goods can be performed for intralogistics or in small assembly lines. For
this purpose, a small data medium – referred to as transponder – that stores all
essential information is attached to each product or package. A read/write device
(reader) is used to read from / write to the transponder.

Overview of the automation task


In order to realize simple identification jobs, the RF200 readers are available in an
interface variant for IO-Link. Using this standardized interface it becomes
particularly easy and economical to automatically integrate the read data from the
reader into the automation level.
The communication between a SIMATIC CPU (1) and the RF200 Reader (3) with
IO-Link interface is realized via a respective IO-Link master module (2). It reads the
data via configured address areas of the RF200 IO-Link reader.
The figure below provides an overview of the automation task.
Figure 1-1
SIMATIC IO-Link
© Siemens AG 2020 All rights reserved

PLC Master
1 2

PROFINET IE

IO-Link Reader
...

Transponder

Read/write data with IO-Link


Entry ID: 73565887, V3.3, 09/2020 4
1 Task

Problem description
This application should meet the following requirements:
• The connection of the data read by the reader into the S7 station is to be
performed via the IO-Link interface.
• The intention is to show how easily the function blocks of the Library for IO-
Link (LIOLink) can be used for this task.
• The following RFID functions are to be implemented in the user program:
– Switching on an integrated antenna of the RF220R reader
("LIOLink_RF200_SwitchAntenna")
– Reading RFID data from transponders ("LIOLink_RF200_ReadTag") and
writing RFID data to transponders ("LIOLink_RF200_WriteTag")
– Switching off integrated antenna after a successful read/write process or
after an error in order to prevent possible interferences with other read
devices.
• The read/write process shall be controlled and visualized via a panel.
• Integration of simple functions to monitor the implemented processes
• Error handling

To realize the application, a SIMATIC RF220R IO-Link reader (version 1.1) with a
SIMATIC S7-1513-1 PN CPU should be used.
© Siemens AG 2020 All rights reserved

Further informations
You can download the Library for IO-Link (LIOLink) separately in the Siemens
Industry Online Support:
https://support.industry.siemens.com/cs/ww/en/view/82981502

Read/write data with IO-Link


Entry ID: 73565887, V3.3, 09/2020 5
2 Solution

2 Solution
2.1 Overview
Schematic layout
The figure below shows a schematic overview of the most important components of
the solution:
Figure 2-1
2
User program of the
S7-1500 CPU: PG/PC
IOL_READ_WRITE_ 3
DATA
S7-1500
1

PROFINET IE
© Siemens AG 2020 All rights reserved

5 4

ET 200SP CM 4xIO- RF220R MDS Dxx


Link

Components included
Table 2-1
No. Component Description
1. S7-1500 CPU Any S7-1500 CPU can be used
2. User program " IOL_READ_WRITE_DATA" with:
• "IolReadAnt"
• "IolWriteAnt"
• "LIOLink_RF200_ReadTag"
• "LIOLink_RF200_WriteTag"
• "LIOLink_RF200_SwitchAntenna"
3. PG/PC Programming device on which the RT
Simulator of the panel is operated
4. MDS Dxx Transponder

5. SIMATIC RF220R with IO-Link interface Reader. Any RF200 IO-Link reader V1.1
V1.1 release can be used

Read/write data with IO-Link


Entry ID: 73565887, V3.3, 09/2020 6
2 Solution

No. Component Description


6. IO-Link master SIMATIC ET 200eco PN, ET 200S or
• ET 200SP IM155-6PN HF ET 200AL can also be used as IO-Link
master.
• ET 200SP, CM 4 X IO-LINK ST

Structure
The integration of the RF220R via IO-Link to the S7-1500 is performed via the
IO-Link Master ET 200SP/ CM 4xIO-Link, to which the RF220R is connected via its
IO link interface
The user blocks FB IolReadAnt and FB IolWriteAnt have been created with the
function blocks from the Library for IO-Link (LIOLink). In these blocks the following
is realized:
• the interconnection of the RFID functions
• the monitoring functions and
• the error handling.

Advantages
This application example
• already includes the above-described functions on a fully implemented basis
• can be easily customized for extensions
© Siemens AG 2020 All rights reserved

• includes already the configuration of the IO-Link master


• can be commissioned quickly.

Delimitation
This application does not include a basic description of
• SIMATIC RF200 IO-Link Reader. Please refer to document /6/.
• SIMATIC ET 200SP. Please refer to document /7/.
• the LAD/ FBD/ STL/ SCL programming languages.
• SIMATIC HMI control panels Basic Panels. Please refer to document /8/.
Basic knowledge of these topics is assumed.

Read/write data with IO-Link


Entry ID: 73565887, V3.3, 09/2020 7
2 Solution

2.2 Description of the core functionality


Realized functions
The following core functions have been realized in the application example:
• Switching on the integrated antenna of the RF220R reader before starting a
read or write job.
• Reading/writing RFID data when a transponder is located in the reader’s field.
• Switching off the integrated antenna of the RF220R reader when the read/write
job has been completed successfully or with an error.
• Time monitoring of the read/write function.

Note For a more detailed description of these functions, please refer to chapter 3 and
the following chapters.

Note Explanations on the difference between job and function:


Read/write job:
Call of " LIOLink_RF200_ReadTag" / " LIOLink_RF200_WriteTag" function block
of the Library for IO-Link (LIOLink).
© Siemens AG 2020 All rights reserved

Read/write function:
The entire process for reading/writing the RFID data including switching on and
off of the integrated antenna of the reader, read/write job and monitoring
function.

Read/write data with IO-Link


Entry ID: 73565887, V3.3, 09/2020 8
2 Solution

2.2.1 Reading / writing of RFID data from / to a transponder

HMI visualization "READ"


The following figure shows the HMI visualization for the "READ" function and
displays das "IOL_Station_READ" screen.
Figure 2

3
© Siemens AG 2020 All rights reserved

4 6

Table 2-2
No. Description
1. Entry of the time for the "Watchdog timers", the length, and the offset with the data to
be read.
2. Display whether a transponder is located in the detection area of the reader.

Read/write data with IO-Link


Entry ID: 73565887, V3.3, 09/2020 9
2 Solution

No. Description
3. "ERROR" indicates whether an error has occurred. "STATUS" gives an indication of
which error has happened (see Chapter 3.2.3).
4. "READ" starts a read job.
5. "DONE" indicates whether the last job has been processed without errors.
6. Outputs up to 24 bytes of the read data after a job has been executed without errors.

HMI visualization "WRITE"


The figure below shows the HMI visualization for the "WRITE" function and shows
the "IOL_Station_WRITE" screen.
Figure 2-2

1
© Siemens AG 2020 All rights reserved

4 6

Table 2-3
No. Description
1. Entry of the time for the "Watchdog timers", the length, and the offset with the data to
be written.
2. Display whether a transponder is located in the write area of the reader.
3. "ERROR" indicates whether an error has occurred. "STATUS" gives an indication of
which error has happened (see Chapter 3.2.3).
4. "WRITE" starts a write job.
5. "DONE" indicates whether the last job has been processed without errors.
6. 24 bytes of the data to be written can be entered here. The data entered here is
directly written to data block "Data_Buffer" (DB1).

Read/write data with IO-Link


Entry ID: 73565887, V3.3, 09/2020 10
2 Solution

Sequence of the core functionality


Figure 2-3

Wait for
trigger

1 Start

Switching on Error
2
IOL Reader

Finished
No transponder
detected
Watchdog timer Error and
3
5s status output

Transponder
detected
© Siemens AG 2020 All rights reserved

4
Read/write
function Error

Finished

Switching off
5
IOL Reader

Table 2-4
No. Action Note
1. Job triggered by the user. With watch table, user program or HMI.
2. Switch on IOL reader by selecting the
"LIOLink_RF299_SwitchAntenna"
block.
3. Start the watchdog timer. The watchdog timer monitors whether a
transponder is located within the detection
area within a monitoring time of 5 seconds.
4. Read the transponder with the
"LIOLink_RF200_ReadTag" block.
5. Switch off IOL reader by selecting the Executed if the read job has been
"LIOLink_RF200_SwitchAntenna" executed successfully or an error has
block. occurred during the read job.
Switching off the antenna field terminates
the read function.

Read/write data with IO-Link


Entry ID: 73565887, V3.3, 09/2020 11
2 Solution

2.3 Hardware and software components


2.3.1 Validity

• all S7-1500 CPUs from the SIMATIC product range


• STEP 7 V16
• WinCC V16
• reader of the RF200 (V1.1) family with IO-Link interface

2.3.2 Components used

The application was created with the following components:

Hardware components
Table 2-5
Component No. Article number Note
SIMATIC S7-1500 1 6ES7 513-1AL01-0AB0 Alternatively, any other
CPU 1513-1PN SIMATIC S7-1500 with PN
interface compatible with the
CP can also be used.
© Siemens AG 2020 All rights reserved

SIMATIC PM 1507 1 6EP1332-4BA00 Alternatively, any other


24 V voltage supply can also be
used.
ET 200SP 1 6ES7155-6AU00-0CN0 Another IO-Link master can
IM 155-6PN HF also be used.
CM 4xIO-Link 1 6ES7137-6BD00-0BA0
SIMATIC RF220R 1 6GT2821-2BC32 Another RF200 IO-Link reader
IOL (V1.0) can also be used.
Reader cable 1 6GT2891-0LH50 When using alternative IO-
Link master, the respectively
suitable cables are
documented in \10\.
RF Transponder n MDS Dxyz Alternatively, another
transponder type can also be
used.

Note A SIMATIC Basic Panel KTP1000 is not absolutely necessary. For simulating the
user interface, the PC runtime of STEP 7 V16 will be used.

Read/write data with IO-Link


Entry ID: 73565887, V3.3, 09/2020 12
2 Solution

Software components
Table 2-6
Component No. Article number Note
TIA Portal V16 1 6ES7822-1A.06-..
S7-PCT-Port 1 Available for download in the
Configuration Tool Online Support \3\
(as of V3.4 HF2)
IODD file RF220R 1 Available for download in the
for IO Link V1.1 Online Support \4\

Example files and projects


The following list includes all files and projects that are used in this example.
Table 2-7
Component Note
73565887_IOL_READ_WRITE_DATA_PROJ_V3_3.zip This zip file contains the
STEP 7 project.
73565887_IOL_READ_WRITE_DATA_DOC_V3_3_en.pdf This document.
© Siemens AG 2020 All rights reserved

Read/write data with IO-Link


Entry ID: 73565887, V3.3, 09/2020 13
3 Mode of Operation

3 Mode of Operation
3.1 General overview
Figure 3-1

1 Start

2
LIOLink_RF200_ Error
SwitchAntenna

No transponder
Watchdog timer detected Error and
3
5s status output

Transponder
detected
© Siemens AG 2020 All rights reserved

4
LIOLink_RF200_ Error
ReadTag/WriteTag

Done
5
LIOLink_RF200_
SwitchAntenna

The table below shows the individual steps of the read/write function
(reading/writing RFID data from/to the transponder).
Table 3-1
No. Description
1. Use the "READ"/"WRITE" button on the user interface of the SIMATIC Panel
(HMI) to start the read/write function. The two functions can also be started via a
watch table.
2. The " LIOLink_RF200_SwitchAntenna" library block switches on the antenna
field at the reader.
3. The "TONR" watchdog timer monitors whether a transponder is located in the
detection/write area within the monitoring time of 5 s.
4. If a transponder is detected in the reader’s field within the 5 seconds, the "
LIOLink_RF200_ReadTag" / "LIOLink_RF200_WriteTag" library block will
read/write the RFID data from/to the transponder.
5. The " LIOLink_RF200_SwitchAntenna" library block switches off the antenna
field at the reader when:
• the read/write job has been successfully completed
• an error has occurred while processing the read/write job
• no transponder was detected in the reader’s field within the specified time.
Turning off the antenna field terminates the read/write function.

Read/write data with IO-Link


Entry ID: 73565887, V3.3, 09/2020 14
3 Mode of Operation

Program overview
Figure 3-2

Main

IolReadAnt IolWriteAnt

User program

Lxx_ Lxx_
Lxx_ Lxx_
Switch Switch
ReadTag WriteTag
Antenna Antenna
Library blocks

Inst Inst
DataBuffer IolWriteAnt
IolReadAnt
© Siemens AG 2020 All rights reserved

Hmi
Interface
Data blocks

Program blocks
Table 3-2
Element Symbolic name Description
OB1 Main Cyclic OB:
Calling the blocks for both functions.
FB3 IolReadAnt FB "IolReadAnt" includes the described functions
(Chapter 3.1) on an already fully implemented
basis. In this block, the blocks are called from the
"LIOLink_RF200_V31" library and the "TONR"
monitoring function.
FB5. IolWriteAnt FB "IolWriteAnt" includes the described functions
(Chapter 3.1) on an already fully implemented
basis. In this block, the blocks are called from
the "LIOLink_RF200_V31" library and the
"TONR" monitoring function.
FB1 LIOLink_RF200_ Function block for switching the antenna of an
SwitchAntenna RF200 IO-Link reader on/off.
FB2 LIOLink_RF200_ReadTag Function block for reading the transponder.
FB3 LIOLink_RF200_WriteTag Function block for writing to the transponder.
DB1 DataBuffer Global data block for saving the RFID data
DB2 HmiInterface Global data block for the tags that are integrated
in WinCC and that form the HMI interface.

Read/write data with IO-Link


Entry ID: 73565887, V3.3, 09/2020 15
3 Mode of Operation

Element Symbolic name Description


DB3 InstIolReadAnt Instance data block of the IolReadAnt block
DB4 InstIolWriteAnt Instance data block of the IolWriteAnt block

Note For a more detailed description of the library blocks, refer to the library
documentation:
https://support.industry.siemens.com/cs/ww/en/view/82981502

sdsafasdfsa
"Main"
OB 1 calls the following blocks:
• FB3: "IolReadAnt" contains the flowchart for a read job from switching the
reader on, via the read function, to switching the reader off.
• FB5: "IolWriteAnt" contains the sequence for a write job from switching the
reader on, via the read function, to switching the reader off.

"HmiInterface"
The "HmiInterface" data block (DB2) includes the data for the visualization in tags.
© Siemens AG 2020 All rights reserved

These tags are integrated into WinCC Basic V16 and form the HMI interface.
Table 3-3
Name Data type Description
read Bool Read job triggered at positive edge.
addrTagRead Word Offset of the data to be read on the transponder
lengthRead Time Length of the data read during the read job.
doneRead Bool True, if write job completed without error.
errorRead Bool True, if read job has failed.
statusRead Bool Read job status in Hex code.
presenceRead Word Presence of a transponder in the detection area.
write DWord Write job triggered at positive edge
addrTagWrite Bool Offset where the data is written to the transponder.
lengthWrite DWord Length of the data written during the write job.
doneWrite Bool True, if write job completed without error.
errorWrite Bool True, if read job has failed.
statusWrite Bool Write job status in Hex code.
presenceWrite Word Presence of a transponder in the write area.

Read/write data with IO-Link


Entry ID: 73565887, V3.3, 09/2020 16
3 Mode of Operation

"DataBuffer"
In data block "DataBuffer" (DB1), the RFID data to be read from or written to the
transponder is stored.
Table 3-4
Name Data type Description
readData Array[0..1999] of byte Data read from the transponder after a read job.
writeData Array[0..1999] of byte Data, to be written to a transponder during a
write process.

3.2 Functionality
3.2.1 Program details on FB "IolReadAnt" (FB3)

The following figures and tables show the call interface of user block FB
"IolReadAnt" (FB3).
Figure 3-3
© Siemens AG 2020 All rights reserved

Input Output

The block has the following inputs:


Table 3-5
Name Data type Description

read Bool Enables the read function after a positive edge


addrTag Start address of the data to be read from the
Word
transponder.
length DWord Length of the data that is read from the transponder.
hwId HW_ANY Hardware identifier of the IO-Link communication
module.
portAddr INT Start address of the connected reader (PCT Tool).

Read/write data with IO-Link


Entry ID: 73565887, V3.3, 09/2020 17
3 Mode of Operation

The block has the following in-/outputs:


Name Data type Description

identData Variant Data area where the read data is stored.

The block has the following outputs:


Table 3-6
Name Data type Description
done Bool TRUE, if processing the routine has been terminated.
FALSE, during and before executing a new
command.
Default value: FALSE
error Bool TRUE if an error occurs when processing the routine.
FALSE if a new command is started.
Default value: FALSE
status DWord DW#16#00, if a command was completed without
errors.
In the case of an error (ERROR=TRUE) Hex value
unequal zero (see Chapter 3.2.3.)
presence Bool Presence bit. This bit is only set if a transponder is in
the field of the reader.
© Siemens AG 2020 All rights reserved

For a S7-300 CPU, the input "hwId" must be set to the IO start address of the IO-
Link master.
NOTE
For a ET 200eco PN Master, the input "portAddr" must be set to "0".

3.2.2 Program details on FB "IolWriteAnt" (FB5)

The following figure and table show the call interface of user block FB "IolWriteAnt"
(FB5).
Figure 3-4

Input Output

The block has the following inputs:


Table 3-7
Name Data type Description

read Bool Enables the write function after a positive edge

Read/write data with IO-Link


Entry ID: 73565887, V3.3, 09/2020 18
3 Mode of Operation

Name Data type Description


addrTag Start address of the data to be written on the
Word
transponder.
length DWord Length of the data that is written to the transponder.
hwId HW_ANY Hardware identifier of the IO-Link communication
module.
portAddr INT Start address of the connected reader (PCT Tool).

The block has the following in-/outputs:


Name Data type Description

identData Variant Data area where the read data is stored.


© Siemens AG 2020 All rights reserved

The block has the following outputs:


Table 3-8
Name Data type Description
done Bool TRUE, if processing the routine has been terminated.
FALSE, during and before executing a new
command.
Default value: FALSE
error Bool TRUE if an error occurs when processing the routine.
FALSE if a new command is started.
Default value: FALSE
status DWord DW#16#00, if a command was completed without
errors.
In the case of an error (ERROR=TRUE) Hex value
unequal zero (see Chapter 3.2.3.)
presence Bool Presence bit. This bit is only set if a transponder is in
the field of the reader.

For a S7-300 CPU, the input "hwId" must be set to the IO start address of the IO-
Link master.
NOTE
For a ET 200eco PN Master, the input "portAddr" must be set to "0".

Read/write data with IO-Link


Entry ID: 73565887, V3.3, 09/2020 19
3 Mode of Operation

3.2.3 Error and status display

For error diagnostics, the function blocks "IolReadAnt" (FB3) and "IolWriteAnt"
(FB5) have one STATUS output each. By reading the STATUS output of the
function block you receive information on
• Error messages of the IolReadAnt function block (FB3) and the function blocks
of the library
• Error messages of the connected RF200 IO-Link reader.

Note If there are error messages, the received data is invalid.

Error messages of the user program


The table below shows error messages of the function blocks "IolReadAnt" (FB3),
"IolWriteAnt" (FB5) and the function blocks of library ("LIOL_Antenna",
"LIOL_Read", "LIOL_Write").
Table 3-9
STATUS Description Remedy
16#00018101 The transponder has left the field during the Restart process
© Siemens AG 2020 All rights reserved

read process.
16#00018102 The previous job has not been completed yet. Restart process
The job is finished at the next possible time.
16#00018103 No transponder was detected in the reader’s Restart process
field within the specified time.
16#00018104 The given length is smaller than 28. Specify a length of a
minimum of 28.
16#000180xy Error messages of the extended instructions Online help in STEP 7
16#000187xy "BLKMOV", "DPRD_DAT" and "DPWR_DAT".
16#000185xy
16#00018xyy
16#001100xx Error messages of the connected reader See below.

Error messages of the RF200 IO-Link reader


The error of the connected reader can be determined as follows:
• directly on the reader by counting the flash pattern of the red error LED
• via the STATUS parameter (16#001100xx)
A detailed overview of these errors is available in the manual "RFID systems
SIMATIC RF200 IO-Link" (see \5\, Chapter 7).

Read/write data with IO-Link


Entry ID: 73565887, V3.3, 09/2020 20
4 Installation and Commissioning

4 Installation and Commissioning


4.1 Hardware installation
The required hardware components are listed in Chapter 2.3.2 (used hardware and
software components).

NOTICE Always follow the installation guidelines for all components.

NOTICE Before you switch on the power supply, complete and check the
installation!

The figure below shows the hardware configuration of the application.


Figure 4-1

PM 1507 CPU 1513-1 PN PG/PC


© Siemens AG 2020 All rights reserved

24 V

230 V

PROFINET IE

MDS Dxx

24 V RF220R
(V1.0)

24 V

ET 200SP CM 4xIO-Link

Read/write data with IO-Link


Entry ID: 73565887, V3.3, 09/2020 21
4 Installation and Commissioning

Table 4-1
No. Action Remarks
1. Connect the individual modules to a suitable
module rack.
2. Connect the PM 1507 with the power supply When wiring the 24V, make sure that the
system (230 V alternating current). polarity is correct.
3. Interconnect the following devices:
• PROFINET interface of the PG/PC to the PROFINET interface of the S7 CPU
• PROFINET interface of the S7-CPU with the PROFINET interface of ET 200SP
• Reader cable with the CM 4xIO link (see \9\, Chapter 3.1)

4.2 Installing the software

Note It is recommended to run the latest versions of any installed software.

TIA Portal with Step 7 and WinCC


Table 4-2
No. Action Remarks
© Siemens AG 2020 All rights reserved

1. Install STEP 7 Professional V16


2. Install WinCC Professional V16
Follow the instructions of the
3. Install the PCT Tool V3.4 HF2 \3\
installation program.
4. Install the IODD file for RF220R with IO-Link
interface \4\

4.3 Commissioning
4.3.1 Restore S7-1500 CPU factory setting

Before you begin with the commissioning of the application, the S7-1500 CPU must
have the factory settings (see \8\, Chapter 13.5).
Under the following circumstances you can reset the S7-1500 to the original factory
settings:
• No memory card has been inserted in the CPU.
• The CPU is in STOP mode.

Procedure via the mode switch:


• Put the mode switch to MRES position. Keep the mode switch in this position
until the RUN/STOP LED lights up for the second time and remains lit (after
three seconds). Then release the switch again.
• Set the mode switch to the MRES position again within the next three seconds
and then back to STOP.

Read/write data with IO-Link


Entry ID: 73565887, V3.3, 09/2020 22
4 Installation and Commissioning

Result:
The CPU then performs a "Reset to factory settings" whilst the RUN/STOP LED
flashes yellow. If the RUN/STOP LED lights up yellow, the CPU has been reset to
factory settings and is in STOP mode. The "Reset to factory settings" event is
entered in the diagnostic buffer.

4.3.2 Setting the IP addresses

NOTICE When assigning the IP addresses of your devices please ensure that they
are all located in the same subnet and each IP is only assigned once
across the subnets.

The following table shows the configured IP addresses:


Table 4-3
Module IP address
CPU 1513-1 PN 192.168.0.1
ET 200SP IM 155-6PN HF 192.168.0.10
PG/PC 192.168.0.5
SIMATIC Basic Panel KTP1000 192.168.0.11
© Siemens AG 2020 All rights reserved

4.3.3 Changing the IP addresses of the PC/PG

The table below shows the network setting to which you have to change the
PC/PG:
Table 4-4
No. Action
1. Open the Internet Protocol (TCP/IP) Properties by selecting
"Start > Settings > Network Connections > Local Connections".

2. In the open window, select Internet Protocol (TCP/IP) and open Properties.
3. Select the option box "Use following IP address" and fill in the box as shown in
the picture. Close the dialog boxes with "OK".

4. If your PG has an IWLAN interface, switch it off.

Read/write data with IO-Link


Entry ID: 73565887, V3.3, 09/2020 23
4 Installation and Commissioning

4.3.4 Configuration of the IO-Link Master

Before you start operating the application, the following steps are necessary to
commission the RF200 IO-Link reader.
Table 4-5
No. Action
1. In the TIA Portal, open the Device configuration of the PLC_S7_1500 station.

2. Open the properties of the CM 4xIO-Link module and activate a new potential
group.
"Properties" > "Potential group"
© Siemens AG 2020 All rights reserved

3. Move your mouse pointer over the CM 4xIO-Link module.


Open the dialog window with the right mouse-button and click on "Start device
tool".

Read/write data with IO-Link


Entry ID: 73565887, V3.3, 09/2020 24
4 Installation and Commissioning

No. Action
4. In PCT (S7 Port Configuration Tool) go to the Ports tab, open the product catalog
in PCT and select an IO-Link device V1.1. Drag this device to the desired port of
the master module. In this example an RF200 IO-Link reader is inserted.

5. Go to the Addresses tab to perform a possible change of the device addresses.


6. Expand the project tree and click the newly added IO-Link device (IO-Link
reader).
Go to the Parameters tab. Set the operating mode to "Scan user data".

7. Load the configuration into the device.


© Siemens AG 2020 All rights reserved

Note The start addresses have to be within the I/O addresses of the 4SI IO-Link
module.

Read/write data with IO-Link


Entry ID: 73565887, V3.3, 09/2020 25
4 Installation and Commissioning

4.3.5 Change the IP address of the CPU

Before the STEP 7 project can be loaded into the CPU, the IP address of the S7-
1500 CPU with which you can load the project into the CPU, must be changed.

Note The IP address configured in STEP 7 V16 (TIA Portal) for the S7-1500 CPU
must be located in the same subnet as the IP address set in Windows.

Table 4-6
No. Action
1. Navigate to the "IP address" option via the display of your S7-1500 CPU.
Settings > Addresses >X1 (IE/PN) > IP Address
2. Set the IP address used in the example project of the S7-1500 (192.168.0.1).

4.3.6 Changing IP address of the ET 200SP

Table 4-7
No. Action
© Siemens AG 2020 All rights reserved

1. Start the TIA Portal V16 in the project view. Search for "Nodes accessible online".
To this end, navigate to "Project Tree> Online Access> [Your_Ethernet_Adapter]>
Update accessible devices".
Your stations are now recognized.

2. The procedure is identical for all CPUs: Now you navigate to "[Your_S7CPU]>
Online&Diagnostics".
In the graphical area of "Online & diagnostics", select "Functions> Assign IP
address".

3. Assign the IP address used in the Assign the IP address used in the
project for the ET 200SP (see inspector project for the ET 200SP (see inspector
window of the device view). window of the device view).

Confirm the action with "Assign IP Confirm the action with "Assign IP
address". address".

Read/write data with IO-Link


Entry ID: 73565887, V3.3, 09/2020 26
4 Installation and Commissioning

4.3.7 Loading the STEP 7 project into the S7 CPU

Requirement:
• The STEP 7 V16 project has already been installed and retrieved (see Chapter
4.3).
• The IO-Link master has already been configured (see Chapter 5.4).
Proceed as follows:
• Start the TIA Portal.
• Open the project view.
• Open the "IOL_READ_WRITE_DATA" project.
• In the project navigation:
– Select "PLC_S7_1500 [CPU 1513-1 PN]"
– Right-click and select:
"Download to device > Hardware and software"
• Select the suitable PG/PC interface in the "Extended download to device"
dialog window. As soon as loading is possible, the "Download" button will be
enabled.
• Click the "Download" button.
• Check the messages in the "Load preview" dialog and if required, enable the
© Siemens AG 2020 All rights reserved

actions in the "Action" tab. As soon as loading is possible, the "Download"


button will be enabled.
• Click the "Download" button.
The loading process is executed. Then the "Load events" dialog is opened.
In this dialog you can check whether the loading process was successful and
select possible other actions.

• Click on the "Finish" button.

Read/write data with IO-Link


Entry ID: 73565887, V3.3, 09/2020 27
5 Operating the Application

5 Operating the Application


5.1 Menu navigation of the HMI
Figure 5-1
Main menu

Application example Industry Online Support Information


© Siemens AG 2020 All rights reserved

READ WRITE

Note In the user interface of the HMI you can change the display language of each
screen from German to English and vice versa by clicking on the flag icons.

The application example can be opened via the main menu and continuing
information be called up via the online support.
In the application example you can toggle between scenario 1 and 2.
The scenarios can be controlled via the respective operator windows.

Read/write data with IO-Link


Entry ID: 73565887, V3.3, 09/2020 28
5 Operating the Application

5.2 Reading RFID data from the transponder


The table below lists instructions for reading RFID data from the transponder. HMI
screen "IOL_Station_READ" is used here.
Table 5-1
No. Action
1. In the input fields "Timer" and "Length" you enter (an "Offset" if desired) the
values relevant for reading the RFID data. (see Chapter 2.2.1)
© Siemens AG 2020 All rights reserved

2. Click on the "READ" button.

3. The read RFID data is available to you in the Read Data area.

Read/write data with IO-Link


Entry ID: 73565887, V3.3, 09/2020 29
5 Operating the Application

5.3 Writing RFID data to the transponder


The following table provides instructions for writing RFID data to the transponder.
The "IOL_Station_WRITE" screen is used here.
Table 5-2
No. Action
1. In the input fields "Timer" and "Length" you enter (an "Offset" if desired) the values
relevant for writing the RFID data. (see Chapter 2.2.1)
© Siemens AG 2020 All rights reserved

2. Enter your desired data in the 24 input fields of "Write Data".


As soon as the data has been entered, you click on the "WRITE" button.

3. If the write job has been completed successfully, this is indicated by the green
"DONE" signal.

Read/write data with IO-Link


Entry ID: 73565887, V3.3, 09/2020 30
5 Operating the Application

5.4 Error states


An error while operating the application can have the following causes:
• no transponder in the reader field
• cancellation of the read function
The following table shows an example for such a situation.
Table 5-3
No. Action
1. In the input fields "Timer" and "Length" you enter (an "Offset" if desired) the values
relevant for writing the RFID data.
© Siemens AG 2020 All rights reserved

2. No transponder in the reader field.


3. Click on the "WRITE" button.

4. An error has occurred:


"ERROR" display: ON
"STATUS": 16#00018103 -> No transponder in the reader field

Read/write data with IO-Link


Entry ID: 73565887, V3.3, 09/2020 31
5 Operating the Application

No. Action
5. Place a transponder in the reader’s field and once again click on the "READ" button.
The error was cleared.

6. The read RFID data is available to you in the "Read Data" area.
© Siemens AG 2020 All rights reserved

Read/write data with IO-Link


Entry ID: 73565887, V3.3, 09/2020 32
6 Appendix

6 Appendix
6.1 Service and support
Industry Online Support
Do you have any questions or need assistance?
Siemens Industry Online Support offers round the clock access to our entire
service and support know-how and portfolio.
The Industry Online Support is the central address for information about our
products, solutions and services.
Product information, manuals, downloads, FAQs, application examples and videos
– all information is accessible with just a few mouse clicks:
support.industry.siemens.com

Technical Support
The Technical Support of Siemens Industry provides you fast and competent
support regarding all technical queries with numerous tailor-made offers
– ranging from basic support to individual support contracts. Please send queries
to Technical Support via Web form:
www.siemens.com/industry/supportrequest
© Siemens AG 2020 All rights reserved

SITRAIN – Digital Industry Academy


We support you with our globally available training courses for industry with
practical experience, innovative learning methods and a concept that’s tailored to
the customer’s specific needs.
For more information on our offered trainings and courses, as well as their
locations and dates, refer to our web page:
www.siemens.com/sitrain

Service offer
Our range of services includes the following:
• Plant data services
• Spare parts services
• Repair services
• On-site and maintenance services
• Retrofitting and modernization services
• Service programs and contracts
You can find detailed information on our range of services in the service catalog
web page:
support.industry.siemens.com/cs/sc

Industry Online Support app


You will receive optimum support wherever you are with the "Siemens Industry
Online Support" app. The app is available for iOS and Android:
support.industry.siemens.com/cs/ww/en/sc/2067

Read/write data with IO-Link


Entry ID: 73565887, V3.3, 09/2020 33
6 Appendix

6.2 Industry Mall

The Siemens Industry Mall is the platform on which the entire siemens Industry
product portfolio is accessible. From the selection of products to the order and the
delivery tracking, the Industry Mall enables the complete purchasing processing –
directly and independently of time and location:
https://mall.industry.siemens.com

6.3 Links and literature


Table 6-1
Topic
© Siemens AG 2020 All rights reserved

\1\ Siemens Industry Online Support


https://support.industry.siemens.com
\2\ Link to this entry page of this application example
https://support.industry.siemens.com/cs/ww/en/view/73565887
\3\ S7-PCT V3.3
http://support.automation.siemens.com/WW/view/en/32469496
\4\ IODD file for RF220R with IO-Link interface
https://support.industry.siemens.com/cs/ww/en/view/109750193
\5\ RFID Systems
SIMATIC RF200 IO-Link
https://support.industry.siemens.com/cs/ww/en/view/60641859
\6\ SIMATIC ET 200SP Interface Module IM 155-6 PN ST
http://support.automation.siemens.com/WW/view/en/73184046
\7\ SIMATIC HMI control panels Basic Panels
http://support.automation.siemens.com/WW/view/en/31032678
\8\ S7-1500 Automation System
http://support.automation.siemens.com/WW/view/en/59191792
\9\ ET 200SP
IO-Link Master CM 4xIO-Link
http://support.automation.siemens.com/WW/view/en/67328527
\10\ SIMATIC Ident Configuration Guide
https://support.industry.siemens.com/cs/us/en/view/67384964
\11\ Library for IO-Link (LIOLink)
https://support.industry.siemens.com/cs/ww/en/view/82981502

Read/write data with IO-Link


Entry ID: 73565887, V3.3, 09/2020 34
6 Appendix

6.4 Change documentation


Table 6-2
Version Date Modifications
V1.0 07/2013 First version
V2.0 03/2015 Write function added and update of existing software.
V2.1 12/2016 Update to TIA V14
V3.0 09/2017 Update to TIA V14 SP1 + adaption to the styleguide
V3.1 12/2017 Update for IO-Link V1.1
V3.2 03/2020 Update to TIA V16
V3.3 09/2020 Update of the blocks from the Library for IO-Link (LIOLink)
© Siemens AG 2020 All rights reserved

Read/write data with IO-Link


Entry ID: 73565887, V3.3, 09/2020 35

You might also like