SIMATIC S7 Library For The Integration of SIEMENS IO-Link Devices
SIMATIC S7 Library For The Integration of SIEMENS IO-Link Devices
            https://support.industry.siemens.com/cs/ww/en/view/90529409
                                        Warranty and Liability
                                                     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 of
                                                     the examples, information, programs, engineering and performance data etc.,
                                                     described in this application example will be excluded. Such an exclusion will not
                                                     apply 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, body
                                                     or health, guarantee for the quality of a product, fraudulent concealment of a
                                                     deficiency or breach of a condition which goes to the root of the contract
 Siemens AG 2015 All rights reserved
                                          Security     Siemens provides products and solutions with industrial security functions that
                                          informa-     support the secure operation of plants, solutions, machines, equipment and/or
                                             tion      networks. They are important components in a holistic industrial security
                                                       concept. With this in mind, Siemens’ products and solutions undergo continuous
                                                       development. Siemens recommends strongly that you regularly check for
                                                       product updates.
                                                       For the secure operation of Siemens products and solutions, it is necessary to
                                                       take suitable preventive action (e.g. cell protection concept) and integrate each
                                                       component into a holistic, state-of-the-art industrial security concept. Third-party
                                                       products that may be in use should also be considered. For more information
                                                       about 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, visit
                                                       http://support.automation.siemens.com.
                                        Table of Contents
                                                  Warranty and Liability ................................................................................................. 2
                                                  1        Library Overview “Siemens IO-Link Devices” ................................................ 5
                                                           1.1          User scenarios ..................................................................................... 6
                                                           1.2          Functionality of the blocks .................................................................... 7
                                                           1.3          Hardware and software requirements .................................................. 8
                                                           1.4          Library resources .................................................................................. 9
                                                  2        Blocks of the Library ....................................................................................... 10
                                                           2.1          Library for STEP 7 V5.5 ..................................................................... 10
                                                           2.2          Library for STEP 7 V13 SP1............................................................... 13
                                                           2.3          Explanations on FB IO_LINK_3SU1_IDKey-Switch (FB5210)Fehler! Textmarke nicht def
                                                           2.3.1        Interface and parameters .............. Fehler! Textmarke nicht definiert.
                                                           2.4          Explanation on FB IO_LINK_DEVICE (FB5001) .............................. 14
                                                           2.4.1        Interface and parameters ................................................................... 14
                                                           2.4.2        Mode of Operation .............................................................................. 16
                                                           2.4.3        Status and error displays.................................................................... 17
                                                           2.5          Joint parameters for all IO-Link device blocks ................................... 19
                                                           2.6          Explanation on FB IO_LINK_3RAxy (FB5100) .................................. 20
                                                           2.6.1        Interface and parameters ................................................................... 20
                                                           2.6.2        Mode of Operation .............................................................................. 21
                                                           2.7          Explanation on FB IO_LINK_3RB24 (FB5110) .................................. 22
                                                           2.7.1        Interface and parameters ................................................................... 22
 Siemens AG 2015 All rights reserved
                                                          SIMATIC S7-300
                                                          SIMATIC S7-400
                                                          SIMATIC S7-1200
                                                          SIMATIC S7-1500
                                                          S7-1200, SM 4 X IO-Link master module
                                                          ET 200SP, CM 4 X IO-Link master module
                                                          ET 200AL, CM 4 X IO-Link master module
                                                          ET 200S electronic module 4SI IO-Link
                                                          ET 200S, IO-Link master for Sirius industrial controls
                                                          ET 200eco PN IO-Link Master
                                        Application
                                                                                                      1
                                                      The library provides function blocks and UDTs for all IO-Link devices from the
                                                      Siemens portfolio, which facilitates and makes communication with the IO-Link
                                                      devices easier.
                                                      The function blocks have a uniform interface for the individual devices. For each
                                                      read/write job, the data record specified at the input is read or written.
 Siemens AG 2015 All rights reserved
                                        1
                                        A UDT (User Defined Data type, or also PLC data type) is a self-defined data type, which
                                        makes it possible, for example, to easily create multiply-used structures.
Figure 1-1
Start
                                                                                                  Positive         No
                                                                                              edge detected at
                                                                                                   REQ?
Yes
                                                                                 Read
                                                                                 RD_WR=0           Read
                                                                                                  or write
                                                                                                  access
                                                                                                             Write
                                                                                                             RD_WR=1
 Siemens AG 2015 All rights reserved
                                                                    Which                         Which
                                                                  data record                   data record
                                                                   selected?                     selected?
                                                                     Read
                                                                                                    Write
                                                                 selected data
                                                                                                selected data
                                                                 record via FB
                                                                                                record via FB
                                                               IO_LINK_DEVICE
                                                                                              IO_LINK_DEVICE
