LIOLink DOC V7 2 en
LIOLink DOC V7 2 en
Industry
Online
Support
APPLICATION EXAMPLE
IO-Link Library
(LIOLink)
SIMATIC / TIA Portal / Block library
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. The application examples
are not subject to standard tests and quality inspections of a chargeable product and may contain functional and performance
defects or other faults and security vulnerabilities. You are responsible for the proper and safe operation of the products in
accordance with all applicable regulations, including checking and customizing the application example for your system, and
ensuring that only trained personnel use it in a way that prevents property damage or injury to persons. You are solely
responsible for any productive use.
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. Any further use of the
application examples is explicitly not permitted and further rights are not granted. You are not allowed to use application examples in
any other way, including, without limitation, for any direct or indirect training or enhancements of AI models.
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 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 and to terminate your use of the
application examples at any time. 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://www.siemens.com/global/en/general/terms-of-use.html) shall also apply.
Cybersecurity information
Siemens provides products and solutions with industrial cybersecurity 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 cybersecurity 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 cybersecurity measures that may be implemented, please visit www.siemens.com/cybersecurity-
industry.
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 Cybersecurity RSS Feed under
https://www.siemens.com/cert.
Table of Contents
1. Introduction ...................................................................................................................................6
7.1. LIOLink_MeasuredData................................................................................................................................ 67
7.1.1. Description ................................................................................................................................................. 67
7.1.2. Parameter................................................................................................................................................... 67
7.1.3. Principle of Operation ................................................................................................................................. 68
9. Appendix .....................................................................................................................................76
1. Introduction
Overview
Systematic diagnostics concepts and the efficient handling of parameter data are demanded at all levels of automation
technology. 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-purpose base blocks for communication with SIMATIC IO-Link Masters and any IO-Link devices and for
reading out their IO-Link diagnostics.
• Master-specific blocks that are used for backup and restore of SIMATIC IO-Link Masters and for executing port
functions.
• Device-specific blocks each simplify communication with a specific IO-Link device respectively, thanks to a custom-
tailored interface and predefined PLC data types. These blocks are based on the base blocks.
• Profile blocks simplify communication with a device via a specific IO-Link profile. These blocks are based on the base
blocks.
Validity
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.
Below you will find a listing of all blocks in this library with the current version.
Base Blocks
Table 2-1: Base Blocks
Master-Specific Blocks
Table 2-2: Master-Specific Blocks
Device-Specific Blocks
Table 2-3: Device-Specific Blocks
Master Copies
Table 2-5: Master Copies
NOTE Further information about the individual datasets can be found in the associated device manuals.
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:
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.
NOTE The structure of the data objects and port functions can be found in the respective documentation on
the IO-Link device and IO-Link Master.
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.
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 will not function correctly.
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".
Validity
The FB is available in two variants for the S7-1200/1500 and S7-300/400. However, there are minor differences (see
Table 3-1: Parameters of LIOLink_Device)
LIOLink_Device
hwID/
HW_IO/DInt busy Bool
logicalAddr
Int subindex
Int writeLen
Time timeout
Time pollingPeriod
record
Array[*] of bytes Array[*] of bytes
S7-300/400:
Logical address of the IO-Link Master (module or submodule)
cap IN Int Access point (Client Access Point):
(optional)
S7-1200/1500:
When using Siemens IO-Link Masters, is automatically detected, and is
therefore optional. If the parameter is changed, automatic detection is
not active.
S7-300/400:
Automatic detection is not implemented in this version. The access
point must therefore be set manually.
Normally, it has the value 0xB400 or 0x00E3, and is specified in the
respective manual.
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
65535 (0xFFFF): IOL-D - port functions
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
S7-300/400:
The functionality is not implemented in this version, which is why the
parameter does not exist here.
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 Section 3.1.4).
diagnostics OUT "LIOLink_ Detailed diagnostic information of the FB (see Section 3.1.4)
typeDiagnostics"
readLen OUT Int Length of data read in bytes (net data)
record IN_OUT Array[*] of bytes S7-1200/1500:
Source/destination range for the data to be read/written.
Possible range of values: 0..231
S7-300/400:
Data type: Array[0…231] of Byte
Addressing
The desired dataset is uniquely addressed with the parameters "index" and "subindex".
When writing data, the data quantity specified at the "writeLen" parameter is transmitted to the IO-Link device. The
parameter is irrelevant when reading.
The access point to the IO-Link Master is defined using the "cap" parameter (Client Access Point): When using IO-Link
Masters from Siemens AG, detection is automatic. However, if the parameter is changed, automatic detection is not
active. Normally, the access point is 0xB400 or 0x00E3.
Automatic detection of the "cap" parameter is only implemented in the S7-1200/1500 block. For the S7-
NOTE
300/400, it must be set manually in the block.
The data transmission takes place in the form of raw data (ARRAY of bytes), i.e. the data cannot be
NOTE
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).
Parameter Value
mode 1
index 2
subindex 0
writeLen 1
record[0] 0x05
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 dataset that will be written
16#8401 The IO-Link Master has reported an error code, see "diagnostics"
16#8402 Received dataset does not match operation
16#8403 Operation could not be completed in the specified time
16#8600 Internal state machine has reached an undefined state
16#8601 System function WRREC reports an error, see "diagnostics"
16#8602 System function RDREC reports an error, see "diagnostics"
diagnostics
In the event of an error, the "diagnostics" output gives detailed information about the pending error.
Tag Description
status Last status code of the interface parameter "status" of the FB.
subfunctionStatus Status of system functions RDREC/WRREC or error code from IO-Link Master (%W1: Error code from
IO-Link Master, %W0: ISDU error code).
For detailed information, refer to the Online Help for the system function in question, or the
device manual of the IO-Link Master/device.
stateNumber State of the FB's state machine in which the error occurred.
3.2. LIOLink_Diagnose
3.2.1. Description
Using this block, it is possible to export detailed diagnostic data from a Siemens IO-Link Master and the devices connected
to it.
NOTE This function block provides diagnostics for IO-Link Masters with up to 8 ports. If there are more than 8
ports, the block only provides diagnostic data for the first 8 ports.
Validity
The block is approved for the following IO-Link Masters:
3.2.2. Parameter
Figure 3-4: LIOLink_Diagnose
LIOLink_Diagnose
Status Word
Diagnostics LIOLink_typeDiagnostics
events LIOLink_typeEvents
status
The "status" output outputs the current status of the block along with error codes for the executed system function
RDREC.
Table 3-5: Output "status" from LIOLink_Diagnose
Tag Description
status Last status code of the interface parameter "status" of the FB.
subfunctionStatus Status of system functions RDREC/WRREC or error code from IO-Link Master (%W1: Error code
from IO-Link Master, %W0: ISDU error code).
For detailed information, refer to the Online Help for the system function in question, or the
device manual of the IO-Link Master/device.
stateNumber State of the FB's state machine in which the error occurred.
3.2.5. Events
The output parameter "events" provides the last 5 events for each port of the IO-Link Master. These events are based on
the IO-Link standard; they can either be events of the port or of the device. This distinction is made with the "source" bit in
Table 3-10: "LIOLink_typePortEventQualifier".
The "events" parameter is principally divided into various UDTs, which are listed in hierarchical order in the Tables below.
The UDT "LIOLink_typeEvents" is first assigned to the output parameter. It has an array containing the events of all 8 ports
(see Table 3-7: "LIOLink_typeEvents").
Table 3-7: "LIOLink_typeEvents"
The UDT "LIOLink_typePortEvents" in Table 3-8 in turn contains an array with 5 fields for storing the last 5 events.
Here, each event is described with an "eventCode" and an "eventQualifier" (see Table 3-9). This is defined in the IO-Link
specification.
Possible event codes are listed in Table 3-11 and in Table 3-12.
EventQualifier consists of the tags "instance", "source", "type" and "mode". Here, "instance" indicates the specific source
(instance) of an event, thus making it easier for the recipient to evaluate. In addition, the "source" tag indicates the source
of the event, while "type" indicates the event category and "mode" the event mode. These EventQualifiers are defined in
the IO-Link specification.
NOTE Depending on the "events.Port[x].event[y].eventQualifier.source" bit, there are two different Tables
that define event codes for IO-Link devices and the event codes for the ports of the master.
4. Master-Specific Blocks
4.1. LIOLink_Master
4.1.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).
NOTE This block replaces the previously available block "IO_LINK_MASTER_4" and "IO_LINK_MASTER_8".
Validity
The block is approved for the following IO-Link Masters:
• ET 200eco PN, CM 4x IO-Link + DIQ 12x 24VDC (6ES7148-6JE00-0BB0) firmware V1.0.0 or higher
NOTE The function "Master Backup" is only available for IO-Link devices that are specified for the IO-Link
standard V1.1 or higher.
IO-Link Masters from third parties are not supported by this block.
The FB is available in two variants for the S7-1200/1500 and S7-300/400. There exist minor differences (see Table 3-1:
Parameters of LIOLink_Device).
4.1.2. Parameter
Figure 4-1: LIOLink_Master
LIOLink_Master
status Word
diagnostics "LIOLink_typeDiagnostics"
len DInt
record
Array[*] of bytes Array[*] of bytes
S7-300/400:
Logical address of the IO-Link Master (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 Section 4.1.4).
diagnostics OUT "LIOLink_ Detailed diagnostic information of the FB (see
typeDiagnostics" Section 4.1.4)
len OUT DInt Length in bytes of the read/written data (net data)
record IN_OUT Array[*] of bytes Source/destination range for the data to be read/written.
Valid limits:
• 4-port master: 0..10239
• 8-port master: 0..17549
NOTE In order to use as few resources as possible, the block works directly in the memory area at the "record"
parameter. The data in the memory area are not allowed to change during a write operation, and may
only be read once a read action 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.
Data is transmitted in the form of raw data (array of bytes), i.e. the data cannot be interpreted and
NOTE
must not be changed or manipulated!
Before a dataset can be written, it must be backed up first.
If a DPV1 slave is configured via GSD file (GSD rev. 3 or later) and the DP interface of the DP master is
NOTE
set to "S7 compatible", then the block "LIOLink_Master" will not function correctly.
Set the interface of the DP master to "DPV1" instead.
status
Table 4-2: 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
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.
Table 4-3: "diagnostics" output from LIOLink_Master
Tag Description
status Last status code of the interface parameter "status" of the FB.
subfunctionStatus Status of system functions RDREC/WRREC or error code from IO-Link Master.
For detailed information, refer to the Online Help for the system function in question, or the
device manual of the IO-Link Master.
stateNumber State of the FB's state machine in which the error occurred.
subfunctionStatus Meaning
16#FFFF_FF01 Restore in progress
16#FFFF_FF02 Activation in progress
16#FFFF_FF03 Activation complete
16#FFFF_FF04 CRC check failed
16#FFFF_FF05 Blob data invalid
4.2. LIOLink_Toolchanger
4.2.1. Description
Port functions can be used to suspend and resume port diagnostics or error messages depending on the use case.
The function block supports you in the following tasks:
- "Suspend port operation"
- "Resume port operation"
The concept behind "suspend port operation" is to suppress all fault messages to the system, as it is an intentional action.
Basically, all error messages of the port and device in question are deleted after the suspension. In this state, it is assumed
that the user program continues to process data and Port Qualifier Information (PQI) and that these are therefore still
active and updated. However, a device can be removed from a port in a suspended state without triggering specific
events or diagnostics. System diagnostics will not report an error.
The concept behind "Resume Port Operation" is to resume the diagnostic mechanism. The current diagnostics are restored
and updated.
A possible use case can be a machine that undocks a specific tool, such as a gripper, in a magazine and docks another.
This docking and undocking can trigger events and diagnostics in the system or the user program, as communication and
the power supply to the device or tool are interrupted. Suppressing the diagnosis before undocking the "previous" tool
and resuming the diagnosis after docking the "new" tool eliminates this problem during operation.
NOTE For more information on Tool Changer use case and port functions, see IO-Link Integration – Profile for
PROFINET
.
Validity
The block is approved for the following IO-Link Masters:
• ET 200eco PN, CM 4x IO-Link + DIQ 12x 24VDC (6ES7148-6JE00-0BB0) firmware V5.1.0 or higher
LIOLink_Toolchanger
Time pollingPeriod
The "suspendResume" input interrupts or resumes the operation of a specific port (input "port"). Please
NOTE
note that the process data and the PQI are still active and updated even after a port has been
suspended. If a device is removed, the process data is empty or 0 after the port is suspended and PQI
indicates accordingly that the IO-Link data is invalid.
It is left to the user to handle the process data accordingly in the event of an interruption/resumption.
The FB LIOLink_MeasuredData is an example of how this can be done.
status
Table 4-6: Output "status" of LIOLink_Toolchanger
Status Meaning
16#0000 Job completed, no warning and no further detailing in the "diagnostics" output
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#7003 Suspension was performed successfully
16#7004 Resumption was performed successfully
16#8201 Unsupported port
16#8401 The IO-Link Master has reported an error code, see "diagnostics"
16#8402 Received dataset does not match operation
16#8403 Operation could not be completed in the specified time
16#8600 Internal state machine has reached an undefined state
16#8601 System function WRREC reports an error, see "diagnostics"
16#8602 System function RDREC reports an error, see "diagnostics"
diagnostics
In the event of an error, the "diagnostics" output gives detailed information about the pending error.
Tag Description
status Last status code of the interface parameter "status" of the FB.
subfunctionStatus Status of system functions RDREC/WRREC or error code from IO-Link Master (%W1: Error code from
IO-Link Master, %W0: ISDU error code).
For detailed information, refer to the Online Help for the system function in question, or the
device manual of the IO-Link Master/device.
stateNumber State of the FB's state machine in which the error occurred.
5. 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 dataset.
Instead, the user chooses it via the interface.
For every supported dataset, PLC data types are provided which facilitate simple reading/writing of the dataset.
Validity
These FBs are each available in two variants for the S7-1200/1500 and S7-300/400.
5.1.1. LIOLink_RF200
Description
The FB "LIOLink_RF200" facilitates reading and writing of various datasets via a simple user interface.
LIOLink_RF200
hwID/
HW_IO/DInt busy Bool
logicalAddr
Time pollingPeriod
Bool directParameter1
Bool systemCommand
Bool deviceAccessLocks
Bool vendorName
Bool vendorText
Bool productName
Bool productID
Bool productText
Bool serialNumber
Bool hwRevision
Bool fwRevision
Bool appSpecificName
Bool errorCount
Bool deviceStatus
Bool deviceStatusDetailed
Bool processIn
Bool processOut
Bool parameters
Bool eventHistory
Bool readerStatus
Bool tagStatus
Bool uidHistory
data
"LIOLink_RF200_typeAll" "LIOLink_RF200_typeAll"
S7-300/400:
Logical address of the IO-Link Master (module or
submodule)
cap IN Int Access point (Client Access Point):
(optional)
S7-1200/1500:
When using Siemens IO-Link Masters, is automatically
detected, and is therefore optional. If the parameter is
changed, automatic detection is not active.
S7-300/400:
Automatic detection is not implemented in this version.
The access point must therefore be set manually.
Normally, it has the value 0xB400 or 0x00E3, and is
specified in the respective manual.
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
pollingPeriod IN Time S7-1200/1500:
Variably adjustable time that the block waits until the
dataset is transmitted.
Default value: 100 ms
S7-300/400:
The functionality is not implemented in this version,
which is why the parameter does not exist here.
directParameter1 IN Bool Read "Direct parameter page 1"
systemCommand IN Bool Write system command:
Device- Reset: 0x80:
Reset to factory settings: 0x82
deviceAccessLocks IN Bool Read/write locking functions for device access
vendorName IN Bool Read vendor name
vendorText IN Bool Read vendor text
productName IN Bool Read product name
productID IN Bool Read product ID
productText IN Bool Read product text
serialNumber IN Bool Read serial number
hwRevision IN Bool Read hardware version
fwRevision IN Bool Read firmware version
appSpecificName IN Bool Read/write user-specific marking
errorCount IN Bool Read error counter
deviceStatus IN Bool Read device status
deviceStatusDetailed IN Bool Read detailed device status
processIn IN Bool Read last process image of the inputs
processOut IN Bool Read last process image of the outputs
parameters IN Bool Read parameters
eventHistory IN Bool Read event history
readerStatus IN Bool Read reader status
tagStatus IN Bool Read transponder status
Article ID: 82981502 V7.2 01/2025 © Siemens 2025 30
Device-Specific Blocks
Name P type Data type Comment
uidHistory IN Bool Read UID history
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 Status of LIOLink_Device (see Section 3.1.3)
diagnostics OUT "LIOLink_typeDiag Diagnostic information of LIOLink_Device (see
nostics" Section 3.1.3)
data IN_OUT "LIOLink_RF200_t Device-specific target/source range
ypeAll"
NOTE For each operation, only one dataset can be read or written. The FB reads/writes the dataset 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 Section 3.1.3).
Description
The FB "LIOLink_RF200_Read" reads a data block from the transponder.
Parameter
Figure 5-2: LIOLink_RF200_ReadTag
LIOLink_RF200_ReadTag
USInt version
identData
Variant Variant
Example: Start address 0.0, the value "0" must be entered for
"portAddr".
version IN USInt IO-Link version of the reader
11: IO-Link version 1.1
10: IO-Link version 1.0
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 DWord Error code in the event of an error, see Section 5.1.6.
presence OUT Bool Presence bit
This bit is only set if a transponder is in the reader's field.
identData IN_OUT Variant Data range to which the read data will be written.
Description
The FB "LIOLink_RF200_Antenna" switches the antenna of a SIMATIC RF200 IO-Link reader on or off.
NOTE In normal operation, this command is not needed, as the antenna is always switched on after the
reader is switched on.
Parameter
Figure 5-3: LIOLink_RF200_SwitchAntenna
LIOLink_RF200_SwitchAntenna
presence Bool
Example: Start address 0.0, the value "0" must be entered for
"portAddr".
version IN USInt IO-Link version of the reader
11: IO-Link version 1.1
10: IO-Link version 1.0
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 DWord Error code in the event of an error, see Section 5.1.6.
presence OUT Bool Presence bit
This bit is only set if a transponder is in the reader's field.
Description
The FB "LIOLink_RF200_Write" writes a data block from the user program to a transponder.
Parameter
Figure 5-4: LIOLink_RF200_WriteTag
LIOLink_RF200_WriteTag
USInt version
identData
Variant Variant
Example: Start address 0.0, the value "0" must be entered for
"portAddr".
version IN USInt IO-Link version of the reader
11: IO-Link version 1.1
10: IO-Link version 1.0
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 DWord Error code in the event of an error, see Section 5.1.6.
presence OUT Bool Presence bit
This bit is only set if a transponder is in the reader's field.
identData IN_OUT Variant Data range from which the data to be written are read
NOTE The following information only applies for the FBs "LIOLink_RF200_ReadTag",
"LIOLink_RF200_SwitchAntenna" and "LIOLink_RF200_WriteTag".
• Directly on the reader by counting off the blink pattern of the red error LED
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
5.2. SIRIUS
5.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:
Validity
These FBs are each available in two variants for the S7-1200/1500 and S7-300/400.
LIOLink_3SU1_ElecModule
Time pollingPeriod
Parameter
Bool
Page0
system
Bool
Commands
Bool vendorName
Bool vendorText
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 Master (module or submodule)
cap IN Int Access point (Client Access Point):
(optional)
S7-1200/1500:
When using Siemens IO-Link Masters, is automatically
detected, and is therefore optional. If the parameter is
changed, automatic detection is not active.
S7-300/400:
Automatic detection is not implemented in this version. The
access point must therefore be set manually.
Normally, it has the value 0xB400 or 0x00E3, and is specified
in the respective manual.
Article ID: 82981502 V7.2 01/2025 © Siemens 2025 37
Device-Specific Blocks
Name P type Data type Comment
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
pollingPeriod IN Time S7-1200/1500:
Variably adjustable time that the block waits until the dataset
is transmitted.
Default value: 100 ms
S7-300/400:
The functionality is not implemented in this version, which is
why the parameter does not exist here.
parameterPage0 IN Bool Read parameter page 0
systemCommands IN Bool Write system commands
vendorName IN Bool Read vendor name
vendorText IN Bool Read vendor text
productName IN Bool Read product name
productID IN Bool Read product ID
fwRevision IN Bool Read firmware version
appSpecificName IN Bool Read/write user-specific marking
diagnostics IN Bool Read diagnostics (dataset 92)
statistics IN Bool Read diagnostics (dataset 94)
parameters IN Bool Read/write parameter (dataset 131)
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 Status of LIOLink_Device (see Section 3.1.3)
diagnostics OUT "LIOLink_ Diagnostic information of LIOLink_Device (see Section 3.1.3)
typeDiagnostics"
data IN_OUT "LIOLink_3SU1_ Device-specific target/source range
ElecModule_typeAll"
NOTE For each operation, only one dataset can be read or written. The FB reads/writes the dataset associated
with the first parameter that is set.
6. 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 web page 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 device. It is generally
valid for IO-Link devices.
Validity
These FBs are only available for the S7-1200/1500.
NOTE Note that the device profiles are only available for IO-Link devices that are specified for the IO-Link
standard V1.1 or higher.
6.1. LIOLink_AdjSwitchingSensor
6.1.1. Description
The FB "LIOLink_AdjSwitchingSensor" offers a unified interface for access to and parameterization of IO-Link devices that
support the Smart Sensor profile.
In particular, the block can be used by sensors that can be assigned to the measuring device profile type 2, i.e. IO-Link
devices that support the smart sensor profile "Adjustable Switching Sensors".
Adjustable switching sensors (AdSS) within the Smart Sensor profile are devices that provide exactly one binary output
signal (switching signal). The setpoint of this switching output can be defined by the application either by entering your
own setpoint during configuration or by using a teach-in procedure.
In addition, various teach-in methods are possible, such as 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.
The switching point logic (high-active / low-active) can be defined by the application.
Note that if the FB "LIOLink_AdjSwitchingSensor" is called multiple times simultaneously for the same
NOTE
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).
6.1.2. Parameter
Figure 6-1: LIOLink_AdjSwitchingSensor
LIOLink_AdjSwitchingSensor
Bool teachRequest
Int teachFunction
6.1.3. Operation
6.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)
No function is performed.
• rd_all (1)
With this function, the current switch 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 Section 6.1.3.2).
If the input "backupEnable" is set, 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.
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:
During a teach process, 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.
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.
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.
The teach process was successful if the outputs "done" = TRUE and "status" = 16#0000.
Alternatively, "teachPoint2" can also be taught in first.
A teach point can also be taught in several times during the two-value teach-in process.
An abort of the teach function is available with "teachFunction" = 4 after teach-in of the first teach point. The teach
process can be aborted by setting "teachFunction" = 4 and making a rising edge at the "teachRequest" input.
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.
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".
status
Table 6-2: Error codes of the "status" output
diagnostics
In the event of an error, the "diagnostics" output gives detailed information about the pending error.
Tag Description
status Last status code of the interface parameter "status" of the FB.
subfunctionStatus Status of LIOLink_Device, see Section 3.1.4.
stateNumber State of the FB's state machine in which the error occurred.
6.2. LIOLink_IdentAndDiag
6.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 that if the FB "LIOLink_IdentAndDiag" is called several times at the same time for the same master
NOTE
(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).
6.2.2. Parameter
Figure 6-2: LIOLink_IdentAndDiag
LIOLink_IdentAndDiag
functionClass
String[32] appSpecificTag Array[0..31] of UInt
IDList
Identification
String[32] functionTag "LIOLink_typeIdentificationObjects"
Objects
String[32] locationTag deviceOK Bool
deviceStatus Byte
detailedDeviceS
Array[0..63] of DWord
tatus
Function selection
Different functions can be controlled at the function block via the input parameter "function". The programmed function
is executed with a rising edge at the "execute" input:
• no_func (0)
No function is performed.
• rd_all (1)
All current identification and diagnostic data of the IO-Link device are read out and displayed at the corresponding
outputs. All parameters stored in Table 6-6 are read on the device. If an optional parameter cannot be read, the
default value is issued.
• rd_diag (2)
Read back of the current diagnostic parameter values from the device. In contrast to "function" = 1, only "deviceStatus"
and "detailedDeviceStatus" are read back. If these parameters cannot be read, the default values are provided.
• wr_ident (3)
The values provided at the inputs "applicationSpecificTagIn", "locationTagIn" and "functionTagIn" are written on the IO-
Link device. These inputs are also written directly to their respective outputs. If "locationTagIn" or "functionTagIn"
cannot be written, the default values are written to the outputs and the output "status" = 16#4000.
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 6-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 Section 6.2.4).
status
Table 6-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.
xx contains the index (hex) of the parameter.
diagnostics
In the event of an error, the "diagnostics" output gives detailed information about the pending error.
Table 6-8: "diagnostics" output
Tag Description
status Last status code of the interface parameter "status" of the FB.
subfunctionStatus Status of LIOLink_Device, see Section 3.1.4.
stateNumber State of the FB's state machine in which the error occurred.
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 IO. The device cannot perform its
intended function.
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 state
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 Event Codes 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 default 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.
6.3. LIOLink_MeasuredDataChannel
6.3.1. Description
The FB "LIOLink_MeasuredDataChannel" provides a unified interface for access to IO-Link devices that support the Smart
Sensor profile.
In particular, the block can be used by sensors that support the Smart Sensor profile type 3 ("Digital Measuring Sensors")
and type 4 ("Digital Measuring Switching Sensors"). However, only 4.1 and 4.2 are supported for type 4 in the current
version.
6.3.2. Parameter
Figure 6-3: LIOLink_MeasuredDataChannel
LIOLink_MeasuredDataChannel
valueReal Real
valueDInt DInt
scale Int
SSCn.1 Bool
SSCn.2 Bool
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:
valueStatus Description
1 The process data are invalid
2 No data available.
3 The process data are outside the upper limit.
4 The process data are outside the lower limit.
5 The status is not defined.
6.4. LIOLink_MultiAdjSwitchingSensor
6.4.1. Description
The FB "LIOLink_MultiAdjSwitchingSensor" offers a unified interface for access to and parameterization of IO-Link devices
that support the Smart Sensor Profile.
In particular, the block can be used by sensors that can be assigned to the following measuring device profiles:
• Single-value teaching
• Dual-value teaching
• Dynamic teach-in
Note that if the FB "LIOLink_MultiAdjSwitchingSensor" is called several times at the same time for the
NOTE
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).
LIOLink_MultiAdjSwitchingSensor
Bool teachRequest
Int teachFunction
For SSP types 2.7 and 4.x, the following also applies:
11: single_value: Single value teach-in SP2
12: two_value: Dual-value teach-in SP2
13: dynamic: Dynamic teach-in SP2
See Section 0
teachTimer IN Time Defines the duration of the dynamic teach time.
A value of "0" deactivates the activation of the automatic stop
command.
The teach function "teach_Stop" can always be used to trigger the
dynamic teach stop and thus overwrites the teach timer.
applyAuto IN Bool Defines the behavior during a two-value teach process.
FALSE = automatic acceptance deactivated
The acceptance function must be triggered by the user in order to
evaluate the collected teach points and activate the new setpoint.
TRUE = automatic acceptance activated
If two teach points have been successfully taught in, automatic
acceptance is triggered. No activity from the user is required.
teachRequest IN Bool A rising edge triggers a teach step in accordance with the selected
teach function at the "teachFunction" input.
teachFunction IN Int Teach function which will be executed with a teach request at the
input "teachRequest":
0: no teach function
1: Start teach step 1
2: Start teach step 2
3: Accept two-value teach results
4: Abort current teach sequence
6.4.3. Operation
LIOLink_typeConfigMultiAdjSwSensor
Tag Data type Description
logic Int Switching point logic; 0: high active; 1: low active;
mode Int Switching point mode; 0: disabled (1), single point, 2:
windows, 3: dual-point;
hystDint DInt Switching point hysteresis (Dint)
hystReal Real Switching point hysteresis (Real)
The input tag "paramIn" and the output tag "paramOut" have the data type Struct
"LIOLink_typeParamConfigMultiAdjSwSensor". This data type consists of all possible setpoints for a channel.
Table 6-20
LIOLink_typeParamMultiAdjSwSensor
Tag Data type Description
sp1Dint DInt Setpoint 1 (DInt)
sp1Real Real Setpoint 1 (Real)
sp2Dint DInt Setpoint 2 (DInt)
sp2Real Real Setpoint 2 (Real)
More information about the functions of each configuration parameter and setpoint can be found under the "Profiles"
section of the IO Link Community web page.
1 Hyst is not relevant if the switching point mode is equal to a dual point.
Article ID: 82981502 V7.2 01/2025 © Siemens 2025 61
Profile Blocks
The configuration parameters "hyst" as well as the setpoints "sp1" and "sp2" can be in either Dint or Real format,
depending on the supported functional class of the device.
The FB recognizes which functional class is supported by the device and reads/writes this information in the correct
format. As a helpful tip, the output "isRealDint" indicates in which format the device supports the values.
It is recommended that you first run a rd_all function to read out all configurations and setpoints. This updates the
isRealDint output, and then you can adjust the appropriate tags to match the supported format.
• Deactivation mode:
• Single-point mode
• Window mode
• Dual-point mode
Single-point mode
In single-point mode, the switching state changes when the current value reaches the SP1 setpoint. This change occurs
when values rise or fall. The SP2 setpoint is not relevant in this mode. This mode is typically used for object detection or
quantity detection.
Window mode
In window mode, the switching state changes when the current measured value reaches either the setpoint SP1 or the
setpoint SP2. This change occurs when values rise or fall.
If the measured value is between SP1 and SP2 when the Smart Sensor is switched on, the behavior depends on the
manufacturer/provider-specific design of the device.
Deactivation mode:
The switching state in deactivation mode must be "inactive".
6.4.3.3. 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)
No function is performed.
• rd_all (1)
With this function, the current switch signals and parameter values are read by the sensor. The read values are
available at the "configOut" and "paramOut" outputs.
• wr_conf (2)
This function causes the previously created values within the "configIn" to be written to the sensor.
• wr_param (3)
This function causes the previously created values within the "paramIn" to be written to the sensor.
• teach (4)
This function causes the block to switch over to the teach process (see Section Teach-In).
For each function, the "teachChannel" is used to first select the channel and then edit the function. The channel is
selected and the function is processed in an execution (in a rising edge in the "execute" input) of the block. More
information about "teachChannel" can be found here: 6.4.3.4.
• Switching Signal Channel (SSC) = -1: only applies to SSP types 2.1 to 2.6
• SSC1.1=1;
• SSC1.2=2;
• SSC2.1=11;
• SSC2.2=12;
• SSC3.1=21;
• SSC3.2=22;
• SSC4.1=31;
• SSC4.2=32
More information about SSP types and their properties can be found on the "Profiles" section of the IOLink web page.
6.4.3.5. 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.
There are seven teach processes available, which can be selected via the "teachMode" input:
• For SSP types 2.7 and 4.x, the following also applies:
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 on the SSC1.2 are listed below:
1. Set inputs "teachChannel" = 2 (SSC1.2), "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).
b. Set input "teachFunction" = 3.
c. Set input "teachRequest" = FALSE.
d. Set input "teachRequest" = TRUE.
If "applyAuto" = TRUE, then "teachApply" is triggered automatically.
The teach process was successful if the outputs "done" = TRUE and "status" = 16#0000.
Dynamic teach-in
The steps for a dynamic teach-in on the SSC2.2 are listed below:
1. Set inputs "teachChannel" = 12 (SSC2.2), "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.
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".
7. Master Copies
7.1. LIOLink_MeasuredData
7.1.1. Description
This FB is used to read and process the process data, regardless of which device is connected to the IO-Link Master. The FB
first identifies the connected device and then reads and prepares its process data accordingly.
Supported devices for this FB can be found in a "database" in the form of a static array of the "Struct" data type. Some
information is required from each device or sensor so that the FB works correctly and supports the device, e.g. Vendor ID,
Device ID, Offset, Scale.
In the event of a device error or a specific Operation, such as a tool changer (see Section 4.1), the user can specify a
substitute value which is then used as the process value for the specific sensor.
This FB serves as a Master template and can be customized by the user on the fundamental of their use case and their
sensors and devices.
This FB can be helpful when replacing sensors, especially if different sensors from the same or different manufacturers
need to be replaced. If a different sensor type is used, it must be re-parameterized, but the FB would automatically detect
the new sensor type and read out its process value as long as the new sensor type is supported by the FB. This would
make it possible to replace the sensor with a different sensor type without making any changes to the user program or
TIA project.
Validity
The FB is only available for S7-1200/1500.
Requirements
The ports of the IO-Link Master that are used must be activated in the device configuration of the IO-Link Master (Port
Enable).
Due to the evaluation of the PQI, it is essential to set the process data length of the port to IO-Link 32 I/ 32 O + PQI
(maximum). This means that different process data lengths from different sensors do not cause any problems when they
are exchanged.
7.1.2. Parameter
Figure 7-1: LIOLink_MeasuredData
LIOLink_MeasuredData
scale Real
diagnostics "LIOLink_typeDiagnostics"
Qualifier
The "qualifier" input indicates the validity of the data, with FALSE signaling that the process data is invalid, and the
substitute value ("substituteValue" input) is used instead, while TRUE means that the process data is valid. For example,
the "qualifier" input must be set to FALSE if port operation is to be interrupted (see Section 4.2.1) so that the substitute
value is used instead of the process data. This also applies if an error occurs or if maintenance work needs to be carried
out; in such cases, the "qualifier" input is set to FALSE to ensure that the invalid process data is replaced by the substitute
value.
Device Detection
The FB first tries to find or recognize the device that is connected to the given port ("port" input). Device detection is
triggered during the first CPU cycle or when the "checkDevice" input is triggered.
The FB uses the FB LIOLink_Device to read the device ID and vendor ID of the device. In this way, it recognizes the
connected device. An attempt is then made to find this information, Device ID and Vendor ID, in the "sensor database"
(static array "statSensors").
The static tag in the form of an array "statSensors" is an array with different types of sensors. Each element of this array
represents a sensor type. Each sensor type has the same information that is required for its identification and for
processing the process data. This information is structured in the "LIOLink_typeSensorInfo" data type.
LIOLink_typeSensorInfo
Tag Data type Description
vendorID DInt Manufacturer ID of the sensor
deviceID DInt Device ID of the sensor
offset Int Offset for the value from the sensor
scale Real Scaling of the value from the sensor
Default value: 1.0 (= no scaling)
fbState DInt FBState, in which the pre-processing of the IO data of this
specific sensor is carried out.
FBState must be unique for each sensor.
After the device is found in the statSensors array by comparing the readout device ID and vendor ID with the
corresponding information in the array, the element that contains exactly the same information is assigned to the
statCurrentSensor static tag. This tag then represents the currently connected sensor and is used to process the process
data.
As the device detection process is an acyclical process and can take several cycles, the substitute value (input
"substituteValue") is assigned to the process values or outputs. This scenario remains valid until the acyclical calls have
been completed.
For the "hwID" input, use the hardware identifier of the port of the IO-Link Master to which the sensor is
NOTE
connected. Each port of the IO-Link Master has a hardware identifier.
If the IO-Link data is valid, the FB switches to a state machine in which each state corresponds to a specific sensor type. In
each of these states, the sensor data is extracted from the entire process image (previously read out with GETIO) and
processed accordingly depending on the sensor type.
As different sensors can supply process data at different positions in the process image and with different accuracies,
offsets and scaling, a separate status is used for each sensor type. This enables a high degree of flexibility, as the system is
able to seamlessly integrate different sensor types into the same application.
The state in which the machine is operating is determined directly by the detected sensor, and the active state is stored in
the static structure "statCurrentSensor".
3. The new sensor that was added to "statSensors" in step 1 has default values. We have to change these values with
those of the new sensor. Here vendorID, deviceID, offset, scale are required and can be found on the IODDfinder
website. In addition, fbState is required and corresponds to the new state that was added in step 2.
4. Add the new state created in step 2 to the state machine in the "Prepare Measured Data" region. First extract the
process value from statIOData, bearing in mind that the position of the value may vary depending on the sensor.
Convert the process value according to its accuracy and data type. You can use the tempWordMeasurementValue and
tempIntMeasurementValue temporary tags to support data extraction and conversion.
Once the value is processed, assign it to the statValueDInt and statValueReal static output tags. The statValid flag
should be set to true and statValueStatus should be updated to show that the values are valid. However, the validity
(statValid) and status (statValueStatus) of the process value should be determined on the basis of certain criteria, e.g.
whether the value is within the expected range. The handling of scenarios, such as values that lie outside the
expected range, is up to the user to decide how best to deal with such situations.
Options for these outputs can be seen in the comment area (see Section 7.1.2).
Status
In addition to the status information read from "LIOLink_Device", the FB has the following additional status codes.
Table 7-4: Output "status" of LIOLink_MeasuredData
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 receipt of a new job (rising edge 'checkDevice')
16#7002 Subsequent call during active processing without additional information.
16#7003 Subordinate FB (LIOLink_Device) is busy, machine status is FB_STATE_ENABLING
16#7004 Reading the process image is active and successful
16#8600 Error due to an undefined state in the state machine
16#8601 Error due to an undefined state in the state machine; sensor state was not found in
FB_STATE_ENABLING;
16#8603 IO Link Master has returned an error code, see "diagnostics"; Invalid IO-Link data
16#8604 IO Link Master has reported an error code, see "diagnostics"
16#8605 Qualifier is incorrect
8. Useful Information
8.1. IO-Link Fundamentals
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, directly 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."5
Manufacturer
IO-Link is supported in a technical committee by many famous manufacturers, among them Siemens.
Connection
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 wiring.
5 https://io-link.com/
Article ID: 82981502 V7.2 01/2025 © Siemens 2025 72
Useful Information
8.1.2. Configuring the IO-Link Master
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 the IO-Link Master module in the editor area and select "Start device tool…".
• In the device list, right-click the IO-Link Master module and select "Start device tool…".
• Assigning the respective sensors and actuators (e.g. IO-Link devices) to the ports of the IO-Link Master.
3
2
4
5
7
Legend:
1. Project directory
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
For information on library use in general, see the Guide to Library Use:
NOTE
https://support.industry.siemens.com/cs/ww/en/view/109747503
All blocks in the library were created in accordance with the programming style guide:
NOTE
https://support.industry.siemens.com/cs/ww/en/view/81318674
• How do you open, edit and upgrade global libraries in the TIA Portal?
https://support.industry.siemens.com/cs/ww/en/view/37364723
• Which elements of STEP 7 (TIA Portal) and WinCC (TIA Portal) can you store in a library as Type or as Master Copy?
https://support.industry.siemens.com/cs/ww/en/view/109476862
• When starting TIA Portal V13 and higher, how do you get a global library to open automatically and use it as corporate
library, for example?
https://support.industry.siemens.com/cs/ww/en/view/100451450
9. Appendix
9.1. Service and support
SiePortal
The integrated platform for product selection, purchasing and support - and connection of Industry Mall and Online
support. The SiePortal home page replaces the previous home pages of the Industry Mall and the Online Support Portal
(SIOS) and combines them.
• Support
In Support, you can find all information helpful for resolving technical issues with our products.
• mySieportal
mySiePortal collects all your personal data and processes, from your account to current orders, service requests and
more. You can only see the full range of functions here after you have logged in.
You can access SiePortal via this address: sieportal.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: support.industry.siemens.com/cs/my/src
No. Topic
\1\ Siemens Industry Online Support
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
https://new.siemens.com/global/en/products/automation/industrial-communication/io-link.html
\4\ Web page 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
\7\ Website of the IO-Link Community – Files
https://io-link.com/de/Download/Download.php
\8\ IO-Link Integration – Profile for PROFINET
https://io-link.com/de/Download/Download.php