0% found this document useful (0 votes)
455 views18 pages

Siemens Io-Link-Instruction For The First Steps

This document provides instructions for configuring an IO-Link master module and connecting an IO-Link sensor device. It describes integrating an IO-Link library, configuring the IO-Link port on the master module to match the process data of the sensor, and assigning the sensor's process data values in the project. Warnings and disclaimers are also provided regarding safety and liability.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
455 views18 pages

Siemens Io-Link-Instruction For The First Steps

This document provides instructions for configuring an IO-Link master module and connecting an IO-Link sensor device. It describes integrating an IO-Link library, configuring the IO-Link port on the master module to match the process data of the sensor, and assigning the sensor's process data values in the project. Warnings and disclaimers are also provided regarding safety and liability.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

u-remote

UR67 IO-Link master in TIA Portal


Instruction for the first steps with IO-Link
Instruction for the first steps with IO-Link

Revision history

Version Date Change log

01 01.2017 First draft

Warning and disclaimer

Program Examples / Application Notes


Warning:
Controls may fail in unsafe operating conditions, causing uncontrolled operation of the controlled devices.
Such hazardous events can result in death and / or serious injury and / or property damage. Therefore, there
must be provide safety equipment/ electrical safety design or other redundant safety features that are inde-
pendent from the automation system.

Disclaimer:
This Example / Application Note does not relieve you of the obligation to handle it safely during use, installa-
tion, operation and maintenance. Each user is responsible for the correct operation of his control system.
By using this program example / application note prepared by Weidmüller, you accept that Weidmüller can-
not be held liable for any damage to property and / or personal injury that may occur because of the use.

Note:
The application examples do not represent customer-specific solutions, they are simply intended to help for
typical tasks. The user is responsible for the proper operation of the described products. This application ex-
ample does not relieve you of the obligation of safe use, installation, operation and maintenance.
Application examples are not binding and do not claim to be complete in terms of configuration as well as
any contingencies.
By using this Application Example, you acknowledge that we cannot be held liable for any damages beyond
the described liability regime. We reserve the right to make changes to this sample application at any time
without notice.
In case of discrepancies between the proposals in the application example and other Weidmüller publica-
tions, like manuals, such contents always have more priority to the examples.

We assume no liability for the information contained in this document.


Our liability, for whatever legal reason, for damages caused by the use of the examples, instructions, pro-
grams, project planning and performance data, etc. described in this application example is excluded.

Security notes:
In order to protect equipment, systems, machines and networks against cyber threats, it is necessary to im-
plement (and maintain) a complete state-of-the-art industrial security concept. The customer is responsible
for preventing unauthorized access to his equipment, systems, machines and networks. Systems, machines
and components should only be connected to the corporate network or the Internet if necessary and appro-
priate safeguards (such as firewalls and network segmentation) have been taken.

Contact
Weidmüller Interface GmbH & Co. KG
Klingenbergstraße 16
32758 Detmold, Germany
T +49 5231 14-0
F +49 5231 14-292083
[email protected]
www.weidmueller.com

01/02.2017 2
Instruction for the first steps with IO-Link

Content

1. Setup of the sample application 4


1.1 Used components 4
1.2 Integration of the IO-Link library 4
2. Sample application – IO-Link Communication 6
2.1 Network view 6
2.2 Connecting the IO-Link Sensor to the IO-Link Master module 6
2.3 Configuring the IO-Link Port 7
2.4 Assign the IO-Link process raw data 8
3. Change IO-Link device parameter by acyclic services 9
3.1 Working with the IO-Link library 9
3.2 Sample IO-Link device data exchange 16

01/02.2017 3
Instruction for the first steps with IO-Link

1. Setup of the sample application


This application note describes commissioning of the IO-Link master and device.
The commissioning of the PROFINET network could be found in the manual of the UR67
module and is available to download from the Weidmüller website.

1.1 Used components


TIA Version V14
Additional library: IO_LINK_Library_V14.zal14

CPU 1212C AC/DC/Rly


Article number: 6ES7212-1BE31-0XB0
Firmware version: V3.0

IO-Link Master UR67-PN-HP-8IOL-12-60M


Order Number: 2426260000

IO-Link Device
Ifm KQ5101

1.2 Integration of the IO-Link library


To be able to use the IO-Link library for acyclic reading and writing in your project you
have to download the library from the Siemens support website and must first integrate
them into the TIA portal.

• Extract the zip archive “82981502_IO_LINK_Library_V3.zip” on your hard disk. This


archive includes the STEP 7 V5.5 and the STEP 7 V14 libraries.
• Open the project view and go to the “Libraries” tab. After a right-click in the “Global li-
braries” choose “Retrieve library“. Open the “IO_LINK_Library_V14.zal14” library file.