End
                                                     The individual blocks of the library get the specified data record from the IO-Link
                                                     devices, by logically connecting the block input.
                                                     When several data records are switched at the input, then the first selected data
                                                     record is read out.
                                        Hardware
                                                     You can use the library with the following master modules:
                                                             ET 200SP, CM 4 X IO-Link master module
                                                             S7-1200, SM 4 X IO-Link master module
                                                             ET 200S electronic module 4SI IO-Link
                                                             ET 200S, IO-Link master for Sirius industrial controls
                                                             ET 200eco PN, IO-Link Master
                                                             ET 200AL, CM 4xIO-Link Master
                                                     Using the distributed I/O system ET 200S, ET 200eco PN, ET 200AL and
                                                     ET 200SP requires a PNIO controller. The following devices are possible:
                                                             S7-300/S7-400/WinAC CPU
                                                             S7-1200 CPU as of FW V2.2
 Siemens AG 2015 All rights reserved
The IO-Link master SM1278 can only be operated with a S7-1200 CPU.
                                        Software
                                                     Table 1-1
                                                         No.                   Component                               Article number
                                                         1.      SIMATIC STEP 7 V5.5 SP3                  6ES7810-4CC10-0YA5
                                                         2.      SIMATIC STEP 7 V13 SP1                   6ES7822-1AA03-0YA5
                                                         3.      S7-PCT V3.3                              see \3\
                                        Overall occupancy
                                                     All blocks belonging to the “Siemens IO-Link Devices” library occupy a total of
                                                     57 kBytes 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-Link
                                                     devices are used at the same time.
                                                     To be able to use the library, you also have to plan for respective storage space for
                                                     data blocks and instance data blocks.
                                                     In addition, the following system function blocks from the standard library are used.
                                                     Table 2-2
                                                         Block              Symbol                           Classification
                                                      SFB4          TON                 Standard STEP 7 library
                                                      SFB52         RDREC               Standard STEP 7 library
                                                      SFB53         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 5100
                                                      UDT 5101      ParameterPage1_3
                                                                    RAxy
                                                                                        Subordinate to UDT 5100
                                                      UDT 5102      DIAG_3RAxy
                                                      UDT 5103      PARA_3RAxy
                                          NOTICE       You can call the block parallel or in several instances for several devices.
                                                       Please note that depending on the CPU used, only a certain number of
                                                       block calls for RDREC/WRREC must be active at the same time (see \5\).
                                                     Figure 2-1
 Siemens AG 2015 All rights reserved
                                                     The following chapters list all blocks of the “SIEMENS IO-Link Devices” library. In
                                                     this documentation, the screenshots were created with STEP 7 V5.5 SP4.
                                                     The description of the individual blocks applies for STEP7 V5.5 as well as the
                                                     STEP 7 V13 SP1 library.
                                            Note       Only integrate those blocks into your project that refer to the respective CPU. For
                                                       more information refer to Chapter 2.16.
                                        Interface
                                                     Figure 2-2
 Siemens AG 2015 All rights reserved
                                            Note       The IO_LINK_DEVICE block is called internally by the other function blocks of
                                                       the library (see Chapter 1.2 “Functionality of the blocks”). A detailed description
                                                       of the block is available in \4\.
                                        Input parameters
                                                     Table 2-4
                                                           Parameter        Data type       Memory area                  Description
                                                      REQ                   BOOL           I, Q, M, D       Positive edge: Triggers data transfer
                                                      ID                    HW_IO          I, Q, M, D, L,   For S7-1200/1500
                                                                                           const            Hardware identifier of the IO-Link
                                                                                                            communication module
                                                                                                            (for ET200ecoPN the
                                                                                                            HW_ID of the IO-Link submodule
                                                                                                            must be used)
                                                                            DWORD                           For S7-300/400
                                                                                                            Logic address of the IO-Link
                                                                                                            communication module (module or
                                                                                                            submodule)
                                                      CAP                   DINT           I, Q, M, D, L,   Access point of the
                                                                            (S7-           const            IO_LINK_DEVICE function (Siemens
                                                                            1200/1500)                      AG = 227 decimal)
                                                                            INT
                                                                            (S7-300/400)
                                                      RD_WR                 BOOL           I, Q, M, D, L,   Read or write access
                                                                                           const            0: read
 Siemens AG 2015 All rights reserved
                                                                                                            1: write
                                                      PORT                  INT            I, Q, M, D, L,   Port number at which the IO-Link
                                                                                           const            device is operated.
                                                                                                            Possible values: 1..63
                                                      IOL_INDEX             INT            I, Q, M, D, L,   Parameter index
                                                                                           const            Possible values: 0..32767
                                        Output parameters
                                                     Table 2-5
                                                           Parameter        Data type       Memory area                  Description
                                                      DONE_VALID            BOOL           I, Q, M, D, L    Validity:
                                                                                                            0: Data not valid
                                                                                                            1: Data valid
                                                      BUSY                  BOOL           I, Q, M, D, L    Job in progress:
                                                                                                            0: Job completed (valid or error)
                                                                                                            1: Job being processed
                                                      ERROR                 BOOL           I, Q, M, D, L    Error status:
                                                                                                            0: No error
                                                                                                            1: Abort with error