SIMATIC S7 Library for the Easy Integration of SIEMENS … · SIMATIC S7 Library for the Easy...

47
http://support.automation.siemens.com/WW/view/en/90529409 Library Description 07/2014 SIMATIC S7 Library for the Easy Integration of SIEMENS IO-Link Devices ET 200SP, CM 4 X IO-Link ST; S7-1200, SM 4 X IO-Link Master ET 200S Electronic Module 4SI IO-Link, ET 200eco PN IO-Link Master

Transcript of SIMATIC S7 Library for the Easy Integration of SIEMENS … · SIMATIC S7 Library for the Easy...

http://support.automation.siemens.com/WW/view/en/90529409

Library Description 07/2014

SIMATIC S7 Library for the Easy Integration

of SIEMENS IO-Link DevicesET 200SP, CM 4 X IO-Link ST; S7-1200, SM 4 X IO-Link MasterET 200S Electronic Module 4SI IO-Link, ET 200eco PN IO-Link Master

Warranty and Liability

Bausteinbibliothek IO-LinkEntry ID: 90529409, V1.0, 07/2014 2

Siem

ens

AG20

14Al

lrig

hts

rese

rved

Warranty and LiabilityNote The Application Examples are not binding and do not claim to be complete

regarding the circuits shown, equipping and any eventuality. The applicationexamples do not represent customer-specific solutions. You are solelyresponsible for the correct operation of the described products. TheseApplication Examples do not relieve you of your responsibility to use safepractices in application, installation, operation and maintenance. When usingthese application examples, you recognize that we cannot be made liable for anydamage/claims beyond the liability clause described. We reserve the right tomake changes to these Application Examples at any time and without priornotice. If there are any deviations between the recommendations provided in thisapplication example and other Siemens publications – e.g. catalogs – thecontents of the other documents have priority.

We do not accept any liability for the information contained in this document.Any claims against us – based on whatever legal reason – resulting from the use ofthe examples, information, programs, engineering and performance data etc.,described in this application example will be excluded. Such an exclusion will notapply in the case of mandatory liability, e.g. under the German Product Liability Act(“Produkthaftungsgesetz”), in case of intent, gross negligence, or injury of life, bodyor health, guarantee for the quality of a product, fraudulent concealment of adeficiency or breach of a condition which goes to the root of the contract(“wesentliche Vertragspflichten”). The damages for a breach of a substantialcontractual obligation are, however, limited to the foreseeable damage, typical forthe type of contract, except in the event of intent or gross negligence or injury tolife, body or health. The above provisions do not imply a change of the burden ofproof to your detriment.Any form of duplication or distribution of these application examples or excerptshereof is prohibited without the expressed consent of Siemens Industry Sector.

Securityinforma-

tion

Siemens provides products and solutions with industrial security functions thatsupport the secure operation of plants, solutions, machines, equipment and/ornetworks. They are important components in a holistic industrial securityconcept. With this in mind, Siemens’ products and solutions undergo continuousdevelopment. Siemens recommends strongly that you regularly check forproduct updates.

For the secure operation of Siemens products and solutions, it is necessary totake suitable preventive action (e.g. cell protection concept) and integrate eachcomponent into a holistic, state-of-the-art industrial security concept. Third-partyproducts that may be in use should also be considered. For more informationabout industrial security, visit http://www.siemens.com/industrialsecurity.

To stay informed about product updates as they occur, sign up for a product-specific newsletter. For more information, visithttp://support.automation.siemens.com.

Table of Contents

Bausteinbibliothek IO-LinkEntry ID: 90529409, V1.0, 07/2014 3

Siem

ens

AG20

14Al

lrig

hts

rese

rved

Table of ContentsWarranty and Liability ................................................................................................. 2

1 Library Overview “Siemens IO-Link Devices” ................................................ 4

1.1 Different user scenarios ....................................................................... 51.2 Functionality of the blocks .................................................................... 61.3 Hardware and software requirements .................................................. 71.4 Library resources .................................................................................. 8

2 Blocks of the Library ......................................................................................... 9

2.1 Block list ............................................................................................... 92.2 Use with S7-1200/S7-1500 ................................................................ 112.3 Explanation of the blocks ................................................................... 122.3.1 FB IO_LINK_CALL_300_400 (FB1) ................................................... 12

Response to error ............................................................................... 132.3.2 Joint parameters for all IO-Link device blocks ................................... 162.3.3 FB IO_LINK_3RAxy_300_400 (FB5100) ........................................... 172.3.4 IO_LINK_3RB24_300_400 (FB5110) ................................................ 192.3.5 IO_LINK_3RR24_300_400 (FB5120) ................................................ 222.3.6 IO_LINK_3RS1x_300_400 (FB5130) ................................................. 242.3.7 IO_LINK_3UG481x_300_400 (FB5140) ............................................ 262.3.8 IO_LINK_3UG4822_300_400 (FB5150) ............................................ 282.3.9 IO_LINK_3UG4825_300_400 (FB5160) ............................................ 302.3.10 IO_LINK_3UG4832_300_400 (FB5170) ............................................ 322.3.11 IO_LINK_3UG4841_300_400 (FB 5180) ........................................... 342.3.12 IO_LINK_3UG4851_300_400 (FB5190) ............................................ 362.3.13 IO_LINK_RFID_300_400 (FB5200) ................................................... 38

3 Working with the Library in STEP 7 V5.5 in STEP 7 V5.5 ............................ 40

3.1 Integrating the library .......................................................................... 403.2 Using library blocks ............................................................................ 40

4 Working with the Library as of STEP 7 V13 .................................................. 43

4.1 Integrating the library .......................................................................... 434.2 Using library blocks ............................................................................ 434.2.1 Use with S7-300/400, S7-1200 >V4.0 and S7-1500 .......................... 444.2.2 Use with S7-1200 V2.2/V3.0/V3.1 ...................................................... 45

5 References ....................................................................................................... 47

6 History............................................................................................................... 47

1 Library Overview “Siemens IO-Link Devices”1.1 Different user scenarios

Bausteinbibliothek IO-LinkEntry ID: 90529409, V1.0, 07/2014 4

Siem

ens

AG20

14Al

lrig

hts

rese

rved

1 Library Overview “Siemens IO-LinkDevices”

What will I get?The present document describes the “Siemens IO-Link Devices” block library. Youreceive a tested code for the communication with IO-Link components togetherwith the block library with uniquely defined interfaces. They can be used as a basisfor your task to be implemented.The main focus of this document is to describe: all blocks pertaining to the library, the functionality provided by these blocks.

The present documentation furthermore illustrates possible applications, and theincluded step-by-step instructions help you integrate the library into your STEP 7project.

Scope of validity of the libraries

STEP 7 V5.5 SP3 STEP 7 V13 SIMATIC S7-300 SIMATIC S7-400 SIMATIC S7-1200 SIMATIC S7-1500 ET 200SP, CM 4 X IO-Link master modules S7-1200, SM 4 X IO-Link master modules ET 200S, electronic module 4SI IO-Link ET 200S, IO-Link Master for SIRIUS controls ET 200eco PN IO-LINK MASTER

1 Library Overview “Siemens IO-Link Devices”1.1 Different user scenarios

Bausteinbibliothek IO-LinkEntry ID: 90529409, V1.0, 07/2014 5

Siem

ens

AG20

14Al

lrig

hts

rese

rved

1.1 Different user scenarios

MotivationThe different Siemens IO-Link devices provide different data, according to theirfunctionality.The data that is provided by the individual devices, differ in parts regarding content and storage location.

