Buscar

APN_IOL_RFID_Library_v1 0_TIA

Prévia do material em texto

CONTRINEX AG Industrial Electronics route du Pâqui 5 - P.O. Box - CH 1720 Corminboeuf - Switzerland - Tel: +41 26 460 46 46 - 
Fax: +41 26 460 46 40 - Internet: www.contrinex.com - E-mail: info@contrinex.com
IO-LINK RFID SYSTEM
APPLICATION NOTES
1
TIA PORTAL
© Contrinex 2018 - YAG
IOL_RFID_Library_V1.0_TIA
IO-Link RFID Function Block Library
CONTRINEX AG Industrial Electronics route du Pâqui 5 - P.O. Box - CH 1720 Corminboeuf - Switzerland - Tel: +41 26 460 46 46 - 
Fax: +41 26 460 46 40 - Internet: www.contrinex.com - E-mail: info@contrinex.com2
TABLE OF CONTENT
1 Library Overview
1.1 Field of application .......................................................................................................................................................3
1.2 Functions ......................................................................................................................................................................3
1.3 Hardware and software requirement ............................................................................................................................3
1.4 Library resources and performances data ...................................................................................................................4
2 Blocks of the Library
2.1 Explanation of the blocks .............................................................................................................................................5
2.1.1 FB "IOL_ScanUID" ....................................................................................................................................................5
2.1.2 FB "IOL_ScanUSER" ................................................................................................................................................6
2.1.3 FB "IOL_READ_HF" ..................................................................................................................................................7
2.1.4 FB "IOL_WRITE_HF" ................................................................................................................................................8
2.1.5 FB "IOL_ANT" ...........................................................................................................................................................9
2.2 Error and status display ..............................................................................................................................................10
2.2.1 Error messages of the library's function blocks .......................................................................................................10
3 How to work with the Library
3.1 Prerequisites to the TIA portal V14 library ..................................................................................................................10
3.1.1 IODD file importation ...............................................................................................................................................10
3.1.2 IO-Link master configuration ................................................................................................................................... 11
3.2 Integrating the library into STEP 7 V14 ...................................................................................................................... 11
3.3 Checking and updating the library ..............................................................................................................................12
4 References
4.1 Bibliographic references .............................................................................................................................................13
4.2 Internet link specifications ..........................................................................................................................................13
CONTRINEX AG Industrial Electronics route du Pâqui 5 - P.O. Box - CH 1720 Corminboeuf - Switzerland - Tel: +41 26 460 46 46 - 
Fax: +41 26 460 46 40 - Internet: www.contrinex.com - E-mail: info@contrinex.com 3
1 LIBRARY OVERVIEW
1.1 Field of application
Using the function blocks made by Contrinex, it is possible to get started instantly using the IO-Link RWM simply by 
dragging and dropping the function block which will performed the wanted RFID command into the right network of your 
RFID project. the diagram below shows an example of components which are compatible with the present library
1.2 Functions
The table below lists the different functions covered by the TIA_IOL_RFID_Library_V1.0. This library allows to easily 
get started to use any IO-Link RWM from Contrinex portfolio and make them communicating with a S7-1200/S7-1500 
PLC. User must be aware of the Operating Mode set into the RWM configuration parameter settings before using the 
appropriate function block.
Function Description
IOL_ScanUID
If Scan UID mode is enabled in the RWM configuration parameter, this function block outputs the tag presence, nb of tag 
and UID information for the end user
IOL_ScanUSER
If Scan USER mode is enabled in the RWM configuration parameter, this function block outputs the tag presence and 32 
bits (respectively 64 bits for FRAM tags) of user data located at the memory address defined in the Scan address field of 
the RWM configiration field
IOL_READ_HF
If Scan READ/WRITE mode is enabled in the RWM configuration parameter, this function block outputs the tag presence 
and user data starting at the memory address defined in the input variables adrTag and length. Maximal length of data 
which can be read out at once by the function block is limited at 2 kBytes
IOL_WRITE_HF
If Scan READ/WRITE mode is enabled in the RWM configuration parameter, this function block outputs the tag pres-
ence and inputs user data. The RFID write has two arguments adrTag and length which define the start address of the 
tag memory and the number of byte to write. Maximal length of data which can be written at once by the function block is 
limited at 2 kBytes
IOL_ANT_ON/OFF
Whatever mode is enabled in the RWM configuration parameter, this function block can enable or disable the magnetic 
field at the RWM antenna coil
1.3 Hardware and software requirements
As prerequisite to ensure a good behaviour of the library, it is important that the following hardware list can be met or 
that equivalent products are used. 
Pos Component Article Number Number
1 S7-1200 PLC 6ES7214-1AG40-0XB0 1
2 CM 4xIO-Link (SM-1278) 6ES7278-4BD32-0XB0 1
3 IO-Link RWM
RLS-1181-320
RLS-1301-320
Up to 3
4 Reader cable S12-4FVG-0x0 Up to 3
5 ISO15693 transponders RTP-0xxx-02x n
Table 1-1
Table 1-2 Hardware component
CONTRINEX AG Industrial Electronics route du Pâqui 5 - P.O. Box - CH 1720 Corminboeuf - Switzerland - Tel: +41 26 460 46 46 - 
Fax: +41 26 460 46 40 - Internet: www.contrinex.com - E-mail: info@contrinex.com4
Pos Component Article Number Number
1 TIAP V14 6AV2100-0AA03-0AA5 1
2
S7-PCT Port Configuration 
Tool (as of V3.0)
Available for download in 
the Siemens Online support. 
See direct URL at chapter 
4.1 of this document
1
3 IODD file for IO-Link RWM
Available for download on 
the IO-Link RWM product 
page. See direct URL at 
chapter 4.1 of this document
1
Table 1-3 Software component
1.4 Library ressources and performance data
The following table shows the size of the library blocks in the main memory, typical execution time and data transfert 
time without additional program in OB1.
FB Size of main memory S7-1200 (bytes)
IOL_ScanUID 94
IOL_ScanUSER 116
IOL_READ_HF 2112
IOL_WRITE_HF 2096
IOL_ANT_ON/OFF 50
Table 1-4 Memory requirement
FB Max. block execution time (ms)
IOL_ScanUID
2
IOL_ScanUSER
IOL_READ_HF
IOL_WRITE_HF
IOL_ANT_ON/OFF
Table 1-5 Execution time
FB Data length (bytes) Avg. transmission time (ms)
IOL_ScanUID 8 / 8 ~ 50
IOL_ScanUSER 4 / 8 ~ 80
IOL_READ_HF
4 / 8 ~ 100
12 / 24 ~ 300
96 / 192 ~ 2350
N/A / 1000 ~12500
IOL_WRITE_HF
4 / 8 ~ 110
12 /24 ~ 320
96 / 192 ~ 3100
N/A / 1000 ~14000
Table 1-6 Data transfer time for 4 bytes / 8 bytes memory based transponders 
CONTRINEX AG Industrial Electronics route du Pâqui 5 - P.O. Box - CH 1720 Corminboeuf - Switzerland - Tel: +41 26 460 46 46 - 
Fax: +41 26 460 46 40 - Internet: www.contrinex.com - E-mail: info@contrinex.com 5
2 BLOCKS OF THE LIBRARY
2.1 Explanation of the blocks
2.1.1 FB “IOL_ScanUID”
The “IOL_ScanUID” FB read transponder UIDs and sends back to the PLC the 64 bits UID into the in/out conIDdata 
variable.
Symbol Data type Description
IN
P
U
T
EN BOOL
Enable input. Relevant only in FBD and LAD 
representaion
Execute BOOL ScanUID jobs starts at positive edge
HwId HW_SUBMODULE
Hardware identified of the IO-Link communication 
module (master)
portAdr Int
Start address of the connected reader (PCT tool)
TagNB Byte
Index of tag to be printed in conIDData variant 
(index from 0)
IN
 / 