• Select the target directory, where the library should be stored.

01/02.2017 4
Instruction for the first steps with IO-Link

• Now the library is available in your “Global libraries”.

01/02.2017 5
Instruction for the first steps with IO-Link

2. Sample application – IO-Link Communication

2.1 Network view

2.2 Connecting the IO-Link Sensor to the IO-Link Master module


The UR67-PN-HP-8IOL-12-60M has both port classes (type A and B) integrated. Take
care about the different pin assignment:

Interface 1...4 – I/O port class type A


 Pin 2 is assigned with an additional digital IO channel.
Pin: Signal: Function:
1 L+ IO-Link sensor supply +24V
2 Inx CH B: Digital Input

3 L- IO-Link Sensor supply GND


4 C/Q CH A: IO-Link Data communica-
tion
or IO channel
5 n.c. not connected

Interface 5...8 – I/O port class type B


 Provides an additional supply voltage for devices with an increased power demand.
Pin: Signal: Function:
1 L+ IO-Link Sensor supply +24V
2 UAUX+24V additional supply voltage
(galvanically isolated)
3 L- IO-Link Sensor supply GND
4 C/Q CH A: IO-Link Data communication
or IO channel
5 GND UAUX additional supply voltage

Check the connectivity of the sensor


 The connection diagram shows that port class A is appropriate to the KQ5101, be-
cause it is no additional supply voltage necessary:

01/02.2017 6
Instruction for the first steps with IO-Link

It is also possible to connect this sensor to a port class B (wire 2 and 5 are not used).

2.3 Configuring the IO-Link Port


As default all ports of the UR67 IO-Link master module are configured as digital inputs:

The IO-Link process data length is specified by the device. 0 to 32 bytes of input and out-
put process data is possible, but not all values and combinations of input and output data
length can be configured in the master. In case of no matching value choose the next
higher value. The necessary total bit length could be found in the IO device description of
the sensor:
KQ5101 Process Data Input Total Bit length = 16

• Delete the Digital input on slot 1 2 (Port 1)

• Choose in the hardware catalogue “Submodules”, “IOL- INPUT” and move the “IO-
Link 2 Byte Input” to the free slot.

01/02.2017 7
Instruction for the first steps with IO-Link

• Now port 1 is preconfigured for IO-Link communication. The address range of the
input process data is from input byte 68 up to 69.

2.4 Assign the IO-Link process raw data


The process data of the most devices are mixed. To assign the meaning of each bit the
details in the IO device description are helpful:

KQ5101

Name Description Datatype Bittoffset Bitlength Value


Range...
Process value current process value IntegerT 4 12 0 to 1645
PDV1

Switch state state of the switch BooleanT 0 TRUE = active


BDC1 FALSE = inactive

PDV1 BDC1
15 8 7 4 na na na 0
IB68 IB69

With these details the process data could be assigned.

01/02.2017 8
Instruction for the first steps with IO-Link

P1_IOL_Switch_State
For the status of the switch state the input bit 69.0 can be used from the process raw data.

P1_IOL_Process_Value
The process value has an offset of 4 bits.
Therefore it should be adjusted for further applications for example by the use of the
shift right (SHR) function:

3. Change IO-Link device parameter by acyclic services


The process data of the IO-Link devices are transmitted cyclically.
Device data like parameters, identification data and diagnostic information’s are transmit-
ted acyclically and at the request of the IO-Link master.

3.1 Working with the IO-Link library


By using the IO-Link library it is possible to exchange device data. The use of index and
sub-index ranges allows a target access to the device for reading out and changing the
device parameters. Further details about the parameters, their index and sub-index could
be found in the IO device description of the device.

The IO-Link library is no fixed part of the TIA portal or the SIMATIC Manager. A descrip-
tion how to integrate this library is found in chapter 1.2 of this application note.

01/02.2017 9
Instruction for the first steps with IO-Link

To communicate with IO-Link devices connected to the UR67 IO-Link master module use
the IO_LINK_DEVICE library block. This function supports the following tasks:

 (Re) configuration of the IO-Link device


 Diagnostics of the IO-Link devices
 Executing IO-Link port functions
 Saving and recovering IO-Link device parameters

Depending on the used CPU type there are two different function blocks available:
 S7-300/400
 S7-1200/1500

For using the library block in the user program it must be copied to the project:

• Drag the required IO_LINK_DEVICE block via drag and drop to the user program.

• For a cyclic call open the “Main [OB1]” and drag the “IO_LINK_DEVICE” function
block into any network.

01/02.2017 10
Instruction for the first steps with IO-Link

• A request to enter the data block will pop up. Assign the values and confirm them
with the OK button.

• Now the parameters have to be added to the “IO-LINK_DEVICE” function block.

01/02.2017 11
Instruction for the first steps with IO-Link