In order to read out data from the individual devices or to write them into theindividual devices, each individual structure of the data storage has to beobserved. Working with the devices can thus become quickly unclear and involvesgreat effort.The library provided here, solves this problem.

ApplicationThe library provides function blocks and UDTs1 for all IO-Link devices from theSiemens portfolio which facilitates and makes communication with the IO-Linkdevices easier.The function blocks have a uniform interface for the individual devices. Perread/write job, the data record specified at the input is read/written.

1 A UDT (User Defined Data type, or also PLC data type) is a self-defined data type, whichmakes it possible, for example, to easily create multiply-used structures.

1 Library Overview “Siemens IO-Link Devices”1.2 Functionality of the blocks

Bausteinbibliothek IO-LinkEntry ID: 90529409, V1.0, 07/2014 6

Siem

ens

AG20

14Al

lrig

hts

rese

rved

1.2 Functionality of the blocks

The individual blocks of the library each illustrate one or several IO-Link devices.The function of the blocks is shown by the following program flow chart:

Figure 1-1

Postive edgeon REQ detected?

Start

Yes

No

Write selecteddata record

via FBIO_LINK_CALL_300_400

Reador writeaccess

What data reord isselected?

What data reord isselected?

Read selecteddata record

via FBIO_LINK_CALL_300_400

End

readingRD_WR=0

writingRD_WR=1

The individual blocks of the library get the specified data record from the IO-Linkdevices, by linking the block input.When several data records are switched at the input, then the first selected datarecord is read out.

1 Library Overview “Siemens IO-Link Devices”1.3 Hardware and software requirements

Bausteinbibliothek IO-LinkEntry ID: 90529409, V1.0, 07/2014 7

Siem

ens

AG20

14Al

lrig

hts

rese

rved

1.3 Hardware and software requirements

Requirements for this libraryTo make use of the full functionality of the library described here, the hardware andsoftware requirements listed below must be met:

HardwareYou can use the library with the IO-Link master ET 200SP, CM 4 X IO-Link master module with the IO-Link master S7-1200, SM 4 X IO-Link master module with the IO-Link master “ET 200S, electronic module 4SI IO-Link” with the IO-Link master “ET 200S, IO-Link Master for SIRIUS controls” or with the IO-Link master “ET 200eco PN, IO-Link master”

For the use of the distributed I/O system ET 200S, ET 200eco PN and ET 200SPyou require a PNIO controller. The following devices are possible: S7-300/S7-400/WinAC CPU S7-1200 CPU as of firmware version V2.2 S7-1500 CPU as of firmware version V1.0

The IO-Link master SM1278 can only be operated with a S7-1200 CPU.

Software

Table 1-1

No. Component Article number Qty.

1. SIMATIC STEP 7 V5.5 SP3 6ES7810-4CC10-0YA5 12. SIMATIC STEP 7 V13 6ES7822-1AA03-0YA5 13. S7-PCT V3.2 see \3\ 1

1 Library Overview “Siemens IO-Link Devices”1.4 Library resources

Bausteinbibliothek IO-LinkEntry ID: 90529409, V1.0, 07/2014 8

Siem

ens

AG20

14Al

lrig

hts

rese

rved

1.4 Library resourcesThe overview below shows the assignment of the main memory by the "SiemensIO-Link Devices" library blocks.

Overall occupancyAll blocks belonging to the “Siemens IO-Link devices” library occupy overall56.9 kB in the main memory, without the system function blocks used.Normally not all blocks are used at the same time, since not all possible IO-Linkdevices are used at the same time.Furthermore, to be able to use the library you have to plan a respective storagespace for instance data blocks and data blocks.

Assignment of memory space to the individual blocks:Table 1-2

Block Symbol Size of main memory

FB1 IO_LINK_CALL_300_400 1806 byteFB5100 IO_LINK_3RAxy_300_400 5774 bytesFB5110 IO_LINK_3RB24_300_400 1806 byteFB5120 IO_LINK_3RR24_300_400 5774 bytesFB5130 IO_LINK_3RS1x_300_400 5758 bytesFB5140 IO_LINK_3UG481x_300_400 5654 bytesFB5150 IO_LINK_3UG4822_300_400 5492 bytesFB5160 IO_LINK_3UG4825_300_400 5546 bytesFB5170 IO_LINK_3UG4832_300_400 5492 bytesFB5180 IO_LINK_3UG4841_300_400 5524 bytesFB5190 IO_LINK_3UG4851_300_400 5396 bytesFB5200 IO_LINK_RFID_300_400 5564 bytes

2 Blocks of the Library2.1 Block list

Bausteinbibliothek IO-LinkEntry ID: 90529409, V1.0, 07/2014 9

Siem

ens

AG20

14Al

lrig

hts

rese

rved

2 Blocks of the Library2.1 Block list

The table below lists all blocks belonging to the “Siemens IO-Link Devices” libraryfor STEP 7 V5.5.The blocks serve for the use with S7-300 or S7-400 CPUs. For the use with S7-1200 and S7-1500 CPUs in the TIA Portal, please note chapter 2.2Each of the respective UDTs belongs to the blocks for the structure of the data.They are listed in Table 2-3.

Table 2-1

Block Symbol Modules

FB1 IO_LINK_CALL_300_400 Subordinate block, see \4\.FB5100 IO_LINK_3RAxy_300_400 Compact starter 3RA64/3RA65; function module

3RA27.FB5110 IO_LINK_3RB24_300_400 Overload relay 3RB24.FB5120 IO_LINK_3RR24_300_400 Monitoring relay 3RR2441/3RR2442.FB5130 IO_LINK_3RS1x_300_400 Temperature monitoring relay 3RS1x.FB5140 IO_LINK_3UG481x_300_400 Monitoring relay 3UG481x.FB5150 IO_LINK_3UG4822_300_400 Current monitoring relay 3UG4822.FB5160 IO_LINK_3UG4825_300_400 Error current monitoring relay 3UG4825.FB5170 IO_LINK_3UG4832_300_400 Monitoring relay 3UG4832.FB5180 IO_LINK_3UG4841_300_400 Cosphi and active current monitoring 3UG4841.FB5190 IO_LINK_3UG4851_300_400 Speed monitoring, 3UG4851.FB5200 IO_LINK_RFID_300_400 RFID reader for IO-Link.

In addition, the following system function blocks are delivered with the library:Table 2-2

Block Symbol Classification

SFB4 TON Standard STEP 7 librarySFB52 RDREC Standard STEP 7 librarySFB53 WRREC Standard STEP 7 library

For the individual IO-Link devices the following UDTs (User Defined Data types)are included in the library:

Table 2-3

Block Symbol Note

UDT 5000 ParameterPage0 As “Standard” UDT as part of other UDTs (e.g.UDT 5100)

UDT 5100 3RAxy For function block 5100UDT 5101 ParameterPage1_3RAxy

Subordinate to UDT 5100UDT 5102 DIAG_3RAxyUDT 5103 PARA_3RAxyUDT 5110 3RB24 For function block 5110UDT 5111 DIAG_3RB24 Subordinate to UDT 5110

2 Blocks of the Library2.1 Block list

Bausteinbibliothek IO-LinkEntry ID: 90529409, V1.0, 07/2014 10

Siem

ens

AG20

14Al

lrig

hts

rese

rved

Block Symbol Note

UDT 5112 MEAS_3RB24UDT 5113 PresetConfigOP_3RB24UDT 5114 TechnoFunctions_3RB24UDT 5120 3RR24 For function block 5120UDT 5121 DIAG_3RR24