O
U
T
ConIDData Variant
Area in the S7 CPU where the UID data is stored
O
U
T
P
U
T
Done BOOL Indicates if the last job has been done
Busy BOOL Indicates if the function block is running
Error BOOL
Indicates if an error has been generated by the 
function block
Status DWord
DW#16#00 is case no error was raised. 
Otherwise, error code is reported. See chapter 
2.4 for error code description
Presence BOOL
Indicate if a transponder is in the RWM detection 
range
ENO BOOL
Enable input. Relevant only in FBD and LAD 
representaion
CONTRINEX AG Industrial Electronics route du Pâqui 5 - P.O. Box - CH 1720 Corminboeuf - Switzerland - Tel: +41 26 460 46 46 - 
Fax: +41 26 460 46 40 - Internet: www.contrinex.com - E-mail: info@contrinex.com6
2.1.2 FB “IOL_ScanUSER”
The “IOL_ScanUSER” FB read transponder a fixed memory address block (defined by RWM configuration parameter 
“ScanAddress”) and a fixed data length (32 bits of data or 64 bits depending on transponder type). The result is sent 
back to the PLC int the in/out conIDdata variable.
Symbol Data type Description
IN
P
U
T
EN BOOL
Enable input. Relevant only in FBD and LAD 
representaion
Execute BOOL ScanUSER jobs starts at positive edge
HwId HW_SUBMODULE
Hardware identified of the IO-Link communication 
module (master)
portAdr Int
Start address of the connected reader (PCT tool)
TagNB Byte
Index of tag to be printed in conIDData variant 
(index from 0)
IN
 / 
