Professional Documents
Culture Documents
(LIOLink)
Siemens
SIMATIC, TIA Portal Industry
Online
https://support.industry.siemens.com/cs/ww/en/view/82981502 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 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
© Siemens AG 2020 All rights reserved
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:
http://www.siemens.com/industrialsecurity.
Table of contents
Legal information .............................................................................................................................. 2
1 Introduction ............................................................................................................................. 5
2 Components of the library ..................................................................................................... 6
3 Base blocks ...........................................................................................................................11
3.1 LIOLink_Device .......................................................................................................11
3.1.1 Description ...............................................................................................................11
3.1.2 Parameter ................................................................................................................12
3.1.3 Operating principle ..................................................................................................13
3.1.4 Error handling ..........................................................................................................15
3.2 LIOLink_Master .......................................................................................................16
3.2.1 Description ...............................................................................................................16
3.2.2 Parameter ................................................................................................................17
3.2.3 Operating principle ..................................................................................................18
3.2.4 Error handling ..........................................................................................................19
4 Device-specific blocks .........................................................................................................20
4.1 SIMATIC RF200 ......................................................................................................20
4.1.1 LIOLink_RF200........................................................................................................21
4.1.2 LIOLink_RF200_ReadTag .......................................................................................23
© Siemens AG 2020 All rights reserved
7 Appendix ................................................................................................................................56
7.1 Service and support .................................................................................................56
7.2 Industry Mall ............................................................................................................57
7.3 Links and literature ..................................................................................................57
7.4 Change documentation ...........................................................................................58
© Siemens AG 2020 All rights reserved
1 Introduction
Overview
Systematic diagnostics concepts and the efficient handling of parameter data are demanded at
all levels of automation engineering. Therefore, it is essential that sensors and switching
devices are integrated into the automation network.
The IO-Link communication standard allows for new possibilities thanks to the intelligent linking
of sensors and switching devices to the controller level. Core aspects are switching, protection
and monitoring on the field level.
The IO-Link system consists of an IO-Link master and one or more IO-Link devices (sensors or
actuators). The IO-Link master serves as an interface to the higher-level controller; it controls
communication with the connected IO-Link devices.
This library provides blocks and PLC data types to facilitate communication between the
SIMATIC controller and the IO-Link master or IO-Link device.
Range of functions
The blocks in this library are subdivided into three groups:
• General-use base blocks for communicating with the SIMATIC IO-Link master and any IO-
Link devices.
•
© Siemens AG 2020 All rights reserved
Applies to
This library is available for TIA Portal V16 and higher.
All blocks in the library are available for SIMATIC S7-1200/1500 controllers and, in large part,
also for SIMATIC S7-300/400 controllers.
Base blocks
Table 2-1: Base blocks
Name Version Description
LIOLink_Device V 4.0.0 Facilitates reading and writing of acyclic data of an
IO-Link device
LIOLink_Master V 4.0.0 Facilitates backup and restore of device parameters
and device settings of an IO-Link master via the S7
program (master swap without Engineering Tool)
Device-specific blocks
Table 2-2: Device-specific blocks
Name Version Description
LIOLink_3RA V 3.0.0 Used for simple communication with SIRIUS 3RA
devices
LIOLink_3RB24 V 3.0.0 Used for simple communication with SIRIUS 3RB24
devices
© Siemens AG 2020 All rights reserved
Profile blocks
Table 2-3: Profile blocks
Name Version Description
LIOLink_AdjSwitchingSensor V 2.0.0 Used for setting or teaching the setpoint value and for
modifying the switching point logic of adjustable
switching sensors (AdSS).
LIOLink_IdentAndDiag V 2.0.0 Acyclically reads and writes identification and
diagnostic data, and outputs the status of the
connected IO-Link device.
LIOLink_MeasuredDataChannel V 1.0.4 With this function block, measured values of the
sensors can be acquired cyclically. The measured
raw values from the sensors are processed and are
available as Real or DInt measured values at the
respective outputs.
configuration" (130)
LIOLink_3RA_typeDiag V 2.0.0 Describes the data record "Diagnostics"
(92)
LIOLink_3RA_typeParameterPage1 V 2.0.0 Describes the data record "Parameter page
1"
LIOLink_3RA_typePII V 1.0.0 Describes the process image of the inputs
LIOLink_3RA_typePIQ V 1.0.0 Describes the process image of the outputs
LIOLink_3RB24_typeAll V 2.0.2 Structure for all supported data records for
SIRIUS 3RB24 devices
LIOLink_3RB24_typeDiag V 2.0.0 Describes the data record "Diagnostics"
(92)
LIOLink_3RB24_typeMeasure V 2.0.0 Describes the data record "Measured
values" (94)
LIOLink_3RB24_typePII V 1.0.0 Describes the process image of the inputs
LIOLink_3RB24_typePIQ V 1.0.0 Describes the process image of the outputs
LIOLink_3RB24_typePresetConfig V 2.0.0 Describes the data record "preset
configuration" (130)
LIOLink_3RB24_typeTechFunctions V 2.0.0 Describes the data record "technology
functions" (131)
LIOLink_3RR24_typeAll V 2.0.2 Structure for all supported data records for
SIRIUS 3RR24 devices
LIOLink_3RR24_typeDiag V 2.0.0 Describes the data record "Diagnostics"
(92)
LIOLink_3RR24_typeMeasure V 2.0.0 Describes the data record "Measured
values" (94)
LIOLink_3RR24_typeParam V 2.0.0 Describes the data record "Parameter"
(131)
LIOLink_3RR24_typePII V 1.0.0 Describes the process image of the inputs
LIOLink_3RR24_typePIQ V 1.0.0 Describes the process image of the outputs
Further information about the individual data records can be found in the associated device
Note manuals.
© Siemens AG 2020 All rights reserved
3 Base blocks
3.1 LIOLink_Device
3.1.1 Description
By reading and writing acyclic data, you can write device parameters to an IO-Link device, or
read parameters, measured values and diagnostic data from an IO-Link device.
The function block supports you in the following tasks:
• (Re)parameterization of an IO-Link device
• Diagnosing an IO-Link device
• Executing IO-Link port functions
• Backing up/restoring IO-Link device parameters
The data on the IO-Link device are uniquely addressed with index and subindex. Additionally,
the function block can be used to execute port functions (e.g. switching the port to DI mode).
The structure of the data objects and port functions can be found in the respective
Note documentation on the IO-Link device and IO-Link master.
© Siemens AG 2020 All rights reserved
The function block is based on a standardized protocol (PROFIBUS DP/PROFINET IO), which
ensures access to data from an IO-Link device via the IO-Link master. Essentially, a sequence
of acyclic read and write accesses is used, which are represented by the SIMATIC system
functions "RDREC" and "WRREC".
The block is an asynchronously functioning function block, i.e. processing extends over multiple
PLC cycles.
If a DPV1 slave is configured via GSD file (GSD rev. 3 or later) and the DP interface of the DP
master is set to "S7 compatible", then the block will not function correctly.
Note
Remedy: Set the interface for the DP master to "DPV1".
Note This block replaces the previously available blocks "IO_LINK_DEVICE" and "IO_LINK_CALL".
Applies to
The FB is available in two variants for the S7-1200/1500 and S7-300/400.
3.1.2 Parameter
Int subindex
Int writeLen
Time timeout
record
Array[0..#UPPER_LIMIT] of Byte Array[0..#UPPER_LIMIT] of Byte
© Siemens AG 2020 All rights reserved
S7-300/400:
Logical address of the IO-Link communication
module (module or submodule)
cap IN Int Access point (Client Access Point)
For SIMATIC ET 200eco PN, CM 8x IO-Link,
M12-L: 0xB400
Otherwise: 0x00E3 (227)
readWrite IN Bool Mode
FALSE: read
TRUE: write
port IN Int Port number at which the IO-Link device is
operated
Possible values: 0..63
index IN Int Parameter index
Possible values: 0..32767
subindex IN Int Parameter subindex
0: entire record
1..255: Parameter from record
writeLen IN Int Length of the data in bytes (net data) to be
written
Possible values for writing: 1..232
Not relevant when reading
Addressing
The desired data record is uniquely addressed with the parameters "index" and "subindex".
© Siemens AG 2020 All rights reserved
When writing data, the data quantity specified at the "writeLen" parameter is transmitted to the
IO-Link device. The parameter is irrelevant when reading.
Using the "cap" parameter (Client Access Point), the access point to the IO-Link master is
defined as follows:
• 0xB400: For SIMATIC ET 200eco PN, CM 8x IO-Link, M12-L
• 0x00E3 (227): All other IO-Link masters from Siemens AG, as long as the respective
manual does not specify otherwise.
Sequence of a transmission
Data transmission is started with a positive edge at the input "execute".
The outputs "done", "busy", "error" and "status" show the status of the command.
After successful execution, the parameter "len" shows the length of the received or written data.
As long as the input "execute" is set, the output parameters retain their value. If the "execute"
input is reset before the processing of the FB is completed, the values of the output parameters
are output for one cycle after the command is processed.
If the operation exceeds the time at the parameter "timeout", the processing will be aborted and
an error will be output.
Note
The data transmission takes place in the form of raw data (ARRAY of Byte), i.e. the data
cannot be interpreted in this form.
It is left to the user to format the data in accordance with the specifications of the device
manufacturer (copy to a data structure or data type).
The "status" output outputs the current status and any errors, while the "diagnostics" output
provides a diagnostic structure with detailed information in the event of an error.
status
Table 3-3: Output "status" from LIOLink_Device
Status Meaning
16#0000 Operation completed, no warning and no further details
16#7000 No operation in progress (initial value)
16#7001 First call after input of a new command (rising edge on "execute")
16#7002 Subsequent call
16#8201 Unsupported port
16#8202 Unsupported index
16#8203 Unsupported subindex
16#8205 The length at the "writeLen" parameter does not match the data record that will
be written
16#8401 The IO-Link master has reported an error code, see "diagnostics"
16#8402 Received data record does not match operation
16#8403 Operation could not be completed in the specified time
© Siemens AG 2020 All rights reserved
diagnostics
In the event of an error, the "diagnostics" output gives detailed information about the pending
error.
3.2 LIOLink_Master
3.2.1 Description
Using this block, you can back up the device parameters and device settings of an IO-Link
master via the S7 program (Backup), or restore (Restore) (master swap without Engineering
Tool).
Applies to
The block is approved for the following IO-Link masters:
• ET 200SP, CM 4xIO-Link (6ES7137-6BD00-0BA0) firmware V2.2.0 or higher
• ET 200pro, EM 4 IO-LINK HF (6ES7147-4JD00-0AB0) firmware V1.0.0 or higher
• ET 200AL, CM 4xIO-Link (6ES7147-5JD00-0BA0) firmware V1.1.0 or higher
• ET 200eco PN, IO-Link Master (6ES7148-6JD00-0AB0) firmware V1.0.0 or higher
• ET 200eco PN, CM 8x IO-Link, M12-L (6ES7148-6JG00-0BB0) firmware V1.0.0 or higher
© Siemens AG 2020 All rights reserved
The function "Master Backup" is only available for IO-Link devices that are specified for the IO-
Link standard V1.1 or higher.
Note
IO-Link masters from third parties are not supported by this block.
3.2.2 Parameter
status Word
diagnostics "LIOLink_typeDiagnostics"
len DInt
record
Array[*] of Byte Array[*] of Byte
S7-300/400:
Logical address of the IO-Link communication
module (module or submodule)
mode IN USInt/Int Mode
0: Backup
1: Restore
done OUT Bool TRUE: Command successfully executed
busy OUT Bool TRUE: Command is currently being processed
error OUT Bool TRUE: An error has occurred while processing
the FB
status OUT Word 16#0000–16#7FFF: Status of the FB
16#8000–16#FFFF: Error codes
(see chapter 3.2.4).
diagnostics OUT "LIOLink_ Detailed diagnostic information of the FB (see
typeDiagnostics" chapter 3.2.4)
len OUT DInt Length in bytes of the read/written data (net
data)
record IN_OUT Array[*] of Byte Source/destination range for the data to be
read/written.
Valid limits:
• 4-port master: 0..10239
• 8-port master: 0..17549
In order to use as few resources as possible, the block works directly in the memory range at
the "record" parameter. The data in the memory range are not allowed to change during a
Note write operation, and may only be read once a read operation is complete. For this purpose,
evaluate the output parameter "done" or "status".
As long as the input "execute" is set, the output parameters retain their value. If the "execute"
input is reset before the processing of the FB is completed, the values of the output parameters
are output for one cycle after the command is processed.
Note
The data transmission takes place in the form of raw data (array of Byte), i.e. the data cannot
© Siemens AG 2020 All rights reserved
Note
If a DPV1 slave is configured via GSD file (GSD rev. 3 or later) and the DP interface of the
DP master is set to "S7 compatible", then the block "LIOLink_Master" will not function
correctly.
Set the interface of the DP master to "DPV1" instead.
Data loss
The combination of a SIMATIC S7-1200 CPU with an 8-port IO-Link master exceeds the level
ATTENTION of retentive data available in the CPU.
If this combination is used, data loss will occur because the data cannot be completely
retentively stored in the CPU.
The "status" output outputs the current status and any errors, while the "diagnostics" output
provides a diagnostic structure with detailed information in the event of an error.
status
Table 3-6: Output "status" from LIOLink_Master
Status Meaning
16#0000 Operation completed, no warning and no further details
16#7000 No operation in progress (initial value)
16#7001 First call after input of a new command (rising edge on "execute")
16#7002 Subsequent call during active processing without further details
16#71xx Subsequent call during backup, xx = current sequence number
16#72xx Subsequent call during restore, xx = current sequence number
16#80B0 Unknown module type
16#8200 Unsupported value at "mode" parameter
16#8201 Array at the "record" parameter does not match the expected limits
16#8401 IO-Link master has reported back a sequence number that indexes an error, see
"diagnostics"
16#8600 Internal state machine has reached an undefined state
© Siemens AG 2020 All rights reserved
16#8601 System function WRREC reports an error during a reset, see "diagnostics"
16#8602 System function RDREC reports an error during backup, see "diagnostics"
16#8603 System function WRREC reports an error during restore, see "diagnostics"
16#8604 System function RDREC reports an error during verification of the restore, see
"diagnostics"
diagnostics
In the event of an error, the "diagnostics" output gives detailed information about the pending
error.
4 Device-specific blocks
The device-specific blocks in this library each simplify communication with a specific IO-Link
device respectively, thanks to a custom-tailored interface and predefined PLC data types.
In this context, the user does not have to know the necessary parameters in order to read or
write a specific data record. Instead, the user chooses it via the interface.
For every supported data record, PLC data types are provided which facilitate simple
reading/writing of the data record.
Applies to
These FBs are each available in two variants for the S7-1200/1500 and S7-300/400.
© Siemens AG 2020 All rights reserved
4.1.1 LIOLink_RF200
Description
The FB "LIOLink_RF200" facilitates reading and writing of various data records via a simple
user interface.
Parameter
Figure 4-1: LIOLink_RF200
LIOLink_RF200
Bool vendorText
© Siemens AG 2020 All rights reserved
Bool productName
Bool productID
Bool fwRevision
appSpecificNa
Bool
me
Bool errorCount
Bool eventHistory
Bool readerStatus
Bool tagStatus
Bool uidHistory
data
"LIOLink_RF200_typeAll" "LIOLink_RF200_typeAll"
S7-300/400:
Logical address of the IO-Link
communication module (module or
submodule)
For each operation, only one data record can be read or written. The FB reads/writes the data
Note record associated with the first parameter that is set.
Error handling
The block outputs the status and diagnostic information from the internally-called FB
"LIOLink_Device" at the outputs "status" and "diagDeviceFB" (see chapter 3.1.3).
4.1.2 LIOLink_RF200_ReadTag
Description
The FB "LIOLink_RF200_Read" reads a data block from the transponder.
Parameter
Figure 4-2: LIOLink_RF200_ReadTag
LIOLink_RF200_ReadTag
USInt version
identData
Variant Variant
© Siemens AG 2020 All rights reserved
4.1.3 LIOLink_RF200_SwitchAntenna
Description
The FB "LIOLink_RF200_Antenna" switches the antenna of a SIMATIC RF200 IO-Link reader
on or off.
In normal operation, this command is not needed, as the antenna is always switched on after
Note the reader is switched on.
Parameter
Figure 4-3: LIOLink_RF200_SwitchAntenna
LIOLink_RF200_SwitchAntenna
presence Bool
4.1.4 LIOLink_RF200_WriteTag
Description
The FB "LIOLink_RF200_Write" writes a data block from the user program to a transponder.
Parameter
Figure 4-4: LIOLink_RF200_WriteTag
LIOLink_RF200_WriteTag
Siemens Industry Online Support features a detailed application example on integrating the
blocks into your user project:
https://support.industry.siemens.com/cs/ww/en/view/73565887
© Siemens AG 2020 All rights reserved
• Directly on the reader by counting off the blink pattern of the red error LED
• Via the "status" parameter (16#001100xx)
A detailed overview of these errors can be found in the manual "SIMATIC Ident RFID systems
SIMATIC RF200":
https://support.industry.siemens.com/cs/ww/en/view/109766065
4.2 SIRIUS
4.2.1 Description
Using the library blocks described here, you can drive various IO-Link-capable SIRIUS devices
via a simple user interface.
This includes the following devices:
• SIRIUS 3RA compact starters
• SIRIUS 3RB24 solid-state overload relay
• SIRIUS 3RR24 monitoring relay
• SIRIUS 3RS1 temperature monitoring relay
• SIRIUS 3RS2 temperature monitoring relay
• SIRIUS ACT 3SU1 electronic module
• SIRIUS ACT 3SU1 ID key switch
• SIRIUS 3UG48 monitoring relay
Applies to
These FBs are each available in two variants for the S7-1200/1500 and S7-300/400.
© Siemens AG 2020 All rights reserved
4.2.2 Parameter
The parameters for the various device types are nearly identical. Therefore, the parameters are
explained using the example of the FB "LIOLink_3SU1_ElecModule".
Bool vendorText
© Siemens AG 2020 All rights reserved
Bool productName
Bool productID
Bool fwRevision
appSpecific
Bool
Name
Bool diagnostics
Bool statistics
Bool parameters
data
"LIOLink_3SU1_ElecModule_typeAll" "LIOLink_3SU1_ElecModule_typeAll"
S7-300/400:
Logical address of the IO-Link
communication module (module or
submodule)
cap IN Int Access point (Client Access Point)
For SIMATIC ET 200eco PN, CM 8x
IO-Link, M12-L: 0xB400
Otherwise: 0x00E3 (227)
For each operation, only one data record can be read or written. The FB reads/writes the data
Note record associated with the first parameter that is set.
Siemens Industry Online Support features a detailed application example on integrating the
blocks into your user project:
https://support.industry.siemens.com/cs/ww/en/view/90529409
The block outputs the status and diagnostic information from the internally-called FB
"LIOLink_Device" at the outputs "status" and "diagDeviceFB" (see chapter 3.1.3).
5 Profile blocks
The IO-Link community defines standardized device profiles for the IO-Link devices in order to
unify access to IO-Link devices from a controller's user program.
The device profiles for IO-Link are based on uniform data structures, data contents and basic
functionalities for the IO-Link devices. This means that a uniform interface can be created in the
program for a large number of different IO-Link devices that match the same device profile, and
the number of different function blocks from multiple manufacturers can be reduced to a
minimum.
The prerequisite for using the blocks is that the data structure of the IO-Link device used
supports the corresponding IO-Link profile.
The specification for the individual device profiles can be found on the website of the IO-Link
community:
https://IO-Link.com/
The profile blocks in the library facilitate standardized access via the Common and Smart
Sensor profiles.
Common profile
The Common profile provides uniform information for identification and diagnosis of the IO-Link
© Siemens AG 2020 All rights reserved
Applies to
These FBs are only available for the S7-1200/1500.
Note that the device profiles are only available for IO-Link devices that are specified for the
Note IO-Link standard V1.1 or higher.
5.1 LIOLink_AdjSwitchingSensor
5.1.1 Description
Note
Note that if the FB "LIOLink_IdentAndDiag" is called several times at the same time for the
same master (e.g. information retrieval for several ports simultaneously), only one block call
© Siemens AG 2020 All rights reserved
5.1.2 Parameter
Bool teachRequest
Int teachFunction
1: rd_all
2: wr_conf
3: wr_param
4: teach
5.1.3 Operation
5.1.3.1 Functions
The block offers five functions. A function can be selected by specifying the corresponding
number at the "function" input. A rising edge at the "execute" input triggers the selected
function.
• no_func (0)
© Siemens AG 2020 All rights reserved
No function is performed.
• rd_all (1)
With this function, the current switching signals and parameter values are read by the
sensor. The read values are available at the outputs "logicOut" and "setpointOut".
• wr_conf (2)
This function causes a previously created value for "logicIn" to be written into the sensor.
• wr_param (3)
This function causes a previously created value for "setpointIn" to be written into the sensor.
• teach (4)
This function causes the block to switch over to the teach process (see chapter 5.1.3.2).
5.1.3.2 Teach-in
Overview
This section explains the various teach functions. The teach-in functions are used to teach in
setpoints for switching the switching output at the sensor. Various teach-in methods are
possible, for instance single value teach-in, two value teach-in or dynamic teach-in, which
facilitates the commissioning of the application. Depending on the sensor type, individual
combinations of these teach-in methods are possible.
Four teach-in procedures are available, and these can be selected via the "teachMode" input:
• no_teach (0): No teach-in action
• single_value (1): Single value teach-in
• two_value (2): Two-value teach-in
• dynamic (3): Dynamic teach-in
During a teach sequence, the individual teach steps are controlled via the inputs
"teachRequest" and "teachFunction".
The different teach-in mechanisms are explained in more detail in the next section.
© Siemens AG 2020 All rights reserved
The "status" output provides information on the currently active teach-in step. If a
"teachFunction" is requested but not permitted at this time, the function block stops the teach
process and returns an error.
The teach process was successful if the outputs "done" = TRUE and "status" = 16#0000.
Two-value teach-in
The steps for a two-value teach-in are listed below:
1. Set inputs "function" = 4 and "teachMode" = 2.
2. Set input "execute" = TRUE.
3. Wait until outputs "permitTeach1" = TRUE, "permitTeach2" = TRUE and "status" = 16#7120
(teach process waits for another command).
4. Move the object to the desired position for teach point 1.
5. Set input "teachFunction" = 1.
6. Set input "teachRequest" = TRUE.
7. Wait until outputs "permitTeach1" = TRUE, "permitTeach2" = TRUE and "status" = 16#7120
(teach process waits for another command).
8. Move the object to the desired position for teach point 2.
9. Set input "teachFunction" = 2.
10. Set input "teachRequest" = FALSE.
11. Set input "teachRequest" = TRUE.
12. If "applyAuto" = FALSE, "teachApply" must be triggered manually:
a. Wait until outputs "permitApply" = TRUE and "status" = 16#7140 (teach process waits
for command to accept the taught values).
© Siemens AG 2020 All rights reserved
The teach process was successful if the outputs "done" = TRUE and "status" = 16#0000.
Dynamic teach-in
The steps for a dynamic teach-in are listed below:
1. Set inputs "function" = 4 and "teachMode" = 3 (dynamic teach-in).
2. Set input "execute" = TRUE.
3. Wait until outputs "permitTeach1" = TRUE and "status" = 16#7130 (teach process waits for
another command).
4. Set input "teachFunction" = 1.
5. Set input "teachRequest" = TRUE.
6. Wait until output "status" = 16#7131 (teach process is active).
The dynamic teach-in process has started.
7. Move object inside of the desired area.
8. If "teachTimer" = 0 s, teach point 2 has to be manually initiated.
a. Wait until output "permitTeach2" = TRUE.
b. Set input "teachFunction" = 2.
c. Set input "teachRequest" = FALSE.
d. Set input "teachRequest" = TRUE.
If "teachTimer" ≠ 0 s, then teach point 2 is automatically triggered and the teach process
ends when the time has elapsed. The timer starts after the teach request has been
successfully sent to the IO-Link device.
© Siemens AG 2020 All rights reserved
The teach process was successful if the outputs "done" = TRUE and "status" = 16#0000.
An abort of the teach function is available after the start of the teach process. This can be
aborted with "teachFunction" = 4 and a rising edge at the input "teachRequest".
The "status" output outputs the current status and any errors, while the "diagnostics" output
provides a diagnostic structure with detailed information in the event of an error.
status
Table 5-2: Error codes of the "status" output
Output status Explanation
Function block internal status
16#0000 Operation successfully executed
16#7000 No operation in progress (initial value)
16#7011 Busy reading data
16#7012 Busy writing data
16#7026 Busy with backup
16#7101 Teach process started
16#7102 Teach process, subsequent call
16#7110 Teach process, single-value teach process waiting for another command
16#7111 Teach process, single-value teach process is busy
16#7120 Teach process, two-value teach process waiting for another command
© Siemens AG 2020 All rights reserved
diagnostics
In the event of an error, the "diagnostics" output gives detailed information about the pending
error.
5.2 LIOLink_IdentAndDiag
5.2.1 Description
The FB "LIOLink_IdentAndDiag" acyclically reads and writes identification and diagnostic data
and outputs the status of the connected IO-Link device. The function block supports the
"Common Profile" from the IO-Link specification.
This profile ID contains the function classes "DeviceIdentification", "DeviceDiagnosis",
"ProcessDataVariable" and "ExtendedIdentification". They are combined to form a device
profile.
Note
Note that if the FB "LIOLink_IdentAndDiag" is called several times at the same time for the
same master (e.g. information retrieval for several ports simultaneously), only one block call
will be completed successfully. A status conflict "diagnostics.status" = 16#8402 of the child
FB "LIOLink_Device" will be output at the other blocks (send and response data
inconsistent).
5.2.2 Parameter
© Siemens AG 2020 All rights reserved
deviceStatus Byte
detailedDevice
Array[0..63] of DWord
Status
Function selection
Different functions can be controlled at the function block via the input parameter "function". The
© Siemens AG 2020 All rights reserved
Backup
If the input "backupEnable" is set to TRUE, the IO-Link system command
"ParameterDownloadStore" is called. This starts the data storage mechanism (DataStorage)
and saves the new parameterization in the IO-Link master.
An error is displayed if mandatory (M) parameters (see Table 5-6) cannot be read or written. In
this case, the write or read operation stops in the FB and a detailed status is output at the
"status" and "diagDeviceFB" outputs (see chapter 0).
All information on the various profile sensors can be stored in one data block.
The "status" output outputs the current status and any errors, while the "diagnostics" output
provides a diagnostic structure with detailed information in the event of an error.
status
Table 5-7: Error codes of the "status" output
Status Meaning
16#0000 Operation completed, no warning and no further details
16#0003 Operation completed, at least one optional parameter could not be written
16#7000 No operation in progress (initial value)
16#7001 First call after input of a new command (rising edge on "execute")
16#7002 Subsequent call
16#8001 An error has occurred while executing the block. Check your input values.
16#8203 The value at the "function" input is outside the defined range
16#8400 External error during processing. Optional parameter without default value.
16#8600 Error in child FB "LIOLink_Device", see "diagnostics"
16#87xx A parameter could not be read.
xx contains the index (hex) of the parameter.
16#88xx A parameter could not be written.
© Siemens AG 2020 All rights reserved
diagnostics
In the event of an error, the "diagnostics" output gives detailed information about the pending
error.
deviceStatus
Table 5-9: "deviceStatus" values
Value Description
16#00 The device is working properly.
16#01 "Maintenance required"
Although the process data is valid, the internal diagnosis indicates that the device
is about to lose its ability to function correctly.
e.g.: Optical lenses are getting dusty, deposits are forming, lubricant level low
16#02 "Out of specification"
Although the process data are valid, the internal diagnosis indicates that the
instrument is operating outside the specified measurement range or
environmental conditions.
e.g.: Power supply, auxiliary power, temperature, air pressure, magnetic
disturbances, vibrations, acceleration, stray light, bubble formation in liquids
16#03 "Function test"
Process data are temporarily invalid due to intentional manipulation of the device.
e.g.: Calibrations, teach-in, position adjustments, simulation
16#04 "Error"
Process data are invalid due to malfunctions in the device or its peripherals. The
device cannot perform its intended function.
© Siemens AG 2020 All rights reserved
16#05..FF Reserved
detailedDeviceStatus
The parameter provides information about currently pending events to the IO-Link device.
Events of type "Error" or "Warning" and mode "Event appears" are output in the detailed device
status list with EventQualifier and EventCode. When an event occurs with "Event disappears"
mode, the corresponding Detailed Device Status entry is set to EventQualifier "0x00" and
EventCode "0x000000". In this way, this parameter always provides the current diagnostic
status of the device. The parameter is a read-only data object. A maximum of 64 array elements
(event entries) can be displayed, but the number of array elements of this parameter is device-
specific. The EventCodes supplied are also device-specific and are defined by the
manufacturer. When the IO-Link device is switched off or reset, the contents of all array
elements are set to the basic settings - EventQualifier "0x00", EventCode "0x000000".
IO-Link device manufacturers can choose to implement a static list, i.e. a fixed array position for
each event with a specific event code, or a dynamic list, i.e. each event entry is stored in the
next free array position. Access to the subindex is not permitted for a dynamic list.
5.3 LIOLink_MeasuredDataChannel
5.3.1 Description
5.3.2 Parameter
measurementV
Variant valueReal Real
alue
valueDInt DInt
scale Int
Using the function block, measured values of the sensors can be recorded cyclically. The
measured raw values of the sensors are processed and output again as Real or DInt measured
values at the respective outputs. The scaling of the sensor is already accounted for in the
measured value that is output (thanks to the read-in scaling factor); it does not have to be
interpreted again, i.e. both the physical unit of the sensor and the measured value are
interpreted. The measurement data channel defines the process data structure, the functions
and the representation of the measurement sensors.
The inputs "scaleIn" and "measurementValue" of the function block must be connected to the
respective input addresses of the IO-Link device. The inputs can be read out either directly via
the configuration in TIA Portal or via the PCT tool. The scaling value acquired at input "scaleIn"
is also available as information at output "scale".
The scaling address at input "scaleIn" is always two bytes higher than the address at input
"measurementValue" for function class [0x800A] (16-bit measured values). With with function
class [0x800B] (32-bit measured values), the scaling address at input "scaleIn" is always four
bytes higher than the measured value address.
The "profileId" input determines which type of Smart Sensor Profile (SSP) is used by the IO-Link
device and whether the data are interpreted as 16-bit or 32-bit values at "measurementValue".
SSP 3.1 and SSP 3.3 use the process data structure "PDI32.INT16_INT8" (16 bit measured
value), and there is no difference between "profileId" = 1 and "profileId" = 3. The same applies
to "profileId" = 2 (SSP 3.2) and "profileId" = 4 (SSP 3.4), since both process the data structure
"PDI48.INT32_INT8" (32-bit measured value).
The following table provides an overview of profile types 3 with the corresponding process data
structure.
Measuring 0x800C
sensor, high PDI48.INT32_INT8
SSP 3.4 0x000D 0x800B
resolution, PDO8.BOOL1
blocking function
If there is no error pending, the process input data are forwarded from "measurementValue" to
© Siemens AG 2020 All rights reserved
the output "valueDInt". The value at output "valueReal" is calculated from: "measurementValue"
* 10 ^ "scaleIn".
There are several signal states that can occur during the process:
32760 2147483640
Out of range (+)
16#7FF8 16#7FFFFFF8
32764 2147483644
No measurement value
16#7FFC 16#7FFFFFC
In the event of an error, the "error" output is set and the "status" output gives the internal error
code of the FB.
The output "valueStatus" provides information about the quality of the process data. If there is
no error, "valueStatus" = 0.
If there is an error, the output "valueStatus" may have the following states:
© Siemens AG 2020 All rights reserved
6 Useful information
6.1 IO-Link basics
Introduction
The point-to-point interface IO-Link, which can be used to transmit process data and diagnostic
data as well as parameters, has been specifically developed for connecting all types of sensors
and actuators to a control system. In this context, IO-Link does not use traditional bus wiring but
instead keeps the parallel wiring that is typical with sensors and actuators.
The IO-Link communication standard is localized below the fieldbus level. It allows central fault
diagnosis and tracking down to the sensor/actuator level and simplifies commissioning and
maintenance by allowing the parameter data to be modified dynamically, direct from the
application.
As an open interface, the IO-Link can be integrated into all common fieldbus and automation
systems. Consistent interoperability ensures maximum protection of investment. This also
applies in the context of existing machine concepts for continued use of sensors that have no
IO-Link interface.
Overview
"IO-Link is the first globally standardized IO technology (IEC 61131-9) for communicating with
sensors as well as actuators. Its powerful point-to-point communication is based on the well-
established 3-lead sensor and actuator connector with no additional requirements for the
cabling material. IO-Link is therefore not a fieldbus but rather an evolutionary outgrowth of the
existing, proven connection technology for sensors and actuators." 1
Manufacturer
IO-Link is supported in a technical committee by many famous manufacturers, among them
Siemens.
Connector
IO-Link communication can be connected via existing lines for digital inputs and outputs using
the 3-lead technology. This makes for a homogeneous and much reduced deployment of
cabling.
1 https://io-link.com/
The configuration of the IO-Link master and the devices connected to it is done in the Port
Configuration Tool, or S7-PCT for short:
https://support.industry.siemens.com/cs/ww/en/view/32469496
The S7-PCT can either driven standalone or launched from an existing TIA Portal project.
To open the S7-PCT from STEP 7 V16, you have the following options in the device view of the
IO-Link master:
• In the device view, right-click on the IO-Link master module in the editor area and select
"Start device tool …".
© Siemens AG 2020 All rights reserved
• In the device list, right-click on the IO-Link Master module and select "Start device tool ...".
3
2
4
5
7
© Siemens AG 2020 All rights reserved
Key:
1. Project tree
2. Buttons for uploading and downloading the current IO-Link configuration
3. Button to show/hide the product catalog
4. Tabs
5. Product catalog for IO-Link devices
6. Work area
7. Port numbers with parameterized IO-Link devices
Note
For information on library use in general, see the Guide to Library Use:
https://support.industry.siemens.com/cs/ww/en/view/109747503
Note
All blocks in the library were created in accordance with the programming style guide:
https://support.industry.siemens.com/cs/ww/en/view/81318674
7 Appendix
7.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
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
The Siemens Industry Mall is the platform where you can access the entire Siemens Industry
product portfolio. From selecting products to ordering and delivery tracking, the Industry Mall
covers purchase handling in its entirety–directly and regardless of time or place:
mall.industry.siemens.com
https://support.industry.siemens.com
\2\ Link to the article page of the application example
https://support.industry.siemens.com/cs/ww/en/view/82981502
\3\ IO-Link at Siemens
http://www.siemens.de/IO-Link
\4\ Website of the IO-Link community:
https://io-link.com/
\5\ Multi-manufacturer database for description files (IODDs)
https://ioddfinder.IO-Link.com/
\6\ Port Configuration Tool
https://support.industry.siemens.com/cs/ww/en/view/32469496