Subordinate to UDT 5120UDT 5122 MEAS_3RR24UDT 5123 PARA_3RR24UDT 5130 3RS1x For function block 5130UDT 5131 DIAG_3RS1x

Subordinate to UDT 5130UDT 5132 MEAS_3RS1xUDT 5133 PARA_3RS1xUDT 5140 3UG481x For function block 5140UDT 5141 DIAG_3UG481x

Subordinate to UDT 5140UDT 5142 MEAS_3UG481xUDT 5144 PARA_3UG481xUDT 5150 3UG4822 For function block 5150UDT 5151 DIAG_3UG4822

Subordinate to UDT 5150UDT 5152 MEAS_3UG4822UDT 5153 PARA_3UG4822UDT 5160 3UG4825 For function block 5160UDT 5161 DIAG_3UG4825

Subordinate to UDT 5160UDT 5162 MEAS_3UG4825UDT 5163 PARA_3UG4825UDT 5170 3UG4832 For function block 5170UDT 5171 DIAG_3UG4832

Subordinate to UDT 5170UDT 5172 MEAS_3UG4832UDT 5173 PARA_3UG4832UDT 5180 3UG4841 For function block 5180UDT 5181 DIAG_3UG4841

Subordinate to UDT 5180UDT 5182 MEAS_3UG4841UDT 5183 PARA_3UG4841UDT 5190 3UG4851 For function block 5190UDT 5191 DIAG_3UG4851

Subordinate to UDT 5190UDT 5192 MEAS_3UG4851UDT 5193 PARA_3UG4851UDT 5200 RFID For function block 5200UDT 5201 RFID_Event_History

Subordinate to UDT 5200UDT 5202 RFID_Reader_StatusUDT 5203 RFID_Tag_StatusUDT 5204 RFID_UID_History

NOTICE You can call the block parallel or in several instances for several devices.Note that depending on the CPU used, only a certain number of block callsmust be active at the same time (see \5\).

2 Blocks of the Library2.2 Use with S7-1200/S7-1500

Bausteinbibliothek IO-LinkEntry ID: 90529409, V1.0, 07/2014 11

Siem

ens

AG20

14Al

lrig

hts

rese

rved

2.2 Use with S7-1200/S7-1500

GeneralThe blocks listed in chapter 2.1 correspond to the blocks from the library for the S7-300/S7-400 CPUs for STEP 7 V5.5.

STEP 7 V13In this entry (see \2\) a library for STEP 7 V13 is furthermore provided.The library includes identical symbols; however, the absolute addresses, e.g. of theUDTs, can be changed when including the library into a project.

The library includes a folder for each CPU with the suitable function blocks. Use –depending on CPU – the appropriate blocks.See also chapter 4.Figure 2-1

2 Blocks of the Library2.3 Explanation of the blocks

Bausteinbibliothek IO-LinkEntry ID: 90529409, V1.0, 07/2014 12

Siem

ens

AG20

14Al

lrig

hts

rese

rved

2.3 Explanation of the blocksThe chapter below explains all the blocks belonging to the “Siemens IO-LinkDevices” library.The screenshots were created with STEP 7 V5.5 SP3.The descriptions are also valid for the blocks provided in STEP 7 V13.When using the blocks always make sure to integrate the respective CPU. More onthat topic see chapter 3 und chapter 4.

2.3.1 FB IO_LINK_CALL_300_400 (FB1)

CallFigure 2-2

Note The IO_LINK_CALL_300_400 block is called internally by the other functionblocks of the library. (see also chapter 1.2)

A description of the block as well as an example application can furthermore befound here: \4\

Mode of operationFB “IO_LINK_CALL_300_400” is an FB that operates asynchronously; this meansthat processing extends over several FB calls. You start the transfer with a positiveedge on the REQ input of the block.The BUSY parameter shows whether valid reply data has arrived (BUSY = 0) orwhether it is still waited for (BUSY = 1). If the block is processed (BUSY = 1), theIOL_STATUS output parameter signals the current processing step / jam of the FB.If this period exceeds the TIMEOUT of the IO-Link master or 20s, processing isaborted with a timeout error (IOL_STATUS).

2 Blocks of the Library2.3 Explanation of the blocks

Bausteinbibliothek IO-LinkEntry ID: 90529409, V1.0, 07/2014 13

Siem

ens

AG20

14Al

lrig

hts

rese

rved

The value TRUE of the DONE_VALID output parameter shows that the transferwas performed successfully. If data was read, the length of the received data isdisplayed on the RD_LEN parameter.As long as REQ = 1, the output parameters maintain their current value. If REQ isreset (REQ = 0) before the processing of the FB is completed, then the currentvalues of the output parameter will be pending for one cycle.