O
U
T
ConIDData Variant
Area in the S7 CPU where the user data is stored
O
U
T
P
U
T
Done BOOL Indicates if the last job has been done
Busy BOOL Indicates if the function block is running
Error BOOL
Indicates if an error has been generated by the 
function block
Status DWord
DW#16#00 is case no error was raised. 
Otherwise, error code is reported. See chapter 
2.4 for error code description
Presence BOOL
Indicate if a transponder is in the RWM detection 
range
ENO BOOL
Enable input. Relevant only in FBD and LAD 
representaion
CONTRINEX AG Industrial Electronics route du Pâqui 5 - P.O. Box - CH 1720 Corminboeuf - Switzerland - Tel: +41 26 460 46 46 - 
Fax: +41 26 460 46 40 - Internet: www.contrinex.com - E-mail: info@contrinex.com 7
2.1.3 FB “IOL_READ_HF”
The “IOL_READ_HF” FB read transponder memory starting at variable address block (defined by the input variable 
AdrTag) and a variable length (defined by the input variable Length). The result is sent back to the PLC into the in/out 
conIDdata variable.
Symbol Data type Description
IN
P
U
T
EN BOOL
Enable input. Relevant only in FBD and LAD 
representaion
Execute BOOL READ_HF jobs starts at positive edge
HwId HW_SUBMODULE
Hardware identified of the IO-Link communication 
module (master)
PortAdr Int
Start address of the connected reader (PCT tool)
AdrTag Word
Memory block address to be read in the tran-
sponder memory
Length Word
Number of data byte to read from the transponder 
memory
IN
 / 
O
U
T
ConIDData Variant
Area in the S7 CPU where the user data is stored
O
U
T
P
U
T
Done BOOL Indicates if the last job has been done
Busy BOOL Indicates if the function block is running
Error BOOL
Indicates if an error has been generated by the 
function block
Status DWord
DW#16#00 is case no error was raised. 
Otherwise, error code is reported. See chapter 
2.4 for error code description
Presence BOOL
Indicate if a transponder is in the RWM detection 
range
ENO BOOL
Enable input. Relevant only in FBD and LAD 
representaion
CONTRINEX AG Industrial Electronics route du Pâqui 5 - P.O. Box - CH 1720 Corminboeuf - Switzerland - Tel: +41 26 460 46 46 - 
Fax: +41 26 460 46 40 - Internet: www.contrinex.com - E-mail: info@contrinex.com8
2.1.4 FB “IOL_WRITE_HF”
The “IOL_WRITE_HF” FB read transponder memory starting at variable address block (defined by the input variable 
AdrTag) and a variable length (defined by the input variable Length). The result is sent back to the PLC into the in/out 
conIDdata variable.
Symbol Data type Description
IN
P
U
T
EN BOOL
Enable input. Relevant only in FBD and LAD 
representaion
Execute BOOL WRITE_HF jobs starts at positive edge
HwId HW_SUBMODULE
Hardware identified of the IO-Link communication 
module (master)
PortAdr Int
Start address of the connected reader (PCT tool)
AdrTag Word
Memory block address where to start to write the 
transponder memory
Length Word
Number of data byte to write to the transponder 
memory
32/64bits BOOL
When TRUE, the write operation is performed 
with 64 bits of data. 32 bits otherwise
IN
 / 