3.1.1 Input Parameters

REQ
Data type: BOOL
Memory area: I, Q, M, D

Positive edge triggers data transfer

ID
S7-300/400
Data type: DWORD

Logic address of the IO-Link communication module:

S7-1200/1500
Data type: HW_IO
Memory area: I, Q, M, D, L, const

Hardware identifier of the IO-Link communication module:

01/02.2017 12
Instruction for the first steps with IO-Link

CAP
Data type: INT (S7-300/400)
DINT (S7-1200/1500)
Memory area: I, Q, M, D, L const

Access point of the IO-Link device: 255DEZ

RD_WR
Data type: BOOL
Memory area: I, Q, M, D, L, const

Read or write access:


0: Read
1: Write

PORT
Data type: INT
Memory area: I, Q, M, D, L, const

The port number of the connected device which should be addressed.


Possible values:

01/02.2017 13
Instruction for the first steps with IO-Link

IOL_INDEX
Data type: INT
Memory area: I, Q, M, D, L const

Index of IO-Link device data, possible values 0...32767

IOL_SUBINDEX
Data type: INT
Memory area: I, Q, M, D, L, const

Sub-Index of IO-Link device data, possible values 0: Total record


1...255: Parameter from record

LEN
Data type: INT
Memory area: I, Q, M, D, L, const

Length of the net data to be written:


Read: 0...232 -> not relevant
Write: 1...232

3.1.2 Output Parameters

DONE_VALID
Data type: BOOL
Memory area: I, Q, M, D, L

Validity of Data: 0: not valid


1: valid

BUSY
Data type: BOOL
Memory area: I, Q, M, D, L

Job in progress: 0: completed (valid or error)


1: being processed

ERROR
Data type: BOOL
Memory area: I, Q, M, D, L

Error status flag: 0: No error


1: Abort with error

STATUS
Data type: DWORD
Memory area: I, Q, M, D, L

Status output:
ERROR flag reset = status of the function
ERROR flag set = function error

01/02.2017 14
Instruction for the first steps with IO-Link

DW#16#000x 0000 (x: Process step 0...3)

IOL_STATUS
Data type: DWORD
Memory area: I, Q, M, D, L

IO-Link error status

ERROR flag reset: DW#16#0000 0000

ERROR flag set and


IO-Link error: error information
Communication error: specification to which SFB the status belongs

RD_LEN
Data type: INT
Memory area: I, Q, M, D, L const

Length of the read net data

3.1.3 Input and output Parameters

RECORD_IOL_DATA
Data type: ARRAY [0...231] of BYTE
Memory area: I, Q, M, D, L

Source and target area for the IO-Link device data to be read or written:

01/02.2017 15
Instruction for the first steps with IO-Link

3.2 Sample IO-Link device data exchange


Preparation of the “IO_LINK_DEVICE” function block in OB1:

Direct control of the “IO_LINK_DEVICE” function block with a “Watch and force table”:

Reading the “Product Text” of the IO-Link device


This example should show how to read out IO-Link device data. To find out the different
supported functions and their addresses the device description of the IO-Link device con-
tains all necessary information’s.

Overview as an extract about the KQ5101 device data

Name Index Subindex Length Access Default


BitOffset Rights
Product-ID 19 Sub 0 Max 32 Byte ro
Product Text 20 Sub 0 Max 32 Byte ro CAPACITIVE SENSOR
Hardware version 22 Sub 0 Max 32 Byte ro

Name Index SubIndex Length Access Default

01/02.2017 16
Instruction for the first steps with IO-Link

BitOffset Rights
Firmware version 23 Sub 0 Max 16 Byte ro
Smart Sensor Profile 60 32Bit rw
Configuration of switch-
ing point in BCD1
Switching point 1 Sub 1 16 Bit 0 0 to 1645
Switching point 2 Sub 2 16 Bit 0 not used
Smart Sensor Profile 61 32Bit rw
Configuration of switch-
ing point in BCD1
Switching point logic Sub 1 8 Bit 0 (0) normally closed
(1) normally open
Switching point mode Sub 2 8 Bit 1 (1) single point
Switching point hysteresis Sub 3 16 Bit 18 0 to 1645

Step 1: For preparing the read process force the tags to the following values:

Step 2: Trigger the data transfer by modifying the value for the “IOL_REQ” to 1:

01/02.2017 17
Instruction for the first steps with IO-Link

Step 3: It will take some time for the data exchange. The “IOL-BUSY” flag is true during
the function block is operating:

Step 4: If the data exchange was valid the “IOL_DONEVALID” flag is true:

The valid net data with a length of 17 Bytes (see ”IOL_RDLEN”) is found in the data block
“IO_LINK_DEVICE_DATA”:

01/02.2017 18

You might also like