Response to errorIf an error occurs during the transfer, this is signaled via the ERROR outputparameter. If there is a communication error, the status of the SFB 52 or SFB 53 ispassed on to the STATUS output parameter.In addition, it can be detected on the IOL_STATUS output parameter, at which SFBcall the error occurred. The description of the status in this case can be found inthe online help of the respective SFBs.If there is an IO-Link error, this is displayed on the IOL_STATUS output parameter(in this case, the status parameter has the value16#0000 0000).

Description of parametersTable 2-4 FB Parameter description

Parameter Decla-ration

Memoryarea

Description

REQ INPUT:Bool

I, Q, M, D, L,const

Positive edge:Perform data transmission

ID INPUT:Dword

I, Q, M, D, L,const

logic address of the IO-Link masterFor an output modulebit 15 has to be set (example for address 5:ID:=DW#16#8005).For hybrid modules, the smaller of the two addresseshas to be specified.

CAP INPUT:Int

I, Q, M, D, L,const

Access point of the IO_LINK_CALL_300_400function (usually 227).

RD_WR INPUT:Bool

I, Q, M, D, L,const

Read or write access0: read1: write

PORT INPUT:Int

I, Q, M, D, L,const

Port number at which the IO-Link device is operated.0 : Master1…255 : Port no.

IOL_INDEX INPUT:Int

I, Q, M, D, L,const

Address parameter index (IO-Link device)0..32767: IOL-D-1: port function

IOL_SUBINDEX INPUT:Int

I, Q, M, D, L,const

Address parameter subindex (IO-Link device)0 : total record1..255: parameter from record

RECORD_IOL_DATA

INPUT:Any

I, Q, M, D, L Source/target area for the data to be read/written.Example: P#M50.0 BYTE 10

LEN INPUT:Int

I, Q, M, D, L,const

Length of the data to be written (net data)maximum length: 232 bytes

DONE_VALID OUTPUT:Bool

I, Q, M, D, L Validity0: Data not valid1. Data valid

2 Blocks of the Library2.3 Explanation of the blocks

Bausteinbibliothek IO-LinkEntry ID: 90529409, V1.0, 07/2014 14

Siem

ens

AG20

14Al

lrig

hts

rese

rved

Parameter Decla-ration

Memoryarea

Description

BUSY OUTPUT:Bool

I, Q, M, D, L Job in progress0: Job completed (o.k. or error):1. Job being processed

ERROR OUTPUT:Bool

I, Q, M, D, L Error status0 = no error1. Abort with error

STATUS OUTPUT:Dword

I, Q, M, D, L Communication error status ERROR flag set:Status output by SFB52/53Reset error flag: hex 0000 0000

IOL_STATUS OUTPUT:Dword

IO-Link error statusERROR flag set and IO-Link error:See error information ERRORFlag set and communication error:Specification to which SFB the status belongsReset error flag: hex 000x0000(x: Process step 0..3)

RD_LEN OUTPUT:Int

I, Q, M, D, L Length of the read data (net data)

Error statusSTATUSThe STATUS output parameter includes error information of the SFB52 (RDREC)or SFB53 (WRREC). To interpret the STATUS parameter, see online help forSFB52 or help for SFB53.IOL_STATUS (See Table 2-5)In the case of a correct completion of the IO_LINK_CALL_300_400 theIOL_STATUS tag is set to 0x00. In the case of aborting theIO_LINK_CALL_300_400, an error signaling is performed on the respectiveIOL_STATUS output tag.The IO-Link error codes (device error code) are directly mapped in theIOL_STATUS output tag of data type DWORD (byte 0 and byte 1). The coding canbe found in the respective IO-Link device documentation. Error codes by IO-Linkmaster or FB 1 “IO_LINK_CALL_300_400” (IOL-M Error_Code) are mapped in thebytes 2, 3 of IOL_STATUS.

Table 2-5 Coding IOL-M Error_Code (byte 2, 3) of IOL_STATUS

(IOL-M Error_Code) Short description Description

0x0000 No error No error present in the IO-Linkmaster.

0x0001 IO_LINK_CALL_300_400 FB 1 „IO_LINK_CALL_300_400“ready for new job(no error)

0x0002 IO_LINK_CALL_300_400 IO_LINK_CALL_300_400 is in sendstate(SEND_REQUEST)(no error)

2 Blocks of the Library2.3 Explanation of the blocks

Bausteinbibliothek IO-LinkEntry ID: 90529409, V1.0, 07/2014 15

Siem

ens

AG20

14Al

lrig

hts

rese

rved

(IOL-M Error_Code) Short description Description

0x0003 BOOL IO_LINK_CALL_300_400 is in pollstate (WAIT_ON_RES)(no error)

0x0004 …0x06FF

- reserved

0x7000 IO_LINK_CALL_300_400conflict

Send and response data inconsistent.Check the wiring on the device.

0x7001 WrongIO_LINK_CALL_300_400

Decoding errorCheck the block used.

0x7002 Port blocked Port occupied by another job or notpresent.Check the status of the IO-Linkmaster.

0x7003 …0x7FFF

- reserved

0x8000 Timeout Job could not be performed within thetimeout time.Check the cabling and the status ofthe IO-Link device.

0x8001 Wrong index IOL_INDEX smaller -1 or larger 32767Check the IOL_INDEX.

0x8002 Wrong port address Port address larger 255Check the port address.

0x8003 Wrong port function Port function is not supported.Check the functionality of the IO-Linkdevice.

0x8004 No IOLD No device available or port in DI/DOMode or device does not supportSPDUCheck the configuration of the IO-Linkmaster.

0x8005 Wrong LEN Invalid length > 232 ByteShorten the length.

0x8006 Wrong subindex Subindex larger 255.Check the subindex.

0x8007 …0x8051

- Reserved

0x8052 SFB52Fault Error occurred when calling SFB52,see STATUS.

0x8053 SFB53Fault Error occurred when calling SFB53,see STATUS.

0x8054 …0xFFFF

- reserved

2 Blocks of the Library2.3 Explanation of the blocks

Bausteinbibliothek IO-LinkEntry ID: 90529409, V1.0, 07/2014 16

Siem

ens

AG20

14Al

lrig

hts

rese

rved

2.3.2 Joint parameters for all IO-Link device blocks

The following table describes the parameters that are identical for all functionblocks listed in the following chapters. These parameters are not again listedseparately when describing the individual blocks.

Table 2-6 FB Parameter descriptionParameter Decla-

rationMemory

areaDescription

REQ INPUT:Bool

I, Q, M, D, L,const

Positive edge:Perform data transfer (read or write)

ID INPUT:Dword

I, Q, M, D, L,const

logic address of the IO-Link master

CAP INPUT:Int

I, Q, M, D, L,const

Client Access Point (CAP), for Siemens IO-Link mastermodules always 227 (dec).

RD_WR INPUT:Bool

I, Q, M, D, L,const

Read or write access:0=Read, 1=Write

PORT INPUT:Int

I, Q, M, D, L,const

Port of the IO-Link device that is to be read/written.

DONE OUTPUT:Bool

I, Q, M, D, L DONE = TRUE Data valid. Job successfullyexecuted.

Busy OUTPUT:Bool

I, Q, M, D, L BUSY = TRUE, job currently active.

Error OUTPUT:Bool

I, Q, M, D, L ERROR = TRUE, function aborted with error.

Status OUTPUT:DWord

I, Q, M, D, L DP/PNIO error status, when error = TRUE:Status of the communication error.

IOL_Status OUTPUT:DWOrd

I, Q, M, D, L IO_Link error status, when ERROR = TRUE.See chapter 2.3.1.

2 Blocks of the Library2.3 Explanation of the blocks

Bausteinbibliothek IO-LinkEntry ID: 90529409, V1.0, 07/2014 17

Siem

ens

AG20

14Al

lrig

hts

rese

rved

2.3.3 FB IO_LINK_3RAxy_300_400 (FB5100)

GeneralThe block serves for the use with the compact starters 3RA64/3RA65 and the3RA27 function module.

CallFigure 2-3

2 Blocks of the Library2.3 Explanation of the blocks

Bausteinbibliothek IO-LinkEntry ID: 90529409, V1.0, 07/2014 18

Siem

ens

AG20

14Al

lrig

hts

rese

rved

Mode of operationFB “IO_LINK_3RAxy_300_400” is an FB that operates asynchronously; this meansthat processing extends over several FB calls. Start the transfer of the FB 1“IO_LINK_3RAxy_300_400” with a positive edge on the REQ.The function block FB “IO_LINK_CALL_300_400” is called internally.The function block reads the data record that is switched on the block input withTRUE.For more detailed information on the mode of operation, please refer to theparameter description.

Description of parametersThe parameters that are valid for all blocks from chapter 2.3.3 onward aredescribed in chapter 2.3.2.

Table 2-7 FB Parameter descriptionParameter Decla-

rationDescription

ParameterPage0 INPUT:Bool

Read access to ParameterPage 0.

ParameterPage1 INPUT:Dword

read/write access to ParameterPage1.

VendorName INPUT:Bool

Read access to manufacturer name

VendorText INPUT:Bool

Read access to the specific text of the manufacturer.

ProductName INPUT:Bool

Read access to product name.

ProductID INPUT:Bool

Read access to product ID.

ProductText INPUT:Bool

Read access to the product description.

SerialNumber INPUT:Bool

Read access to serial number.

HWRevision INPUT:Bool

Read access to hardware version.

FWRevision INPUT:Bool

Read access to firmware version.

ApplicationSpecificName

INPUT:Bool

Read/write access to application-specific name.

GroupDiagnostics INPUT:Bool

Read access to the diagnostics data.

ActualConfiguration

INPUT:Bool

Read access to the current configuration.

TargetConfiguration

INPUT:Bool

Read/write access to the target configuration.

Data IN/OUTPUT:UDT 3RAxy

Data structure for the IO-Link devices 3RAxy.

2 Blocks of the Library2.3 Explanation of the blocks

Bausteinbibliothek IO-LinkEntry ID: 90529409, V1.0, 07/2014 19

Siem

ens

AG20

14Al

lrig

hts

rese

rved

2.3.4 IO_LINK_3RB24_300_400 (FB5110)

GeneralThe block serves for the use with the electronic overload relay 3RB24.

CallFigure 2-4

2 Blocks of the Library2.3 Explanation of the blocks

Bausteinbibliothek IO-LinkEntry ID: 90529409, V1.0, 07/2014 20

Siem

ens

AG20

14Al

lrig

hts

rese

rved

Mode of operationFB “IO_LINK_3RB24_300_400” is an FB that operates asynchronously; this meansthat processing extends over several FB calls. Start the transfer of the FB 1“IO_LINK_3RB24_300_400” with a positive edge on the REQ.The function block FB “IO_LINK_CALL_300_400” is called internally.The function block reads the data record that is switched on the block input withTRUE.For more detailed information on the mode of operation, please refer to theparameter description.

Description of parametersThe parameters that are valid for all blocks from chapter 2.3.3 onward aredescribed in chapter 2.3.2.

Table 2-8 FB Parameter descriptionParameter Decla-

rationDescription

ParameterPage0 INPUT:Bool

Read access to ParameterPage 0.

ManufacturersName

INPUT:Bool

Read access to manufacturer name

ManufacturersText

INPUT:Bool

Read access to the specific text of the manufacturer.

ProductName INPUT:Bool

Read access to product name.

ProductID INPUT:Bool

Read access to product ID.

ProductText INPUT:Bool

Read access to the product description.

SerialNumber INPUT:Bool

Read access to serial number.

HWRevision INPUT:Bool

Read access to hardware version.

FWRevision INPUT:Bool

Read access to firmware version.

ApplicationSpecificName

INPUT:Bool

Read/write access to application-specific name.

ProcessInput INPUT:Bool

Read access to process input.

ProcessOutput INPUT:Bool

Read access to process output.

Diagnostics INPUT:Bool

Read access to the diagnostics data.

Measurements INPUT:Bool

Read access to the measurements.

PresetConfigurationOP

INPUT:Bool

Read/write access to the panel configuration.

TargetConfiguration

INPUT:Bool

Read/write access to the target configuration.

2 Blocks of the Library2.3 Explanation of the blocks

Bausteinbibliothek IO-LinkEntry ID: 90529409, V1.0, 07/2014 21

Siem

ens

AG20

14Al

lrig

hts

rese

rved

Parameter Decla-ration

Description

TechnologyFunctions

INPUT:Bool

Read technology functions.

Data IN/OUTPUT:UDT 3RB24

Data structure for the IO-Link device 3RB24.

2 Blocks of the Library2.3 Explanation of the blocks

Bausteinbibliothek IO-LinkEntry ID: 90529409, V1.0, 07/2014 22

Siem

ens

AG20

14Al

lrig

hts

rese

rved

2.3.5 IO_LINK_3RR24_300_400 (FB5120)

GeneralThe block serves for the use with the electronic monitoring relays3RR2441/3RR2442.

CallFigure 2-5

2 Blocks of the Library2.3 Explanation of the blocks

Bausteinbibliothek IO-LinkEntry ID: 90529409, V1.0, 07/2014 23

Siem

ens

AG20

14Al

lrig

hts

rese

rved

Mode of operationFB “IO_LINK_3RR24_300_400” is an FB that operates asynchronously; this meansthat processing extends over several FB calls. Start the transfer of the FB 1“IO_LINK_3RR24_300_400” with a positive edge on the REQ.The function block FB “IO_LINK_CALL_300_400” is called internally.The function block reads the data record that is switched on the block input withTRUE.For more detailed information on the mode of operation, please refer to theparameter description.

Description of parametersThe parameters that are valid for all blocks from chapter 2.3.3 onward aredescribed in chapter 2.3.2.

Table 2-9 FB Parameter descriptionParameter Decla-

rationDescription

ParameterPage0 INPUT:Bool

Read access to ParameterPage 0.

ParameterPage1 INPUT:Dword

read/write access to ParameterPage1.

VendorName INPUT:Bool

Read access to manufacturer name

VendorText INPUT:Bool

Read access to the specific text of the manufacturer.

ProductName INPUT:Bool

Read access to product name.

ProductID INPUT:Bool

Read access to product ID.

SerialNumber INPUT:Bool

Read access to serial number.

HWRevision INPUT:Bool

Read access to hardware version.

FWRevision INPUT:Bool

Read access to firmware version.

ApplicationSpecificName

INPUT:Bool

Read/write access to application-specific name.

Diagnostics INPUT:Bool

Read access to the diagnostics data.

Measurements INPUT:Bool

Read access measurements

Parameters INPUT:Bool

read/write access parameter

Data IN/OUTPUT:UDT 3RR24

Data structure for the IO-Link device 3RR24.

2 Blocks of the Library2.3 Explanation of the blocks

Bausteinbibliothek IO-LinkEntry ID: 90529409, V1.0, 07/2014 24

Siem

ens

AG20

14Al

lrig

hts

rese

rved

2.3.6 IO_LINK_3RS1x_300_400 (FB5130)

GeneralThe block serves for the use with the temperature monitoring relay 3RS1x.

CallFigure 2-6

2 Blocks of the Library2.3 Explanation of the blocks

Bausteinbibliothek IO-LinkEntry ID: 90529409, V1.0, 07/2014 25

Siem

ens

AG20

14Al

lrig

hts

rese

rved

Mode of operationFB “IO_LINK_3RS1x_300_400” is an FB that operates asynchronously; this meansthat processing extends over several FB calls. Start the transfer of the FB 1“IO_LINK_3RS1x_300_400” with a positive edge on the REQ.The function block FB “IO_LINK_CALL_300_400” is called internally.The function block reads the data record that is switched on the block input withTRUE.For more detailed information on the mode of operation, please refer to theparameter description.

Description of parametersThe parameters that are valid for all blocks from chapter 2.3.3 onward aredescribed in chapter 2.3.2.

Table 2-10 FB Parameter descriptionParameter Decla-

rationDescription

ParameterPage0 INPUT:Bool

Read access to ParameterPage 0.

VendorName INPUT:Bool

Read access to manufacturer name

VendorText INPUT:Bool

Read access to the specific text of the manufacturer.

ProductName INPUT:Bool

Read access to product name.

ProductID INPUT:Bool

Read access to product ID.

HWRevision INPUT:Bool

Read access to hardware version.

FWRevision INPUT:Bool

Read access to firmware version.

ApplicationSpecificName

INPUT:Bool

Read/write access to application-specific name.

Diagnostics INPUT:Bool

Read access to the diagnostics data.

Measurements INPUT:Bool

Read access measurements

Parameters INPUT:Bool

read/write access parameter

Data IN/OUTPUT:UDT 3RS1x

Data structure for the IO-Link devices 3RS1x.

2 Blocks of the Library2.3 Explanation of the blocks

Bausteinbibliothek IO-LinkEntry ID: 90529409, V1.0, 07/2014 26

Siem

ens

AG20

14Al

lrig

hts

rese

rved

2.3.7 IO_LINK_3UG481x_300_400 (FB5140)

GeneralThe block serves for the use with the monitoring relay 3UG481x.

CallFigure 2-7

Mode of operationFB “IO_LINK_3UG481x_300_400” is an FB that operates asynchronously; thismeans that processing extends over several FB calls. Start the transfer of the FB 1“IO_LINK_3UG481x_300_400” with a positive edge on the REQ.The function block FB “IO_LINK_CALL_300_400” is called internally.

2 Blocks of the Library2.3 Explanation of the blocks

Bausteinbibliothek IO-LinkEntry ID: 90529409, V1.0, 07/2014 27

Siem

ens

AG20

14Al

lrig

hts

rese

rved

The function block reads the data record that is switched on the block input withTRUE.For more detailed information on the mode of operation, please refer to theparameter description.

Description of parametersThe parameters that are valid for all blocks from chapter 2.3.3 onward aredescribed in chapter 2.3.2.

Table 2-11 FB Parameter descriptionParameter Decla-

rationDescription

ParameterPage0 INPUT:Bool

Read access to ParameterPage 0.

VendorName INPUT:Bool

Read access to manufacturer name

VendorText INPUT:Bool

Read access to the specific text of the manufacturer.

ProductName INPUT:Bool

Read access to product name.

ProductID INPUT:Bool

Read access to product ID.

HWRevision INPUT:Bool

Read access to hardware version.

FWRevision INPUT:Bool

Read access to firmware version.

ApplicationSpecificName

INPUT:Bool

Read/write access to application-specific name.

Diagnostics INPUT:Bool

Read access to the diagnostics data.

Measurements INPUT:Bool

Read access measurements

Parameters INPUT:Bool

read/write access parameter

Data IN/OUTPUT:UDT3UG481x

Data structure for the IO-Link devices 3UG481x.

2 Blocks of the Library2.3 Explanation of the blocks

Bausteinbibliothek IO-LinkEntry ID: 90529409, V1.0, 07/2014 28

Siem

ens

AG20

14Al

lrig

hts

rese

rved

2.3.8 IO_LINK_3UG4822_300_400 (FB5150)

GeneralThe block serves for the use with the current monitoring relay 3UG4822.

CallFigure 2-8

Mode of operationFB “IO_LINK_3UG4822_300_400” is an FB that operates asynchronously; thismeans that processing extends over several FB calls. Start the transfer of the FB 1“IO_LINK_3UG4822_300_400” with a positive edge on the REQ.The function block FB “IO_LINK_CALL_300_400” is called internally.

2 Blocks of the Library2.3 Explanation of the blocks

Bausteinbibliothek IO-LinkEntry ID: 90529409, V1.0, 07/2014 29

Siem

ens

AG20

14Al

lrig

hts

rese

rved

The function block reads the data record that is switched on the block input withTRUE.For more detailed information on the mode of operation, please refer to theparameter description.

Description of parametersThe parameters that are valid for all blocks from chapter2.3.3 onward aredescribed in chapter 2.3.2.

Table 2-12 FB Parameter descriptionParameter Decla-

rationDescription

ParameterPage0 INPUT:Bool

Read access to ParameterPage 0.

VendorName INPUT:Bool

Read access to manufacturer name

VendorText INPUT:Bool

Read access to the specific text of the manufacturer.

ProductName INPUT:Bool

Read access to product name.

ProductID INPUT:Bool

Read access to product ID.

HWRevision INPUT:Bool

Read access to hardware version.

FWRevision INPUT:Bool

Read access to firmware version.

ApplicationSpecificName

INPUT:Bool

Read/write access to application-specific name.

Diagnostics INPUT:Bool

Read access to the diagnostics data.

Measurements INPUT:Bool

Read access measurements

Parameters INPUT:Bool

read/write access parameter

Data IN/OUTPUT:UDT3UG4822

Data structure for the IO-Link device 3UG4822.

2 Blocks of the Library2.3 Explanation of the blocks

Bausteinbibliothek IO-LinkEntry ID: 90529409, V1.0, 07/2014 30

Siem

ens

AG20

14Al

lrig

hts

rese

rved

2.3.9 IO_LINK_3UG4825_300_400 (FB5160)

GeneralThe block serves for the use with the error current monitoring relay 3UG4825.

CallFigure 2-9

2 Blocks of the Library2.3 Explanation of the blocks

Bausteinbibliothek IO-LinkEntry ID: 90529409, V1.0, 07/2014 31

Siem

ens

AG20

14Al

lrig

hts

rese

rved

Mode of operationFB “IO_LINK_3UG4822_300_400” is an FB that operates asynchronously; thismeans that processing extends over several FB calls. Start the transfer of the FB 1“IO_LINK_3UG4825_300_400” with a positive edge on the REQ.The function block FB “IO_LINK_CALL_300_400” is called internally.The function block reads the data record that is switched on the block input withTRUE.For more detailed information on the mode of operation, please refer to theparameter description.

Description of parametersThe parameters that are valid for all blocks from chapter2.3.3 onward aredescribed in chapter 2.3.2.

Table 2-13 FB Parameter descriptionParameter Decla-

rationDescription

ParameterPage0 INPUT:Bool

Read access to ParameterPage 0.

SystemCommands INPUT:Bool

Write system commands.

VendorName INPUT:Bool

Read access to manufacturer name

VendorText INPUT:Bool

Read access to the specific text of the manufacturer.

ProductName INPUT:Bool

Read access to product name.

ProductID INPUT:Bool

Read access to product ID.

SerialNumber INPUT:Bool

Read access to serial number.

HWRevision INPUT:Bool

Read access to hardware version.

FWRevision INPUT:Bool

Read access to firmware version.

ApplicationSpecificName

INPUT:Bool

Read/write access to application-specific name.

Diagnostics INPUT:Bool

Read access to the diagnostics data.

Measurements INPUT:Bool

Read access measurements

Parameters INPUT:Bool

read/write access parameter

Data IN/OUTPUT:UDT3UG4825

Data structure for the IO-Link device 3UG4825.

2 Blocks of the Library2.3 Explanation of the blocks

Bausteinbibliothek IO-LinkEntry ID: 90529409, V1.0, 07/2014 32

Siem

ens

AG20

14Al

lrig

hts

rese

rved

2.3.10 IO_LINK_3UG4832_300_400 (FB5170)

GeneralThe block serves for the use with the voltage monitoring 3UG4832.

CallFigure 2-10

2 Blocks of the Library2.3 Explanation of the blocks

Bausteinbibliothek IO-LinkEntry ID: 90529409, V1.0, 07/2014 33

Siem

ens

AG20

14Al

lrig

hts

rese

rved

Mode of operationFB “IO_LINK_3UG4832_300_400” is an FB that operates asynchronously; thismeans that processing extends over several FB calls. Start the transfer of the FB 1“IO_LINK_3UG4832_300_400” with a positive edge on the REQ.The function block FB “IO_LINK_CALL_300_400” is called internally.The function block reads the data record that is switched on the block input withTRUE.For more detailed information on the mode of operation, please refer to theparameter description.

Description of parametersThe parameters that are valid for all blocks from chapter2.3.3 onward aredescribed in chapter 2.3.2.

Table 2-14 FB Parameter descriptionParameter Decla-

rationDescription

ParameterPage0 INPUT:Bool

Read access to ParameterPage 0.

VendorName INPUT:Bool

Read access to manufacturer name

VendorText INPUT:Bool

Read access to the specific text of the manufacturer.

ProductName INPUT:Bool

Read access to product name.

ProductID INPUT:Bool

Read access to product ID.

HWRevision INPUT:Bool

Read access to hardware version.

FWRevision INPUT:Bool

Read access to firmware version.

ApplicationSpecificName

INPUT:Bool

Read/write access to application-specific name.

Diagnostics INPUT:Bool

Read access to the diagnostics data.

Measurements INPUT:Bool

Read access measurements

Parameters INPUT:Bool

read/write access parameter

Data IN/OUTPUT:UDT3UG4832

Data structure for the IO-Link device 3UG4832.

2 Blocks of the Library2.3 Explanation of the blocks

Bausteinbibliothek IO-LinkEntry ID: 90529409, V1.0, 07/2014 34

Siem

ens

AG20

14Al

lrig

hts

rese

rved

2.3.11 IO_LINK_3UG4841_300_400 (FB 5180)

GeneralThe block serves for the use with the cosphi and active current monitoring relais3UG4841.

CallFigure 2-11

Mode of operationFB “IO_LINK_3UG4841_300_400” is an FB that operates asynchronously; thismeans that processing extends over several FB calls. Start the transfer of the FB 1“IO_LINK_3UG4841_300_400” with a positive edge on the REQ.

2 Blocks of the Library2.3 Explanation of the blocks

Bausteinbibliothek IO-LinkEntry ID: 90529409, V1.0, 07/2014 35

Siem

ens

AG20

14Al

lrig

hts

rese

rved

The function block FB “IO_LINK_CALL_300_400” is called internally.The function block reads the data record that is switched on the block input withTRUE.For more detailed information on the mode of operation, please refer to theparameter description.

Description of parametersThe parameters that are valid for all blocks from chapter 2.3.3 onward aredescribed in chapter 2.3.2.

Table 2-15 FB Parameter descriptionParameter Decla-

rationDescription

ParameterPage0 INPUT:Bool

Read access to ParameterPage 0.

VendorName INPUT:Bool

Read access to manufacturer name

VendorText INPUT:Bool

Read access to the specific text of the manufacturer.

ProductName INPUT:Bool

Read access to product name.

ProductID INPUT:Bool

Read access to product ID.

HWRevision INPUT:Bool

Read access to hardware version.

FWRevision INPUT:Bool

Read access to firmware version.

ApplicationSpecificName

INPUT:Bool

Read/write access to application-specific name.

Diagnostics INPUT:Bool

Read access to the diagnostics data.

Measurements INPUT:Bool

Read access measurements

Parameters INPUT:Bool

read/write access parameter

Data IN/OUTPUT:UDT3UG4841

Data structure for the IO-Link device 3UG4841.

2 Blocks of the Library2.3 Explanation of the blocks

Bausteinbibliothek IO-LinkEntry ID: 90529409, V1.0, 07/2014 36

Siem

ens

AG20

14Al

lrig

hts

rese

rved

2.3.12 IO_LINK_3UG4851_300_400 (FB5190)

GeneralThe block serves for the use with speed monitoring relais 3UG4851.

CallFigure 2-12

Mode of operationFB “IO_LINK_3UG4851_300_400” is an FB that operates asynchronously; thismeans that processing extends over several FB calls. Start the transfer of the FB 1“IO_LINK_3UG4851_300_400” with a positive edge on the REQ.The function block FB “IO_LINK_CALL_300_400” is called internally.

2 Blocks of the Library2.3 Explanation of the blocks

Bausteinbibliothek IO-LinkEntry ID: 90529409, V1.0, 07/2014 37

Siem

ens

AG20

14Al

lrig

hts

rese

rved

The function block reads the data record that is switched on the block input withTRUE.For more detailed information on the mode of operation, please refer to theparameter description.

Description of parametersThe parameters that are valid for all blocks from chapter 2.3.3 onward aredescribed in chapter 2.3.2.

Table 2-16 FB Parameter descriptionParameter Decla-

rationDescription

ParameterPage0 INPUT:Bool

Read access to ParameterPage 0.

VendorName INPUT:Bool

Read access to manufacturer name

VendorText INPUT:Bool

Read access to the specific text of the manufacturer.

ProductName INPUT:Bool

Read access to product name.

ProductID INPUT:Bool

Read access to product ID.

HWRevision INPUT:Bool

Read access to hardware version.

FWRevision INPUT:Bool

Read access to firmware version.

ApplicationSpecificName

INPUT:Bool

Read/write access to application-specific name.

Diagnostics INPUT:Bool

Read access to the diagnostics data.

Measurements INPUT:Bool

Read access measurements

Parameters INPUT:Bool

read/write access parameter

Data IN/OUTPUT:UDT3UG4851

Data structure for the IO-Link device 3UG4851.

2 Blocks of the Library2.3 Explanation of the blocks

Bausteinbibliothek IO-LinkEntry ID: 90529409, V1.0, 07/2014 38

Siem

ens

AG20

14Al

lrig

hts

rese

rved

2.3.13 IO_LINK_RFID_300_400 (FB5200)

GeneralThe block serves for the use with the SIMATIC RF200 IO-Link RFID readers.

CallFigure 2-13

Mode of operationFB “IO_LINK_RFID_300_400” is an FB that operates asynchronously; this meansthat processing extends over several FB calls. Start the transfer of the FB 1“IO_LINK_RFID_300_400” with a positive edge on the REQ.The function block FB “IO_LINK_CALL_300_400” is called internally.

2 Blocks of the Library2.3 Explanation of the blocks

Bausteinbibliothek IO-LinkEntry ID: 90529409, V1.0, 07/2014 39

Siem

ens

AG20

14Al

lrig

hts

rese

rved

The function block reads the data record that is switched on the block input withTRUE.For more detailed information on the mode of operation, please refer to theparameter description.

Description of parametersThe parameters that are valid for all blocks from chapter 2.3.3 onward aredescribed in chapter 2.3.2.

Table 2-17 FB Parameter descriptionParameter Decla-

rationDescription

DirectParameterPage

INPUT:Bool

Read access to ParameterPage 0.

VendorName INPUT:Bool

Read access to manufacturer name

VendorText INPUT:Bool

Read access to the specific text of the manufacturer.

ProductName INPUT:Bool

Read access to product name.

ProductID INPUT:Bool

Read access to product ID.

FWRevision INPUT:Bool

Read access to firmware version.

ApplicationSpecificName

INPUT:Bool

Read/write access to application-specific name.

ErrorCount INPUT:Bool

Read access to error counter

EventHistory INPUT:Bool

Read access to event history

ReaderStatus INPUT:Bool

Read access to the state of the reader

TagStatus INPUT:Bool

Read access to the tag status

UIDHistory INPUT:Bool

Read access to UID history

Data IN/OUTPUT:UDT RFID

Data structure for RFID

Note More information on the parameters that are processed with this function blockcan be found in \6\.

3 Working with the Library in STEP 7 V5.5 in STEP 7 V5.53.1 Integrating the library

Bausteinbibliothek IO-LinkEntry ID: 90529409, V1.0, 07/2014 40

Siem

ens

AG20

14Al

lrig

hts

rese

rved

3 Working with the Library in STEP 7 V5.5 inSTEP 7 V5.5

What will you learn here?This chapter includes instructions for integrating the “Siemens IO-Link Devices”library into your STEP 7 project and instructions for using the library blocks.

3.1 Integrating the library

In order to be able to use the previously described library functions, they must firstbe integrated into the configuration software. The necessary steps are listed in thefollowing table.

Table 3-1

Step Instruction

1. The library is available on the HTML page from which you downloaded thisdocument. Save the "SIEMENS_Devices_IO_Link“ library to your hard drive.

2. Open the SIMATIC MANAGER and retrieve the STEP 7“SIEMENS_Devices_IO_Link” library.“File > Retrieve...”

3. The library is now available in “Libraries”.

3.2 Using library blocks

In order to use the library blocks in your user program, proceed as follows:

Table 3-2

Step Instruction

1. Open an already existing STEP 7 V5.5 project.2. Open the “SIEMENS_Devices_IO_Link” library.

3 Working with the Library in STEP 7 V5.5 in STEP 7 V5.53.2 Using library blocks

Bausteinbibliothek IO-LinkEntry ID: 90529409, V1.0, 07/2014 41

Siem

ens

AG20

14Al

lrig

hts

rese

rved

Step Instruction

3. Copy the required blocks to your project.

General:Drag the FB1, the FB that corresponds to your device as well as the respectiveUDTs and the UDT5000 to your user program. Then add the required systemfunctions.

Example:Use the IO-Link Device 3RA6400-2AB42Drag the following blocks to your S7-300 user program: FB1 “IO_LINK_CALL_300_400” (called internally by FB 5100) FB5100 "IO_LINK_3RAxy_300_400" UDTs

– 5100 3RAxy (data structure for the “Data” input of FB 5100)– 5000 ParameterPage0 (among others part of UDT 5100)– 5101 ParameterPage1_3RAxy (subordinate to UDT 5100)– 5102 DIAG_3RAxy (subordinate to UDT 5100)– 5103 PARA_3RAxy (subordinate to UDT 5100)

SFBs 4, 52, 53 (TON, RDREC, WRREC)4. Check the consistency of your user program via right mouse click on the block

folder and select “Check Block Consistency”.

When no enumerations appear when clicking “Dependency tree: Only conflicts”

, the block calls are consistent and you have added all required blocks.

3 Working with the Library in STEP 7 V5.5 in STEP 7 V5.53.2 Using library blocks

Bausteinbibliothek IO-LinkEntry ID: 90529409, V1.0, 07/2014 42

Siem

ens

AG20

14Al

lrig

hts

rese

rved

Step Instruction

5. Create the organization block 1 (OB1) and open it. Drag the function block viadrag & drop into any network for your IO-Link device.NoteYou can also use the blocks in other, cyclic organization blocks.

6. Enter the data block with the number of the instance data block that you wouldlike to use. Generate the instance data block if it does not exist.

7. Assign values of your choice to all formal parameters. The values can be, forexample, stored in any data block.

Save the organization block 1 (OB1) and load the STEP 7 project.

4 Working with the Library as of STEP 7 V134.1 Integrating the library

Bausteinbibliothek IO-LinkEntry ID: 90529409, V1.0, 07/2014 43

Siem

ens

AG20

14Al

lrig

hts

rese

rved

4 Working with the Library as of STEP 7 V134.1 Integrating the library

In order to be able to use the previously described library functions, they must firstbe integrated into the configuration software. The necessary steps are listed in thefollowing table.

Table 4-1

Step Instruction

1. The library is available on the HTML page from which you downloaded thisdocument. Save the "SIEMENS_Devices_IO_Link_V13" library to your hard drive.

2. Open the TIA Portal V13 and retrieve the STEP 7 “SIEMENS_Devices_IO_Link”library.Open the project view and go to the “Libraries” tab.Right click “Retrieve library” in “Global libraries".

3. The library is then available in “Global libraries”.

4.2 Using library blocksWhen using the library blocks, it has to be distinguished between the followingcontroller groups: S7-300/400, S7-1200 >V4.0 and S7-1500 S7-1200 V2.2/V3.0/V3.1

4 Working with the Library as of STEP 7 V134.2 Using library blocks

Bausteinbibliothek IO-LinkEntry ID: 90529409, V1.0, 07/2014 44

Siem

ens

AG20

14Al

lrig

hts

rese

rved

When using a S7-1200 with a firmware smaller V4.0, the integration of types is notpossible. The copy templates have to be used instead.The procedure for using the library blocks is described in the following twochapters.

4.2.1 Use with S7-300/400, S7-1200 >V4.0 and S7-1500

The following table describes the procedure for adding the “IO_LINK_3RAxy”function block.Table 4-2

Step Instruction

1. Open an already existing STEP 7 V13 project.2. Open the “Siemens Devices IO-Link Library TIA V13” library.

3. Copy the required blocks to your project.Example: Use the IO-Link Device 3RA6400-2AB42Drag the following function block into your user program from the Types folderand the <CPU type> subfolder: IO_LINK_3RAxy_xxx

The respective PLC data types as well as the internally called IO_LINK_CALLblock are automatically copied into the project.

4. Compile the IO_LINK_3xx block. (Shortcut: Ctrl +B).The block is compiled with the message “The know-how protected block hasbeen adapted to the environment”.

5. Open the OB “Main”. Now drag the function block via drag & drop into anynetwork for your IO-Link device.NoteYou can also use the blocks in other, cyclic organization blocks.

4 Working with the Library as of STEP 7 V134.2 Using library blocks

Bausteinbibliothek IO-LinkEntry ID: 90529409, V1.0, 07/2014 45

Siem

ens

AG20

14Al

lrig

hts

rese

rved

Step Instruction

6. Enter the data block with the number of the instance data block that you wouldlike to use.

7. Assign values of your choice to all formal parameters. The values can be, forexample, stored in any data block.

Save the OB1 organization block and load the STEP 7 project into your S7-CPU.

4.2.2 Use with S7-1200 V2.2/V3.0/V3.1

Table 4-3

Step Instruction

1. Open an already existing STEP 7 V13 project.2. Open the “Siemens Devices IO-Link Library TIA V13” library.

3. Copy the required blocks to your project.Example: Use the IO-Link Device 3RA6400-2AB42Drag the following function block into your user program from the Types folder,subfolder S7-1200 V2.2/V3.0/V3.1: IO_LINK_CALL_1200

Drag the following elements into your user program from the “Master Copies”folder: IO_LINK_3RB24_1200_V2./V3.0/V3.1 DataTypes 3RAxy S7-1200 V2./V3.0/V3.1

The list is also valid for other blocks: Drag the FB “IO_LINK_CALL_1200”, theFB that corresponds to your device and the respective PLC data types to youruser program. Then add the required system functions.

4. Compile the “IO_LINK_3xx” block. (Shortcut: Ctrl +B).The block is compiled with the message “The know-how protected block hasbeen adapted to the environment”.

4 Working with the Library as of STEP 7 V134.2 Using library blocks

Bausteinbibliothek IO-LinkEntry ID: 90529409, V1.0, 07/2014 46

Siem

ens

AG20

14Al

lrig

hts

rese

rved

Step Instruction

5. Open the OB “Main”. Now drag the function block via drag & drop into anynetwork for your IO-Link device.NoteYou can also use the blocks in other, cyclic organization blocks.

6. Enter the data block with the number of the instance data block that you wouldlike to use.

7. Select the “Instructions” tab from the side and go to the “Distributed I/O folder”under the “Extended instructions” heading.Select version 1.0 for the WRREC instruction instead of version 1.1.

NoteIf you do not make this change, the error message “Type conflict forWRREC_SFB” will appear when you are compiling your user program.

8. Assign values of your choice to all formal parameters. The values can be, forexample, stored in any data block.

Save the organization block 1 (OB1) and load the STEP 7 project into your S7-CPU.

5 References

Bausteinbibliothek IO-LinkEntry ID: 90529409, V1.0, 07/2014 47

Siem

ens

AG20

14Al

lrig

hts

rese

rved

5 ReferencesTable 5-1

Topic Title

\1\ Siemens IndustryOnline Support

http://support.automation.siemens.com

\2\ Download page ofthe entry

http://support.automation.siemens.com/WW/view/en/90529409

\3\ S7-PCT http://support.automation.siemens.com/WW/view/en/32469496

\4\ Acyclic read andwrite with the FB"IO_LINK_CALL"

http://support.automation.siemens.com/WW/view/en/82981502

\5\ Restrictions ofWRREC andRDREC

http://support.automation.siemens.com/WW/view/en/84214594

\6\ SIMATIC IdentRFID systemsSIMATIC RF200IO-Link

http://support.automation.siemens.com/WW/view/en/84214594

6 History

Table 6-1

Version Date Modifications

V1.0 07/2014 First version