O
U
T
ConIDData Variant
Area in the S7 CPU where the data to be written 
is stored
O
U
T
P
U
T
Done BOOL Indicates if the last job has been done
Busy BOOL Indicates if the function block is running
Error BOOL
Indicates if an error has been generated by the 
function block
Status DWord
DW#16#00 is case no error was raised. 
Otherwise, error code is reported. See chapter 
2.4 for error code description
Presence BOOL
Indicate if a transponder is in the RWM detection 
range
ENO BOOL
Enable input. Relevant only in FBD and LAD 
representaion
CONTRINEX AG Industrial Electronics route du Pâqui 5 - P.O. Box - CH 1720 Corminboeuf - Switzerland - Tel: +41 26 460 46 46 - 
Fax: +41 26 460 46 40 - Internet: www.contrinex.com - E-mail: info@contrinex.com 9
2.1.5 FB “IOL_ANT_ON/OFF”
The “IOL_ANT_ON/OFF” FB enables and disables the RFID magnetic field at the RWM antenna coil.
Symbol Data type Description
IN
P
U
T
EN BOOL
Enable input. Relevant only in FBD and LAD 
representaion
Execute BOOL ANT_ON/OFF jobs starts at positive edge
HwId HW_SUBMODULE
Hardware identified of the IO-Link communication 
module (master)
portAdr Int
Start address of the connected reader (PCT tool)
Antenna BOOL
TRUE: turn on antenna
FALSE: turn off antenna
O
U
T
P
U
T
Done BOOL Indicates if the last job has been done
Busy BOOL Indicates if the function block is running
Error BOOL
Indicates if an error has been generated by the 
function block
Status DWord
DW#16#00 is case no error was raised. 
Otherwise, error code is reported. See chapter 
2.4 for error code description
ENO BOOL
Enable input. Relevant only in FBD and LAD 
representaion
CONTRINEX AG Industrial Electronics route du Pâqui 5 - P.O. Box - CH 1720 Corminboeuf - Switzerland - Tel: +41 26 460 46 46 - 
Fax: +41 26 460 46 40 - Internet: www.contrinex.com - E-mail: info@contrinex.com10
2.2 Error and status display
For error diagnostic, all function blocks of the library have a “STATUS” output. By reading the “STATUS output of the 
function blocks, the information of the error message of the block or the error messages of the connected RWM is 
transmistted.
2.2.1 Error messages of the library’s function blocks
STATUS Description Remedy
16#00018101
The transponder has left the field the read/
write process was finished
Restart process
16#00018102
The previous job has not been completed 
yet. The hob is finished at the next possible 
time
Restart process
16#00018104
The given length is smaller than 4 (only for 
READ-HF and WRITE_HF FB)
Specify length larger 
than4
16#000180xy
16#000187xy
16#000185xy
Error messages of the extended instruction 
“BLKMOV”, “DPRD_DAT” and “DPWR_DAT”
Online help of STEP 7
16#001100xx Error message of the connected RWM See RWM DS
Table 2-1 Data transfer time for 4 bytes / 8 bytes memory based transponders 
3 HOW TO WORK WITH THE LIBRARY
3.1 Prerequisites to the TIA portal V14 library
Before starting using the “CTX_RFID_IO_LINK_Library_V1”, it is mandatory that the IODD file of the IO-Link has been 
imported into the SC7 PCT and uploaded into IO-Link master memory and that the IO-Link master has been configured 
properly to enable the appropriate IO-Link RWM “Operating mode”.
3.1.1 IODD file importation
Step Description Screenshot
1
In STEP 7 Device configuration window, left click on the IO-
Link Master device and and then go into the “Edit” menu --> 
“Start device tool...” and select S7-PCT.
2
In SCT-PCT, go into the “Options” menu and select Import 
IODD.
3
Browse your computer and look for the IODD file which has 
previously been downloaded from the IO Link RWM product 
page of the Contrinex website. Click on Import. The IODD 
file of the RWM IO-Link in is added into the IO-Link device 
Catalog in the following folder tree:
IO-Link V1.1 --> Contrinex AG Industrial Electronics --> RFID 
read write module
4
Simply drag and drop from the device Catalog into the SC7-
PCT “Port info”, the different IO-Link devices that are used
Table 3-1 IODD file importation
CONTRINEX AG Industrial Electronics route du Pâqui 5 - P.O. Box - CH 1720 Corminboeuf - Switzerland - Tel: +41 26 460 46 46 - 
Fax: +41 26 460 46 40 - Internet: www.contrinex.com - E-mail: info@contrinex.com 11
3.1.2 IO-Link master configuration
3.2 Integrating the library into a STEP 7 V14 project
In order to be able to use the previously described “CTX_RFID_IO_LINK_Library_V1” library functions, the library shall 
be included into the STEP 7 V14. The following table describe the different steps to complete.
Step Description Screenshot
1
In SCT-PCT, go into the IO-Link master menu and select the 
“Address” tab. Ensure that process data input and process 
data output start addresses are the same. In case, they are 
not starting at the same address, correct the start address 
manually
2
In SCT-PCT, go into the IO-Link RWM menu and select the 
“Parameter” tab. Ensure that the right operating mode is 
selected depending on the function block that you would like 
to use (ScanUID mode for the ScanUID FB, and so on)
3
When all the sensor settings are defined. The IO-Link master 
configuration shall be updated by clicking on the button 
“Upload with device”
Table 3-2 IO-Link master configuration
Step Description Screenshot
1
Open an already existing STEP7 V14 project. In the “Global 
Libraries”, click on “Open library...” in the option menu.
2
Select the global library previously downloaded on the IO-
Link RWM product page and called “CTX_RFID_IO_LINK_
Library_V1“
3
Simply drag & drop FB from the global library to the “program 
blocks” folder of your project.
4
Simply drag & drop FB from the “program blocks” folder to the 
“OB1” of your project.
Table 3-3 Library integration into a STEP 7 V14
CONTRINEX AG Industrial Electronics route du Pâqui 5 - P.O. Box - CH 1720 Corminboeuf - Switzerland - Tel: +41 26 460 46 46 - 
Fax: +41 26 460 46 40 - Internet: www.contrinex.com - E-mail: info@contrinex.com12
5
Enter the name and number of the associated instance data 
block. Click on “OK” to exit the dialog box
6
Open the recently created data block and ensure that its at-
tributes are set to “non-retain”
7 Create a data block to store the read / write data
8
One example of FB assignation for multiple block (3 blocks) 
HF READ command which would start only in case of pres-
ence of transponder is shown in the right screenshots. Project 
could be then compiled and then downloaded in the control-
ler.
3.3 Checking and updating the library
Over the time, library can be further improved, in that case, Contrinex might update the library function blocks. If the 
function block are not update to date any more, the following table will explain to procedure to update them.
Step Description Screenshot
1
Open TIA portal and compare the current version nuimber of 
each library element with the latest version fromt the IO-Link 
RWM product pages:
https://www.contrinex.com/product/rls-1181-320/
https://www.contrinex.com/product/rls-1301-320/ 
In the project tree, right-click on the blocks in the library. In 
the context menu, select the “Properties” option.
In the displayed “Properties” windows, select the 
“Information” tab
2
If the library needs to be updated, integrates the library as 
described in the chapter 3.2
3
Delete all the blocks of the old library in the “Program blocks” 
folder of your STEP 7 project.
Do not delete the function block call in OB1.
4
Insert the elements of the new library as described in the 
Chapter 3.2 steps 4-6. Then in the toolbar, click on “Update 
inconsistent block calls” to update or regenerate the instance 
DBs.
Table 3-4 Checking and updating the library
APN_IOL_RFID_Library_v1.0_TIA_180522_YAG
CONTRINEX AG Industrial Electronics route du Pâqui 5 - P.O. Box - CH 1720 Corminboeuf - Switzerland - Tel: +41 26 460 46 46 - 
Fax: +41 26 460 46 40 - Internet: www.contrinex.com - E-mail: info@contrinex.com13
4 REFERENCES
4.1 Internet link specifications
Description URL
1 Link to this document APN_IOL_RFID_Library_v1.0_TIA
2 Contrinex IO-RWM webpage (RWM DS)
RLS-1181-320
RLS-1301-320
3 S7-PCT V3.0 http://support.automation.siemens.com/WW/view/en/32469496
4 IODD file RLS-1181-320 IODD RLS-1181-320
5 IODD file RLS-1301-320 IODD RLS-1301-320
6 Link to the TIA_IOL_RFID_Library_V1.0 FBK_IOL_RFID_Library_v1.0_TIA
Table 4-1 Internet link specifications
https://www.contrinex.com/wp-content/uploads/ctx_products/application_notes/APN_IOL_RFID_Library_v1.0_TIA.pdf
https://www.contrinex.com/wp-content/uploads/ctx_products/datasheets/RLS-1181-320.pdf
https://www.contrinex.com/wp-content/uploads/ctx_products/datasheets/RLS-1301-320.pdf
http://support.automation.siemens.com/WW/view/en/32469496
https://www.contrinex.com/wp-content/uploads/ctx_products/iodd/Contrinex-RLS-1181-320%20V1.1.zip
https://www.contrinex.com/wp-content/uploads/ctx_products/iodd/Contrinex-RLS-1301-320%20V1.1.zip
https://www.contrinex.com/wp-content/uploads/ctx_products/function_blocks/FBK_IOL_RFID_Library_v1.0_TIA.zip

Continue navegando