0% found this document useful (0 votes)
68 views

RFID Functions en-US

Uploaded by

emerson
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
68 views

RFID Functions en-US

Uploaded by

emerson
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 72

Preface

Fundamental safety
instructions 1

Description 2
SIMOTION
Programming 3
SIMOTION SCOUT
Standard Functions for RFID
Parameter assignment 4
Systems
Application example 5
Function Manual

Appendix A

11/2016
Legal information
Warning notice system
This manual contains notices you have to observe in order to ensure your personal safety, as well as to prevent
damage to property. The notices referring to your personal safety are highlighted in the manual by a safety alert
symbol, notices referring only to property damage have no safety alert symbol. These notices shown below are
graded according to the degree of danger.

DANGER
indicates that death or severe personal injury will result if proper precautions are not taken.

WARNING
indicates that death or severe personal injury may result if proper precautions are not taken.

CAUTION
indicates that minor personal injury can result if proper precautions are not taken.

NOTICE
indicates that property damage can result if proper precautions are not taken.
If more than one degree of danger is present, the warning notice representing the highest degree of danger will be
used. A notice warning of injury to persons with a safety alert symbol may also include a warning relating to property
damage.
Qualified Personnel
The product/system described in this documentation may be operated only by personnel qualified for the specific
task in accordance with the relevant documentation, in particular its warning notices and safety instructions. Qualified
personnel are those who, based on their training and experience, are capable of identifying risks and avoiding
potential hazards when working with these products/systems.
Proper use of Siemens products
Note the following:

WARNING
Siemens products may only be used for the applications described in the catalog and in the relevant technical
documentation. If products and components from other manufacturers are used, these must be recommended or
approved by Siemens. Proper transport, storage, installation, assembly, commissioning, operation and
maintenance are required to ensure that the products operate safely and without any problems. The permissible
ambient conditions must be complied with. The information in the relevant documentation must be observed.

Trademarks
All names identified by ® are registered trademarks of Siemens AG. The remaining trademarks in this publication
may be trademarks whose use by third parties for their own purposes could violate the rights of the owner.
Disclaimer of Liability
We have reviewed the contents of this publication to ensure consistency with the hardware and software described.
Since variance cannot be precluded entirely, we cannot guarantee full consistency. However, the information in
this publication is reviewed regularly and any necessary corrections are included in subsequent editions.

Siemens AG Copyright © Siemens AG 2016.


Division Digital Factory Ⓟ 10/2016 Subject to change All rights reserved
Postfach 48 48
90026 NÜRNBERG
GERMANY
Preface

Contents of the function manual


This document is part of the SIMOTION Programming - References documentation package.

Function block
The function blocks _PIB_001KB, _PIB_016KB , and _PIB_032KB are part of the command
library of the "SIMOTION SCOUT" engineering system.

SIMOTION Documentation
An overview of the SIMOTION documentation can be found in the SIMOTION Documentation
Overview document.
This documentation is included as electronic documentation in the scope of delivery of
SIMOTION SCOUT. It comprises ten documentation packages.
The following documentation packages are available for SIMOTION V4.5:
● SIMOTION Engineering System Handling
● SIMOTION System and Function Descriptions
● SIMOTION Service and Diagnostics
● SIMOTION IT
● SIMOTION Programming
● SIMOTION Programming - References
● SIMOTION C
● SIMOTION P
● SIMOTION D
● SIMOTION Supplementary Documentation

Hotline and Internet addresses

Additional information
Click the following link to find information on the following topics:
● Ordering documentation / overview of documentation
● Additional links to download documents
● Using documentation online (find and search manuals/information)
http://www.siemens.com/motioncontrol/docu

Standard Functions for RFID Systems


Function Manual, 11/2016 3
Preface

My Documentation Manager
Click the following link for information on how to compile documentation individually on the
basis of Siemens content and how to adapt it for the purpose of your own machine
documentation:
https://support.industry.siemens.com/My/ww/en/documentation

Training
Click the following link for information on SITRAIN - Siemens training courses for automation
products, systems and solutions:
http://www.siemens.com/sitrain

FAQs
Frequently Asked Questions can be found in SIMOTION Utilities & Applications, which are
included in the scope of delivery of SIMOTION SCOUT, and in the Service&Support pages
in Product Support:
http://support.automation.siemens.com

Technical support
Country-specific telephone numbers for technical support are provided on the Internet under
Contact:
http://www.siemens.com/automation/service&support

Standard Functions for RFID Systems


4 Function Manual, 11/2016
Table of contents

Preface.........................................................................................................................................................3
1 Fundamental safety instructions...................................................................................................................7
1.1 General safety instructions.......................................................................................................7
1.2 Industrial security.....................................................................................................................8
1.3 Danger to life due to software manipulation when using removable storage media................9
2 Description..................................................................................................................................................11
2.1 General..................................................................................................................................11
2.2 Product description................................................................................................................13
3 Programming..............................................................................................................................................15
3.1 Integrating the function blocks in the user project..................................................................15
3.2 Addressing the field devices..................................................................................................17
4 Parameter assignment...............................................................................................................................19
4.1 Function blocks _PIB_001KB / _PIB_016KB / _PIB_032KB...................................................19
4.2 Calling function blocks...........................................................................................................25
4.3 Commands of function blocks................................................................................................31
4.3.1 Overview of commands..........................................................................................................31
4.3.2 Clear.......................................................................................................................................33
4.3.3 Create....................................................................................................................................34
4.3.4 Delete.....................................................................................................................................35
4.3.5 Dev status..............................................................................................................................35
4.3.6 Format....................................................................................................................................36
4.3.7 Get.........................................................................................................................................37
4.3.8 Get attribute...........................................................................................................................38
4.3.9 Get directory...........................................................................................................................39
4.3.10 Inventory................................................................................................................................41
4.3.11 Mem status.............................................................................................................................43
4.3.12 Next........................................................................................................................................43
4.3.13 Physical read..........................................................................................................................44
4.3.14 Physical write.........................................................................................................................45
4.3.15 Put..........................................................................................................................................45
4.3.16 Read.......................................................................................................................................46
4.3.17 Read BarCode.......................................................................................................................47
4.3.18 Read config............................................................................................................................48
4.3.19 Set attribute............................................................................................................................49
4.3.20 Update....................................................................................................................................49
4.3.21 Write.......................................................................................................................................50
4.3.22 Write config............................................................................................................................51
4.4 Error messages......................................................................................................................52
4.4.1 Overview................................................................................................................................52

Standard Functions for RFID Systems


Function Manual, 11/2016 5
Table of contents

4.4.2 Error and warning concept.....................................................................................................52


4.4.3 Error in acyclic and cyclic data transfer..................................................................................58
4.4.4 Examples of reading out error numbers.................................................................................59
5 Application example...................................................................................................................................63
5.1 General information on the application example....................................................................63
5.2 Sequence of the application example....................................................................................66
A Appendix.....................................................................................................................................................69
A.1 List of abbreviations...............................................................................................................69
Index...........................................................................................................................................................71

Standard Functions for RFID Systems


6 Function Manual, 11/2016
Fundamental safety instructions 1
1.1 General safety instructions

WARNING
Danger to life if the safety instructions and residual risks are not observed
The non-observance of the safety instructions and residual risks stated in the associated
hardware documentation can result in accidents with severe injuries or death.
● Observe the safety instructions given in the hardware documentation.
● Consider the residual risks for the risk evaluation.

WARNING
Danger to life caused by machine malfunctions caused by incorrect or changed
parameterization
Incorrect or changed parameterization can cause malfunctions on machines that can result
in injuries or death.
● Protect the parameterization (parameter assignments) against unauthorized access.
● Respond to possible malfunctions by applying suitable measures (e.g. EMERGENCY
STOP or EMERGENCY OFF).

Standard Functions for RFID Systems


Function Manual, 11/2016 7
Fundamental safety instructions
1.2 Industrial security

1.2 Industrial security

Note
Industrial security
Siemens provides products and solutions with industrial security functions that support the
secure operation of plants, systems, machines and networks.
In order to protect plants, systems, machines and networks against cyber threats, it is
necessary to implement – and continuously maintain – a holistic, state-of-the-art industrial
security concept. Siemens’ products and solutions only form one element of such a concept.
Customer is responsible to prevent unauthorized access to its plants, systems, machines and
networks. Systems, machines and components should only be connected to the enterprise
network or the internet if and to the extent necessary and with appropriate security measures
(e.g. use of firewalls and network segmentation) in place.
Additionally, Siemens’ guidance on appropriate security measures should be taken into
account. For more information about industrial security, please visit http://www.siemens.com/
industrialsecurity.
Siemens’ products and solutions undergo continuous development to make them more secure.
Siemens strongly recommends to apply product updates as soon as available and to always
use the latest product versions. Use of product versions that are no longer supported, and
failure to apply latest updates may increase customer’s exposure to cyber threats.
To stay informed about product updates, subscribe to the Siemens Industrial Security RSS
Feed under http://www.siemens.com/industrialsecurity..

WARNING
Danger as a result of unsafe operating states resulting from software manipulation
Software manipulation (e.g. by viruses, Trojan horses, malware, worms) can cause unsafe
operating states to develop in your installation which can lead to death, severe injuries and/
or material damage.
● Keep the software up to date.
Information and newsletters can be found at:
http://support.automation.siemens.com
● Incorporate the automation and drive components into a state-of-the-art, integrated
industrial security concept for the installation or machine.
For more detailed information, go to:
http://www.siemens.com/industrialsecurity
● Make sure that you include all installed products into the integrated industrial security
concept.

Standard Functions for RFID Systems


8 Function Manual, 11/2016
Fundamental safety instructions
1.3 Danger to life due to software manipulation when using removable storage media

1.3 Danger to life due to software manipulation when using removable


storage media

WARNING
Danger to life due to software manipulation when using removable storage media
The storage of files on removable storage media involves a high risk of infection, e.g. via
viruses or malware. Incorrect parameter assignment can cause machines to malfunction,
which can lead to injuries or death.
● Protect the files on removable storage media against harmful software through appropriate
protective measures, e.g. virus scanners.

Standard Functions for RFID Systems


Function Manual, 11/2016 9
Fundamental safety instructions
1.3 Danger to life due to software manipulation when using removable storage media

Standard Functions for RFID Systems


10 Function Manual, 11/2016
Description 2
2.1 General
This documentation describes data exchange between the SIMOTION system and standard
profile RFID systems (PIB = Proxy Ident Block) using the function blocks (FB):
● _PIB_001KB
● _PIB_016KB
● _PIB_032KB

6,027,21GHYLFHHJ&[[ 6WDQGDUGSURILOH5),'V\VWHP 3,%


HJ$60b

352),%86FDEOH 5HDGHU

5DGLRLQWHUIDFH

7RDGGLWLRQDO352),%86'3
QRGHV
7UDQVSRQGHU

Figure 2-1 System overview

Components
The most important components of a SIMOTION application for writing to and reading from
transponders are listed below along with their functions.

Table 2-1 Components

Component Function
SIMOTION device Motion control module with integrated function block for data exchange with
standard profile RFID systems.
Standard profile RFID Communication modules acting as an interface between the reader and the
systems SIMOTION device.

Standard Functions for RFID Systems


Function Manual, 11/2016 11
Description
2.1 General

Component Function
Reader Device for communication with transponders and for serial interfacing with
standard profile RFID systems.
Transponder Data memory mounted on the product or its transport or packaging unit that
can be written, modified, and read using a contactless reader.

Note
This document describes only the operation of function blocks _PIB_001KB, _PIB_016KB,
and PIB_032KB. For data exchange between the SIMOTION System and the standard profile
RFID systems (PIB), you need the following documentation:
● SIMOTION SCOUT configuration manual
This document is shipped with SIMOTION SCOUT in electronic form.
● Documentation of the corresponding standard profile RFID system (e.g. ASM 456, available
on CD, Article No. 6GT2080-2AA10)
– Hardware Description
– Software Description

Requirements
The requirements for the standard functions described in this documentation are as follows:
● SIMOTION SCOUT V4.0 or higher
● SIMOTION Kernel V4.0 or higher
● Standard profile RFID system (PIB), e.g. ASM 456 V3.0 or higher, Article No.
6GT2002-0ED00
Note
The ASM 456 is integrated in the SIMOTION Motion Control System by means of a GSD
file. The GSD file (device master file) contains all the properties specific to a slave. The
format of a GSD file is defined in IEC 61784-1:2002 Ed1 CP 3/1.
For the current GSD file, go to:
http://support.automation.siemens.com/WW/view/en/22511087

Installing GSD files


1. In the STEP 7 "Hardware catalog", select the menu command Options > Install GSD Files.
2. In the dialog box that appears, open the drive/directory with the corresponding GSD file.
Result: The DP slave is listed in the "Hardware catalog" window (only in the "Standard"
catalog profile!) under "PROFIBUS DP\Additional Field Devices\Identsystems\MOBY
\ASM456" and is available there for configuration.
Note
For further information about installing GSD files, refer to the STEP 7 Online Help.

Standard Functions for RFID Systems


12 Function Manual, 11/2016
Description
2.2 Product description

2.2 Product description


The function blocks act as the communication interface between a standard profile RFID
system (e.g. ASM 456) and the user program. The function blocks (FBs) support the following
functions:
● Configuration
● Command processing
● Reading and writing of data
● Diagnostics

Standard Functions for RFID Systems


Function Manual, 11/2016 13
Description
2.2 Product description

Standard Functions for RFID Systems


14 Function Manual, 11/2016
Programming 3
3.1 Integrating the function blocks in the user project

Creating the instance of the FBs in the user project


The function blocks are part of the command library of the "SIMOTION SCOUT" engineering
system. To work with the Ident Unit, an instance of the function block must first be created in
the user project.
The Ident Unit comprises the following components:
● Standard profile RFID system
● Reader
Note
For multi-channel Ident Units, one instance per channel must be created.

Example:

VAR_GLOBAL
myFbPib001KB : _PIB_001KB; // instance of FB _PIB_001KB
END_VAR

Standard Functions for RFID Systems


Function Manual, 11/2016 15
Programming
3.1 Integrating the function blocks in the user project

Call (LAD representation)

B3,%B.%B3,%B.%B3,%B.%

(1  (12 
%22/ H[HFXWH GRQH %22/

':25' LG HUURU %22/

,17 LQGH[ VWDWXV ':25'

,17 RIIVHW ZDUQLQJ %22/

%22/ USWFPG EXV\ %22/

%22/ VUHVHW USWDFW %22/

%22/ LQLW HUUBLUHT %22/

%22/ XRXW WSF %22/


%22/ XRXW WS %22/
%22/ XRXW XLQ %22/
%22/ XRXW XLQ %22/
%22/ UGJDWH XLQ %22/
,17 FPGGLP XLQ %22/
,17 FPGVHO WUOHQ ',17
,17 W[EXIOHQ

,17 W[VWDUW

,17 U[EXIOHQ

,17 U[VWDUW

$55$<>@RI&0'B6758&7 FPGUHI FPGUHI $55$<>@RI&0'B6758&7

$55$<>Q@RI%<7( W[UHI W[UHI $55$<>Q@RI%<7(

$55$<>Q@RI%<7( U[UHI U[UHI $55$<>Q@RI%<7(

7KHIROORZLQJYDOXHVDSSO\IRUQ )XQFWLRQEORFN 9DOXH LQE\WHV


B3,%B.% Q 
B3,%B.% Q 
B3,%B.% Q 

/$'VSHFLILFSDUDPHWHUV
 

Application example
The application example is included on the "SIMOTION Utilities & Applications" CD-ROM and
is available for various SIMOTION hardware platforms. The
"SIMOTION Utilities & Applications" CD-ROM is provided free of charge with SIMOTION
SCOUT.

Standard Functions for RFID Systems


16 Function Manual, 11/2016
Programming
3.2 Addressing the field devices

3.2 Addressing the field devices

Overview
The SIMOTION device and the Ident Unit communicate via the PROFIBUS DP. Addresses
starting at 256 are recommended for the standard profile RFID system (e.g. ASM 456),
whereby I/O variables are used for read- and write-accessing the I/O.

Creating I/O variables


In the SIMOTION user project, two I/O variables with the addresses taken from HW Config
must be created for reading and writing of cyclic data.
The parameters must be assigned in the Symbol Browser (refer to the following example).

Example for the ASM 456


Determining the addresses from HW Config:

Figure 3-1 Addresses in HW Config

The ASM 456 provides two read/write channels. Each channel communicates cyclically with
the controller by means of a control word (direction: controller to ASM 456) and a status word
(direction: ASM 456 to the controller). The addresses of both the status words (ZSW) and the
control word (STW) are specified via the start addresses of the ZSW/STW of the first channel.
The start addresses of the ZSW/STW of the second channel are connected directly.
The start addresses of the input and output address range must be identical. In the example,
the start address is 256.

Standard Functions for RFID Systems


Function Manual, 11/2016 17
Programming
3.2 Addressing the field devices

This results in the following addresses for the ZSW/STW:


● ZSW/STW of ASM 456 channel X1 are located on addresses 256/257
● ZSW/STW of ASM 456 channel X2 are located on addresses 258/259
The I/O variables must be created for each module.
Creating the I/O Variables in the Symbol Browser:

Figure 3-2 Addressing with I/O variables

Notice: The I/O addresses in the Symbol Browser shown in the figure have the following
meanings:
● "PIB" = Peripheral Input: Byte
● "PQB" = Peripheral Output: Byte

Parameter transfer
The above-indicated addresses of the status and command words are passed to the input
parameter id of the corresponding function block instance.

Note
For additional information, refer to:
● SIMOTION SCOUT online help
● Programming Manual of the corresponding programming language, e.g.:
– SIMOTION ST, Structured Text Programming Manual
– SIMOTION MCC, Motion Control Chart Programming Manual
– SIMOTION LAD/FBD, Ladder Diagram and Function Block Diagram Programming
Manual
These documents are shipped with SIMOTION SCOUT in electronic form.

Standard Functions for RFID Systems


18 Function Manual, 11/2016
Parameter assignment 4
4.1 Function blocks _PIB_001KB / _PIB_016KB / _PIB_032KB

Introduction
With the function blocks _PIB_001KB, _PIB_016KB , and _PIB_032KB , data can be
exchanged between SIMOTION and standard profile RFID systems.
Use of the FBs depends on the amount of data to be transferred. The following table contains
an overview of the maximum amount of data that can be transferred with the FBs during a
read/write operation.

Function block Maximum data amount per command call:


_PIB_001KB 1 KB
_PIB_016KB 16 KB
_PIB_032KB 32 KB

Standard Functions for RFID Systems


Function Manual, 11/2016 19
Parameter assignment
4.1 Function blocks _PIB_001KB / _PIB_016KB / _PIB_032KB

Call (LAD representation)

B3,%B.%B3,%B.%B3,%B.%

(1  (12 
%22/ H[HFXWH GRQH %22/

':25' LG HUURU %22/

,17 LQGH[ VWDWXV ':25'

,17 RIIVHW ZDUQLQJ %22/

%22/ USWFPG EXV\ %22/

%22/ VUHVHW USWDFW %22/

%22/ LQLW HUUBLUHT %22/

%22/ XRXW WSF %22/


%22/ XRXW WS %22/
%22/ XRXW XLQ %22/
%22/ XRXW XLQ %22/
%22/ UGJDWH XLQ %22/
,17 FPGGLP XLQ %22/
,17 FPGVHO WUOHQ ',17
,17 W[EXIOHQ

,17 W[VWDUW

,17 U[EXIOHQ

,17 U[VWDUW

$55$<>@RI&0'B6758&7 FPGUHI FPGUHI $55$<>@RI&0'B6758&7

$55$<>Q@RI%<7( W[UHI W[UHI $55$<>Q@RI%<7(

$55$<>Q@RI%<7( U[UHI U[UHI $55$<>Q@RI%<7(

7KHIROORZLQJYDOXHVDSSO\IRUQ )XQFWLRQEORFN 9DOXH LQE\WHV


B3,%B.% Q 
B3,%B.% Q 
B3,%B.% Q 

/$'VSHFLILFSDUDPHWHUV
 

Standard Functions for RFID Systems


20 Function Manual, 11/2016
Parameter assignment
4.1 Function blocks _PIB_001KB / _PIB_016KB / _PIB_032KB

Parameter description
The following table contains the parameters of FBs
_PIB_001KB / _PIB_016KB / _PIB_032KB.

Note
For detailed information about the use of parameters, see the documentation for the standard
profile RFID system, e.g. ASM 456.

Table 4-1 Parameters of function blocks _PIB_001KB / _PIB_016KB / _PIB_032KB

Name Type Data type Default Meaning


execute IN BOOL FALSE TRUE = Initiating a new request (command) with rising edge
Before starting the block operation, the command and the corre‐
sponding parameters must be set by the user in the entry in the
cmdref field selected with cmdsel.
id IN DWORD 0 Start address of the I/O device
Notice: The start addresses of the in/out area must be identical. See
figure "Addresses in HW Config".
index IN INT 0 Identification of the data of a channel:
● Channel 1: 101/111
● Channel 2: 102/112
● Channel 3: 103/113
● Channel 4: 104/114
● Channel 5: 105/115
● Channel 6: 106/116
● Channel 7: 107/117
● Channel 8: 108/118
The 10th position of the index parameter has the following mean‐
ings:
● 0 = Parameter assignment of channel
● 1 = Data transfer for the channel
offset IN INT 0 Address offset from the base address (input parameter id) of the
channel-related cyclic I/O data.
● Channel 1: 0
● Channel 2: 2
● Channel 3: 4
● Channel 4: 6
● Channel 5: 8
● Channel 6: 10
● Channel 7: 12
● Channel 8: 14
rptcmd IN BOOL FALSE TRUE = Repeating the command currently being executed or the
next command to be executed by the Ident Unit.

Standard Functions for RFID Systems


Function Manual, 11/2016 21
Parameter assignment
4.1 Function blocks _PIB_001KB / _PIB_016KB / _PIB_032KB

Name Type Data type Default Meaning


sreset IN BOOL FALSE TRUE = Aborting the command currently being processed in the
Ident Unit.
init IN BOOL FALSE TRUE = Ident Unit is restarting operation
uout0 IN BOOL FALSE This bit can be assigned by the vendor of the RFID system.
uout1 IN BOOL FALSE This bit can be assigned by the vendor of the RFID system.
uout2 IN BOOL FALSE This bit can be assigned by the vendor of the RFID system.
uout3 IN BOOL FALSE This bit can be assigned by the vendor of the RFID system.
rdgate IN BOOL FALSE TRUE = Activating read gate
cmddim IN INT 0 Number of commands in parameter cmdref
cmdsel IN INT 0 Selection of command to be executed
txbuflen IN INT 0 Number of bytes used by this instance of the FB to store data to be
sent.
txstart IN INT 0 Relative position of the send data buffer (TXBUF) within the global
memory area to which the txref parameter refers.
rxbuflen IN INT 0 Number of bytes used by this instance of the FB to store data re‐
ceived.
rxstart IN INT 0 Relative position of the receive data buffer (RXBUF) within the glob‐
al memory area to which the rxref parameter refers.
cmdref IN/OUT ARRAY[1..10] of CMD_STRUCT Array that can accept 10 commands
The commands are complex variables of type CMD_STRUCT (for
a detailed description, see section "Commands of function blocks").
txref IN/OUT ARRAY[1..n] of BYTE Transmit data
Reference to a global memory area used by several blocks. The
instance of the FB can share the memory with several other instan‐
ces.
The following values apply for n, according to the FBs:
● n := 1024 (FB _PIB_001KB)
● n := 16384 (FB _PIB_016KB)
● n := 32767 (FB _PIB_032KB)
rxref IN/OUT ARRAY[1..n] of BYTE Receive data
Reference to a global memory area used by several blocks. The
instance of the FB can share the memory with several other instan‐
ces.
The following values apply for n, according to the FBs:
● n := 1024 (FB _PIB_001KB)
● n := 16384 (FB _PIB_016KB)
● n := 32767 (FB _PIB_032KB)
done OUT BOOL FALSE TRUE = Command was executed successfully
error OUT BOOL FALSE TRUE = Error has been detected,
specification of error in parameter status
status OUT DWORD 16#00 Warning and error specification
For error = TRUE or warning = TRUE, the status parameter contains
the error or warning information (see "Error messages")
warning OUT BOOL FALSE TRUE = Warning has been detected,
specification of warning in parameter status

Standard Functions for RFID Systems


22 Function Manual, 11/2016
Parameter assignment
4.1 Function blocks _PIB_001KB / _PIB_016KB / _PIB_032KB

Name Type Data type Default Meaning


busy OUT BOOL FALSE TRUE = FB is in use,
and other commands are ignored (except for init and sreset)
rptact OUT BOOL FALSE TRUE = Request to repeat the current command was accepted by
the RFID system.
This parameter is identical to the "Repeat_Command_Active" signal
bit from the cyclic control word of the RFID system and remains
TRUE the same as this bit.
As long as parameter rptact is set to TRUE, the RFID system sup‐
plies result data of the command execution, which the user must
read.
err_ireq OUT BOOL FALSE TRUE = A fatal error has been detected by the RFID system.
This parameter is identical to the "Error_Flag" signal bit from the
cyclic control word of the RFID system and remains TRUE the same
as this bit.
The RFID system remains in the current state until a device status
command is issued or the err_ireq parameter is reset by the user
with init = TRUE.
tpc OUT BOOL FALSE TRUE = A new transponder is within range of Ident Unit or a trans‐
ponder has left the range.
The parameter is set to FALSE when the next "Inventory" command
is successfully executed.
tp OUT BOOL FALSE TRUE = A transponder is within the range of the Ident Unit
Note: This parameter is not used for barcode readers.
uin0 OUT BOOL FALSE This bit can be assigned by the vendor of the RFID system.
uin1 OUT BOOL FALSE This bit can be assigned by the vendor of the RFID system.
uin2 OUT BOOL FALSE This bit can be assigned by the vendor of the RFID system.
uin3 OUT BOOL FALSE This bit can be assigned by the vendor of the RFID system.
trlen OUT DINT 0 Display of number of data elements received after successful exe‐
cution of the command.

Description of functions
The function blocks _PIB_001KB / _PIB_016KB / _PIB_032KB implemented according to the
PNO standard provide an interface by means of which the SIMOTION application can
communicate with the corresponding Ident Units. Communication with the transponders is
command-controlled.

Standard Functions for RFID Systems


Function Manual, 11/2016 23
Parameter assignment
4.1 Function blocks _PIB_001KB / _PIB_016KB / _PIB_032KB

Graphic overview of the functionality

/HYHO
  

H[HFXWH

GRQH

EXV\

HUURU

7LPH

&DVH 7KHH[HFXWHLQSXWSDUDPHWHUUHPDLQV758(XQWLOWKH)%FDOOLVFRPSOHWH7KHH[HFXWHLQSXW
SDUDPHWHUPXVWEHUHVHWDIWHUWKHGRQHSDUDPHWHUKDVUHDFKHG758(

&DVH 7KHH[HFXWHLQSXWSDUDPHWHULVRQO\FORFNHGIRURQHFDOO7KHTXHU\LVQRWDERUWHG

&DVH 6DPHDVFDVHKRZHYHUDQHUURURFFXUV

Figure 4-1 Signal sequence diagram

Task integration (call)


The FBs _PIB_001KB / _PIB_016KB / _PIB_032KB are provided for calling in a cyclical task
and must be called in this task.during each task cycle. The execution of a job can take several
cycles. The FBs _PIB_001KB / _PIB_016KB / _PIB_032KB can be called in any cyclic tasks.
There are no restrictions placed on the functionality of the FBs
_PIB_001KB / _PIB_016KB / _PIB_032KB. A fixed time frame (e.g. IPOSynchronousTask) is
not required for the processing.

Error messages and warnings


The error and warning concept can be found in section "Error messages".

See also
Error and warning concept (Page 52)

Standard Functions for RFID Systems


24 Function Manual, 11/2016
Parameter assignment
4.2 Calling function blocks

4.2 Calling function blocks

Procedure
In order to be able to work with function blocks _PIB_001KB, _PIB_016KB and _PIB_032KB
in your user project, proceed as follows (the numbers shown in the following program segment
correspond to the steps below):
1. Create an array for the in/out parameters of the FB.
2. Create the function block instance (e.g. instance for FB _PIB_032KB).
3. Initialize function block.
4. Call instance of the function block.
5. Transfer input parameters.
6. The output parameters of the function block are accessed with <instance name of
FB>.<name of output parameter>.
Note
The program segment is an extract from the supplied application example.
The application example is included on the "SIMOTION Utilities & Applications" CD-ROM
and is available for various SIMOTION platforms. The "SIMOTION Utilities & Applications"
CD-ROM is provided free of charge with SIMOTION SCOUT.
For multi-channel Ident Units, one instance per channel must be created.

Call example

UNIT E_PIB032;

INTERFACE

VAR_GLOBAL CONSTANT

PIB_COMMAND_BUFFER_DIM : INT:= 10; // size of the command buffer


// is maximal 10
PIB_TX_BUFFER_LEN_32 : INT:= 1024 * 32 - 1; // size of the receive buffer
// for a tag of 32k
PIB_RX_BUFFER_LEN_32 : INT:= 1024 * 32 - 1; // size of the transmit buffer
// for a tag of 32k

Standard Functions for RFID Systems


Function Manual, 11/2016 25
Parameter assignment
4.2 Calling function blocks

PIB_CMD_WRITE_CONFIG : INT := 16#78; // command INIT - send device-specific


// data and initialize
PIB_CMD_FORMAT : INT := 16#66; // command FORMAT - delete all data
PIB_CMD_CREATE : INT := 16#68; // command CREATE - create a read-only file
PIB_CMD_GET_DIRECTORY : INT := 16#6d; // command GET_DIRECTORY - read the
// filesystem
PIB_CMD_WRITE : INT := 16#77; // command WRITE - write data to the file

// ...

PIB_I_FH_ADR_IO : DINT := 256; // address of the ident unit


PIB_I_FH_ADR_DIAG : DINT := 2044; // diagnostic address of the ident unit

// The following data is manufacturer-specific and must be got from the


// manufacturer. In this example it is the data for the ASM456 and can be got
// from the documentation of the ASM456.

// These are the config data for WRITE_CONFIG and FORMAT of the ASM456
// manufacturer-specific data for the command "WRITE_CONFIG"
ASM456_I_FH_WC_LEN : INT := 14;
ASM456_I_FH_WC_DAT : ARRAY [1..ASM456_I_FH_WC_LEN] OF BYTE
:= [4,0,0,0,0,8,16#42,16#34,16#30,16#FF,16#FF,0,0,1];

// manufacturer-specific data for the command "FORMAT"


ASM456_I_FH_FM_LEN : INT := 21;
ASM456_I_FH_FM_DAT_8 : ARRAY [1..ASM456_I_FH_FM_LEN] OF BYTE
:= [8(0),16#0C,4(16#41,16#31),05,01,16#4C,0];
ASM456_I_FH_FM_DAT_32 : ARRAY [1..ASM456_I_FH_FM_LEN] OF BYTE
:= [8(0),16#0C,4(16#41,16#31),06,01,16#4C,0];

END_VAR

TYPE
// here are my commands
Enum_Commands: (
cmdInit, // command INIT - send device-specific data and initialize
cmdFormat, // command FORMAT - delete all data
cmdCreate, // command CREATE - create a read-only file
cmdGetDirectory, // command GET_DIRECTORY - read the filesystem
cmdWrite // command WRITE - write data to the file
);

// ...

Standard Functions for RFID Systems


26 Function Manual, 11/2016
Parameter assignment
4.2 Calling function blocks

// these are the input-parameters for the FB


Struct_PIB_In : STRUCT
execute : BOOL; // execute a command
id: DWORD; // address of the peripheral device
index : INT; // identifier for a single ident channel
offset : INT; // offset of the buffer
rptcmd : BOOL; // repeat a command
sreset : BOOL; // software reset
init : BOOL; // initialization
uout0 : BOOL; // represents a user specific bit 0
uout1 : BOOL; // represents a user specific bit 1
uout2 : BOOL; // represents a user specific bit 2
uout3 : BOOL; // represents a user specific bit 3
rdgate : BOOL; // optional bit 8 of the cyclic control word
cmddim : INT; // max. size of commands
cmdsel : INT; // command to be selected
txbuflen : DINT; // length of the transmit buffer
txstart : DINT; // start of the transmit buffer
rxbuflen : DINT; // length of the receive buffer
rxstart : DINT; // start of the receive buffer
END_STRUCT

// these are the output-parameters for the FB


Struct_PIB_Out : STRUCT
done : BOOL := TRUE; // command successful
error : BOOL := FALSE; // error occurred
status : DWORD := 0; // status
warning : BOOL := FALSE; // warning
rptact : BOOL := FALSE; // command repetition active
err_ireq : BOOL := FALSE; // init request
tpc : BOOL := FALSE; // count present tag
tp : BOOL := FALSE; // tag present
uin0 : BOOL := FALSE; // user specific bit 0
uin1 : BOOL := FALSE; // user specific bit 1
uin2 : BOOL := FALSE; // user specific bit 2
uin3 : BOOL := FALSE; // user specific bit 3
trlen : DINT := 0; // length of the transmit buffer
END_STRUCT

// ...

END_TYPE

VAR_GLOBAL
myCmdBuf : ARRAY [1..PIB_COMMAND_BUFFER_DIM] OF _PIB_COMMAND; // the command (1)
// buffer
myTxBuf : ARRAY [1..PIB_TX_BUFFER_LEN_32] OF BYTE; // the transmit buffer
myRxBuf : ARRAY [1..PIB_RX_BUFFER_LEN_32] OF BYTE; // the receive buffer

Standard Functions for RFID Systems


Function Manual, 11/2016 27
Parameter assignment
4.2 Calling function blocks

myIn : Struct_PIB_In; // the input parameters (2)


myOut : Struct_PIB_Out; // the output parameters
myFbPIB : _PIB_032KB; // the FB

my_TX_BUFFER_LEN : INT := PIB_TX_BUFFER_LEN_32; // the size of the


// transmit buffer
my_RX_BUFFER_LEN : INT := PIB_RX_BUFFER_LEN_32; // the size of the
// receive buffer

myPIBAdrDiag : DINT := PIB_I_FH_ADR_DIAG; // the diagnostic address


myPIBAdrIO : DINT := PIB_I_FH_ADR_IO; // the io address

// ...

END_VAR

PROGRAM StartUpPIB; // program for StartupTask


PROGRAM ShutDownPIB; // program for ShutdownTask
PROGRAM PeripheralFaultPIB; // program for PeripheralFaultTask
PROGRAM TechnologicalFaultPIB; // program for TechnologicalFaultTask
PROGRAM ExamplePIB; // program for BackgroundTask with call FB _PIB_32k

END_INTERFACE

IMPLEMENTATION

// ...

// StartUpTask

PROGRAM StartUpPIB

// ...

// set default values

Standard Functions for RFID Systems


28 Function Manual, 11/2016
Parameter assignment
4.2 Calling function blocks

myIn.execute := FALSE; // execute a command (3)


myIn.id := DINT_TO_DWORD(myPIBAdrIO); // address of the peripheral device
myIn.index := 111; // identifier for a single ident channel
// (channel X1 and data transfer)
myIn.offset := 0; // offset of the buffer
myIn.rptcmd := FALSE; // repeat a command
myIn.sreset := FALSE; // software reset
myIn.init := FALSE; // initialization
myIn.uout0 := FALSE; // represents a user specific bit 0
myIn.uout1 := FALSE; // represents a user specific bit 1
myIn.uout2 := FALSE; // represents a user specific bit 2
myIn.uout3 := FALSE; // represents a user specific bit 3
myIn.rdgate := FALSE; // optional bit 8 of the cyclic control word
myIn.cmddim := PIB_COMMAND_BUFFER_DIM; // dimension of the command buffer
myIn.cmdsel := 1; // command to be selected
myIn.txbuflen := my_TX_BUFFER_LEN; // length of the transmit buffer
myIn.txstart := 1; // start of the transmit buffer
myIn.rxbuflen := my_RX_BUFFER_LEN; // length of the receive buffer
myIn.rxstart := 1; // start of the receive buffer

END_PROGRAM // End StartUpPIB

// this is the example program for the use of the PIB


// it must be in the backgroundtask
PROGRAM ExamplePIB

// ...

// call the FB
myFbPIB ( (4)
execute := myIn.execute // execute the selected command (CMDSEL) (5)
, id := myIn.id // address of the peripheral device
, index := myIn.index // identifier for a single ident channel
, offset := myIn.offset // offset of the buffer
, rptcmd := myIn.rptcmd // repeat a command
, sreset := myIn.sreset // software reset
, init := myIn.init // initialization
, uout0 := myIn.uout0 // represents a user specific bit 0
, uout1 := myIn.uout1 // represents a user specific bit 1
, uout2 := myIn.uout2 // represents a user specific bit 2
, uout3 := myIn.uout3 // represents a user specific bit 3
, rdgate := myIn.rdgate // optional bit 8 of the cyclic control word
, cmddim := myIn.cmddim // max. size of commands
, cmdsel := myIn.cmdsel // command to be selected
, txbuflen := myIn.txbuflen // length of the transmit buffer
, txstart := myIn.txstart // start of the transmit buffer
, rxbuflen := myIn.rxbuflen // length of the receive buffer
, rxstart := myIn.rxstart // start of the receive buffer
, cmdref := myCmdBuf // command buffer
, txref := myTxBuf // transmit buffer
, rxref := myRxBuf // receive buffer
);
// end call FB

Standard Functions for RFID Systems


Function Manual, 11/2016 29
Parameter assignment
4.2 Calling function blocks

// get FB-Output parameter


myOut.done := myFbPIB.done; // command successful
myOut.error := myFbPIB.error; // error occurred

IF ( myOut.error = TRUE ) // only to prevent misunderstandings (6)


THEN
myOut.status := myFbPIB.status; // get status
ELSE
myOut.status := 0; // reset status
END_IF;

myOut.warning := myFbPIB.warning; // warning


myOut.rptact := myFbPIB.rptact // command repetition active
myOut.ireq := myFbPIB.ireq // init request
myOut.tpc := myFbPIB.tpc; // count present tag
myOut.tp := myFbPIB.tp; // tag present
myOut.uin0 := myFbPIB.uin0; // user specific bit 0
myOut.uin1 := myFbPIB.uin1; // user specific bit 1
myOut.uin2 := myFbPIB.uin2; // user specific bit 2
myOut.uin3 := myFbPIB.uin3; // user specific bit 3
myOut.trlen := myFbPIB.trlen; // length of the transmit buffer
// end get FB-Output parameter

END_PROGRAM

END_IMPLEMENTATION

Standard Functions for RFID Systems


30 Function Manual, 11/2016
Parameter assignment
4.3 Commands of function blocks

4.3 Commands of function blocks

4.3.1 Overview of commands


This section describes the commands that are supported by the function blocks
_PIB_001KB / _PIB_016KB / _PIB_032KB along with the associated parameters.
Note that the commands must also be supported by the corresponding Ident Unit. For a list of
commands supported by the RFID system, consult the standard profile RFID system (e.g. ASM
456) documentation.

Commands
The following overview shows all commands supported by the standard profile. Different
commands are available, depending on the connected reader and the settings in HW Config
via the GSD file.

Table 4-2 Overview of commands

Command Command code Parameters used


Clear 16#63 'c' UID, FileName
Create 16#68 'h' UID, FileName, length, attributes, FileType
Delete 16#64 'd' UID, FileName
Dev status 16#74 't' Attributes, OffsetBuffer
Format 16#66 'f' OffsetBuffer, UID, Length
Get 16#62 'b' OffsetBuffer, Length
Get attribute 16#6B 'k' UID, FileName
Get directory 16#6D 'm' OffsetBuffer, UID, FileType
Inventory 16#69 'i' Attributes, OffsetBuffer
Mem status 16#73 's' UID, attributes, OffsetBuffer
Next 16#6E 'n' UID, NextMode
Physical read 16#70 'p' OffsetBuffer, UID, length, StartAddress
Physical write 16#71 'q' OffsetBuffer, UID, length, StartAddress
Put 16#65 'e' OffsetBuffer, Length
Read 16#72 'r' OffsetBuffer, UID, FileName, offset, length
Read BarCode 16#76 'v' OffsetBuffer, TimeOut, ObjectNumber
Read config 16#61 'a' OffsetBuffer
Set attribute 16#6F 'o' UID, FileName, attributes, FileType
Update 16#75 'u' OffsetBuffer, UID, FileName, length
Write 16#77 'w' OffsetBuffer, UID, FileName, offset, length
Write config 16#78 'x' OffsetBuffer, length, config

Standard Functions for RFID Systems


Function Manual, 11/2016 31
Parameter assignment
4.3 Commands of function blocks

Table 4-3 Overview of command codes

Command code Command Parameters used


16#61 'a' Read config OffsetBuffer
16#62 'b' Get OffsetBuffer, Length
16#63 'c' Clear UID, FileName
16#64 'd' Delete UID, FileName
16#65 'e' Put OffsetBuffer, Length
16#66 'f' Format OffsetBuffer, UID, Length
16#68 'h' Create UID, FileName, length, attributes, FileType
16#69 'i' Inventory Attributes, OffsetBuffer
16#6B 'k' Get attribute UID, FileName
16#6D 'm' Get directory OffsetBuffer, UID, FileType
16#6E 'n' Next UID, NextMode
16#6F 'o' Set attribute UID, FileName, attributes, FileType
16#70 'p' Physical read OffsetBuffer, UID, length, StartAddress
16#71 'q' Physical write OffsetBuffer, UID, length, StartAddress
16#72 'r' Read OffsetBuffer, UID, FileName, offset, length
16#73 's' Mem status UID, attributes, OffsetBuffer
16#74 't' Dev status Attributes, OffsetBuffer
16#75 'u' Update OffsetBuffer, UID, FileName, length
16#76 'v' Read BarCode OffsetBuffer, TimeOut, ObjectNumber
16#77 'w' Write OffsetBuffer, UID, FileName, offset, length
16#78 'x' Write config OffsetBuffer, length, config

General information
The following restrictions relate to the use of commands:
● The input parameters init and sreset interrupt the command execution within the Ident Unit.
● After the commands init and sreset are sent, the subsequent change of the output
parameter done relates to the commands init or sreset and not to the command that was
interrupted by the input parameters init or sreset.
● The input parameter init resets the communication (cyclic control and status flow, acyclic
commands) between FB and Ident Unit. Afterwards, the FB automatically executes the
"Write config" command. This assumes that the user enters the "Write config" command in
the first element of the in/out parameter cmdref and sets the input parameter cmdsel to "1".
Any configuration data to be written must be in place at the location in the send data buffer
indicated by the input parameter txref, to which the command parameters OffsetBuffer and
Length refer.
● The "Write config" command resets all functions within the Ident Unit, except the
communication.
● The sreset parameter cancels the last command. The execution of sreset is considerably
faster than that of init.

Standard Functions for RFID Systems


32 Function Manual, 11/2016
Parameter assignment
4.3 Commands of function blocks

Data structure CMD_STRUCT


The data structure CMD_STRUCT contains the parameters of the command. The data types
of the parameters are defined in the following program excerpt.

TYPE
CMD_STRUCT
STRUCT
CMD : BYTE;
Config : BYTE;
OffsetBuffer : INT;
UID : ARRAY[1..8] OF BYTE;
FileName : ARRAY[1..8] OF BYTE;
Offset : DINT;
Length : INT;
StartAddress : DINT;
Attributes : BYTE;
NextMode : BYTE;
Timeout : INT;
ObjectNumber : INT;
FileType : WORD;
END_STRUCT;
END_TYPE

Note
Not every command occupies every structure element.

4.3.2 Clear

Description
The "Clear" command resets the content of a file. All elements are set to "16#00".

Command code of the command

CMD : BYTE := 16#63;

Standard Functions for RFID Systems


Function Manual, 11/2016 33
Parameter assignment
4.3 Commands of function blocks

Parameters
The following table lists the parameters of the "Clear" command.

Parameter Description
UID Identification of an individual transponder
UID = 0: Any random transponder
The transponder currently located in the Ident Unit is read.
FileName File to be accessed.

4.3.3 Create

Description
The "Create" command creates a new file on a formatted transponder.

Command code of the command

CMD : BYTE := 16#68;

Parameters
The following table lists the parameters of the "Create" command.

Parameter Description
UID Identification of an individual transponder
UID = 0: Any random transponder
The transponder currently located in the Ident Unit is read.
FileName File to be generated
Length This parameter indicates the length of the file to be created.
Length = 0:
A file with dynamic length is created.
Attributes Valid values:
● Unlimited read/write = bit 0,1 not set
● Read only = bit 0 set
● Single read = bit 1 set
● Defined size = bit 2 set (the file length cannot be changed by a command)
FileType Classification/grouping of the files according to user-specific criteria. Files with the
same characteristics are assigned to the same group. Accordingly, these files are of
the same file type that is displayed with the same value of the FileType parameter.
If the parameter is not used, all bytes must be set to "16#20".

Standard Functions for RFID Systems


34 Function Manual, 11/2016
Parameter assignment
4.3 Commands of function blocks

4.3.4 Delete

Description
The "Delete" command deletes a file from the transponder. Depending on the supported file
system, the file disappears from the directory or the file length and the used length are set to
zero.

Command code of the command

CMD : BYTE := 16#64;

Parameters
The following table lists the parameters of the "Delete" command.

Parameter Description
UID Identification of an individual transponder
UID = 0: Any random transponder
The transponder currently located in the Ident Unit is read.
FileName File to be accessed

4.3.5 Dev status

Description
The "Dev status" command is used to read out the status of an Ident Unit. The status data are
stored in RXBUF. Status data are vendor-specific. The output parameter trlen of the FB
indicates the number of received bytes.

Command code of the command

CMD : BYTE := 16#74;

Standard Functions for RFID Systems


Function Manual, 11/2016 35
Parameter assignment
4.3 Commands of function blocks

Parameters
The following table lists the parameters of the "Dev status" command.

Parameters Description
Attributes Information class to be read
Valid values:
● 16#00 → reserved
● 16#01 → warning detail (vendor-specific details)
● 16#02 → error history (vendor-specific details)
● 16#03 → command history (vendor-specific details)
● 16#04 → channel-specific identification and maintenance information (I&M
information) (data recording I&M0)
● 16#05 → channel-specific I&M information (data recording I&M1)
● 16#06 → channel-specific I&M information (data recording I&M2)
● 16#07 → channel-specific I&M information (data recording I&M3)
● 16#08 → channel-specific I&M information (data recording I&M4)
● 16#09 to 16#7F → reserved
● 16#80 to 16#FF → vendor-specific
OffsetBuffer Relative offset within the RXBUF
This parameter indicates the address within the memory area where the first byte of
the data to be read is to be stored.

4.3.6 Format

Description
The "Format" command initializes the transponder. After formatting, the transponder is ready
for use.
A Security_Code (STRING[8]) must be set at the beginning of the TXBUF. This code is a
vendor-specific code for defining the transponder name and protecting against formatting with
incorrect parameters and arbitrary formatting. TXBUF is used as a vendor-specific area for
parameter data that are required for formatting. For more information, see the Ident Unit
documentation.

Command code of the command

CMD : BYTE := 16#66;

Standard Functions for RFID Systems


36 Function Manual, 11/2016
Parameter assignment
4.3 Commands of function blocks

Parameters
The following table lists the parameters of the "Format" command.

Parameter Description
OffsetBuffer Relative offset within the TXBUF
This parameter indicates the address within the memory area where the first byte of
the Security_Code to be sent is to be stored.
Other data follow consecutively.
UID Identification of an individual transponder
UID = 0: Any random transponder
The transponder currently located in the Ident Unit is read.
Length Number of bytes to be sent to the Ident Unit
The start address is designated by the command parameter OffsetBuffer.
This parameter contains the 8 bytes of the Security_Code and a variable number of
formatting parameters. The range of values is: 8…226.

4.3.7 Get

Description
The "Get" command reads out vendor-specific data located on the Ident Unit. TXBUF is used
as the vendor-specific area for parameter data (optional send data). Received data are stored
from the start of RXBUF. The output parameter trlen of the FB indicates the number of received
bytes.
For the precise meaning of the data, refer to the Ident Unit documentation.

Command code of the command

CMD : BYTE := 16#62;

Parameters
The following table lists the parameters of the "Get" command.

Parameter Description
OffsetBuffer Relative offset within the TXBUF
This parameter indicates the address within the memory area where the first byte of
the parameter data to be sent is to be stored.
Other parameter data follow consecutively.
Length Number of bytes to be sent to the Ident Unit
The start address is designated by the command parameter OffsetBuffer. The range
of values is: 0…226.

Standard Functions for RFID Systems


Function Manual, 11/2016 37
Parameter assignment
4.3 Commands of function blocks

4.3.8 Get attribute

Description
The "Get attribute" command reads out attributes associated with a file. The attributes
(attributes and file type) are stored in the directory.

Command code of the command

CMD : BYTE := 16#6B;

Parameters
The following table lists the parameters of the "Get attribute" command.

Parameter Description
UID Identification of an individual transponder
UID = 0: Any random transponder
The transponder currently located in the Ident Unit is read.
FileName File to be accessed.

The following table lists all subparameters that are passed with the response:

Parameter Description
Attributes Valid values:
● Unlimited read/write = bit 0,1 not set
● Read only = bit 0 set
● Single read = bit 1 set
● Defined size = bit 2 set (the file length cannot be changed with a command)
FileType Classification/grouping of the files according to user-specific criteria. Files with the
same characteristics are assigned to the same group. Accordingly, these files are of
the same file type that is displayed with the same value of the FileType command
parameter.
If the parameter is not used, all bytes must be set to "16#20".

Standard Functions for RFID Systems


38 Function Manual, 11/2016
Parameter assignment
4.3 Commands of function blocks

4.3.9 Get directory

Description
The "Get directory" command reads out the directory of the transponder. File names and
associated attributes are passed. The FileType command parameter is used to indicate files
of a specific type to be passed. The response data of this command are supplied in a structure
within the RXBUF as follows:

TYPE
DIRELEMENTS_STRUCT
STRUCT
FileName : ARRAY [1..8] OF BYTE;
UsedLength : DINT;
Attributes : BYTE;
FileLength : DINT;
FileType : WORD;
END_STRUCT;
END_TYPE

TYPE
DIRLIST_STRUCT
STRUCT
UID1 : ARRAY [1..8] OF BYTE;
TagName : ARRAY [1..8] OF BYTE;
FreeUserMem DINT;
CheckSum : WORD;
FileCount : INT;
FileList : ARRAY [1..FileCount] OF DIRELEMENTS_STRUCT;
END_STRUCT;
END_TYPE

The trlen parameter of the FB indicates the number of received bytes.

Command code of the command

CMD : BYTE := 16#6D;

Standard Functions for RFID Systems


Function Manual, 11/2016 39
Parameter assignment
4.3 Commands of function blocks

Parameters
The following table lists the parameters of the "Get directory" command.

Parameter Description
OffsetBuffer Relative offset within the RXBUF
This parameter indicates the address within the memory area where the first byte of
the received data is to be stored.
UID Identification of an individual transponder
UID = 0: Any random transponder
The transponder currently located in the Ident Unit is read.
FileType Classification/grouping of the files according to user-specific criteria. Files with the
same characteristics are assigned to the same group. Accordingly, these files are of
the same file type that is displayed with the same value of the FileType command
parameter.
If the parameter is not used, all bytes must be set to "16#20".
"?" (16#3F) is used as a placeholder.
"?,?" (16#3F, 16#3F) means all files.

The following table lists all subparameters that are passed with the response:

Parameter Description
UID1 Identification of an individual transponder
UID1 = 0 indicates that the transponder does not contain a UID.
If UID = 0 was to have been passed to the transponder within the command, then
UID1 supplies the UID of the present transponder.
TagName This parameter indicates the name of the transponder.
FreeUserMem This parameter indicates the unused memory on the transponder.
CheckSum Checksum of the directory on the transponder
If not used, all bytes are returned with "16#00".
FileCount Number of directory entries that are available on the transponder and supplied by
the Get directory command.
FileList This parameter supplies the list of directory entries.
FileName File name
UsedLength Memory occupied by command parameter FileLength
Attributes Valid values:
● Unlimited read/write = bit 0,1 not set
● Read only = bit 0 set
● Single read = bit 1 set
● Defined size = bit 2 set (the file length cannot be changed by a command)

Standard Functions for RFID Systems


40 Function Manual, 11/2016
Parameter assignment
4.3 Commands of function blocks

Parameter Description
FileLength Maximum file length
In the case of a dynamic file system, FileLength and UsedLength are identical.
If FileLength = 0, then the file has been deleted.
FileType Classification/grouping of the files according to user-specific criteria. Files with the
same characteristics are assigned to the same group. Accordingly, these files are of
the same file type that is displayed with the same value of the FileType command
parameter.
If the parameter is not used, all bytes must be set to "16#20".

4.3.10 Inventory

Description
The "Inventory" command is used to request a list of all currently accessible transponders
within the antenna range. Additional information can be passed, depending on the specific
vendor. Thus, in addition to the UIDs, user data can be read at the same time.

Note
The "Inventory" command causes the Ident Unit to reset the tpc output parameter. As soon as
a transponder leaves the antenna range or another transponder enters into the antenna range,
the output parameter tpc is set again. The "Inventory" command must be executed in order to
determine how many transponders are located within the antenna range.

RXBUF is structured as follows:

// RXBUF:
//
// | | | | | ... | | | | | ... | | | | | ... | | | | | ... | | |
// | ON | OL | UID | Data | UID | Data | ...
// | INT | INT | ARRAY 8 Byte | ARRAY n Byte | ARRAY 8 Byte | ARRAY n Byte |
// \_________________________/ \_________________________/
// ObjectLength of Object 1 ObjectLength of Object 2 ...
// ON : ObjectNumber
// OL : ObjectLength, OL >= 8

TYPE
ObjectNumber : INT;
ObjectLength : INT; (1)
END_TYPE

TYPE
UID_STRUCT
STRUCT
UID1 : ARRAY [1..8] OF BYTE;

Standard Functions for RFID Systems


Function Manual, 11/2016 41
Parameter assignment
4.3 Commands of function blocks

Data : ARRAY [1..(ObjectLength-8)] OF BYTE; (2)


END_STRUCT;
END_TYPE

TYPE
UidList : ARRAY [1..ObjectNumber] OF UID_STRUCT;
END_TYPE

Note
If the object length signalized by the RFID system under (1) is >8, a data array of length
(ObjectLength - 8) must be declared in (2). This length is dependent on the hardware you are
using and can also assume the value "0".

Command code of the command

CMD : BYTE := 16#69;

Parameters
The following table lists the parameters of the "Inventory" command.

Parameter Description
Attributes Specification of the information to be read
Valid values:
● 16#00 → all UIDs are read
● 16#01 to 16#7F → reserved
● 16#80 to 16#FF → vendor-specific
OffsetBuffer Relative offset within the RXBUF
This parameter indicates the address within the memory area where the first byte of
the data read is to be stored.

The following table lists all subparameters that are passed with the response:

Parameter Description
ObjectNumber Number of UIDs passed within the acknowledgement.
ObjectLength Number of bytes connected to a single UID (size of UID and additional data).
If Attributes = 16#00, then ObjectLength = 8 is set.
UidList Data field with elements of the type UID_Struct.
If Attributes = 16#00, only UIDs are stored, and no vendor-specific information is
stored.

Standard Functions for RFID Systems


42 Function Manual, 11/2016
Parameter assignment
4.3 Commands of function blocks

4.3.11 Mem status

Description
The "Mem status" command is used to read out the status of a transponder (battery status,
memory, type of transponder, available capacity). The status data are stored in RXBUF. Status
data are vendor-specific. The output parameter trlen of the FB indicates the number of received
bytes.

Command code of the command

CMD : BYTE := 16#73;

Parameters
The following table lists the parameters of the "Mem status" command.

Parameter Description
UID Identification of an individual transponder
UID = 0: Any random transponder
The transponder currently located in the Ident Unit is read.
Attributes Specification of the information class to be read.
Valid values:
● 16#00 → reserved
● 16#01 → warning detail
● 16#02 → reserved
● 16#03 → reserved
● 16#04 → physical status information (vendor-specific details)
● 16#05 → status information relating to the file system (vendor-specific details)
● 16#06 to 16#7F → reserved
● 16#80 to 16#FF → vendor-specific
OffsetBuffer Relative offset within the RXBUF
This parameter indicates the address within the memory area where the first byte of
the data to be read is to be stored.

4.3.12 Next

Description
The "Next" command does not permit any further operations on a transponder. The subsequent
command is not executed until the next transponder is detected/displayed.

Standard Functions for RFID Systems


Function Manual, 11/2016 43
Parameter assignment
4.3 Commands of function blocks

Command code of the command

CMD : BYTE := 16#6E;

Parameters
The following table lists the parameters of the "Next" command.

Parameter Description
UID Identification of an individual transponder
UID = 0: Any random transponder
The transponder currently located in the Ident Unit is locked when this command is
processed.
NextMode Valid values:
● NextMode = 0 (each transponder, irrespective of the current transponder, is
processed)
● NextMode = 1 (only another transponder is processed)

4.3.13 Physical read

Description
The "Physical read" command reads out data from a transponder by using the physical start
address and the length of the data to be read. The output parameter trlen of the FB indicates
the number of received bytes.

Command code of the command

CMD : BYTE := 16#70;

Parameters
The following table lists the parameters of the "Physical read" command.

Parameter Description
OffsetBuffer Relative offset within the RXBUF
This parameter indicates the address within the memory area where the first byte of
the received data must be saved. All subsequent bytes must be stored in ascending
addresses.
UID Identification of an individual transponder
UID = 0: Any random transponder
The transponder currently located in the Ident Unit is read.

Standard Functions for RFID Systems


44 Function Manual, 11/2016
Parameter assignment
4.3 Commands of function blocks

Parameter Description
Length Number of bytes to be read by the transponder, beginning with the address identified
by the StartAddress parameter.
StartAddress This parameter indicates a physical address within the transponder.

4.3.14 Physical write

Description
The "Physical write" command writes data to a transponder using the physical start address
and the length of the data to be written.

Command code of the command

CMD : BYTE := 16#71;

Parameters
The following table lists the parameters of the "Physical write" command.

Parameter Description
OffsetBuffer Relative offset within the TXBUF
This parameter indicates the first address within the memory area where the first byte
of the data to be sent is to be stored.
Other data follow consecutively.
UID Identification of an individual transponder
UID = 0: Any random transponder
The transponder currently located in the Ident Unit is read.
Length Number of bytes to be sent to the Ident Unit
The target address is designated by the command parameter StartAddress.
StartAddress Physical address within the transponder starting from which the data are written.

4.3.15 Put

Description
The "Put" command writes vendor-specific data to the Ident Unit.
For the precise meaning of the data, refer to the Ident Unit documentation.

Standard Functions for RFID Systems


Function Manual, 11/2016 45
Parameter assignment
4.3 Commands of function blocks

Command code of the command

CMD : BYTE := 16#65;

Parameters
The following table lists the parameters of the "Put" command.

Parameter Description
OffsetBuffer Relative offset within the TXBUF
This parameter indicates the address within the memory area where the first byte of
the data to be sent is to be stored.
Other data follow consecutively.
Length Number of bytes to be sent to the Ident Unit
The start address is designated by the command parameter OffsetBuffer.

4.3.16 Read

Description
The "Read" command reads data of a file from the Ident Unit. After successful execution of
the command, the data are saved in RXBUF. The output parameter trlen of the FB indicates
the number of received bytes.

Command code of the command

CMD : BYTE := 16#72;

Parameters
The following table lists the parameters of the "Read" command.

Parameter Description
OffsetBuffer Relative offset within the RXBUF
This parameter indicates the address within the memory area where the first byte of
the received data must be saved. All subsequent bytes must be stored in ascending
addresses.
UID Identification of a transponder
UID = 0: Any random transponder
The transponder currently located in the Ident Unit is read.
FileName This parameter indicates the file to be accessed.

Standard Functions for RFID Systems


46 Function Manual, 11/2016
Parameter assignment
4.3 Commands of function blocks

Parameter Description
Offset Relative offset within the indicated file from which the data are to be read.
This parameter indicates the start address within the file from which the data are to be
read.
Length Number of bytes to be read.
Length = -1: complete file is read

4.3.17 Read BarCode

Description
The "Read BarCode" command reads the barcode data.
After this command is sent, the barcode reader waits for a reading gate. Depending on the
operating mode of the barcode reader, the reading gate is activated by a local input on the
barcode reader or by the rdgate input parameter of the FB.
Likewise, the end of the read operation depends on the operating mode of the barcode reader.
It can be initiated by the gate signal, a local timer, or the receipt of the expected barcode data
(timer).
The output parameter done is activated by the function block once the barcode reader has
finished reading and the result of the read operation has been stored in RXBUF.
The command parameter ObjectNumber can be used to send an object identifier to the barcode
reader. The barcode reader can place this identifier in a specific position in the data string of
the read result, which makes the link between the object and the barcode data more easily
recognized by the user.
If the "Read BarCode" parameter is repeated by activation of the input parameter rptcmd of
the FB, the command parameter ObjectNumber is incremented.

Command code of the command

CMD : BYTE := 16#76;

Standard Functions for RFID Systems


Function Manual, 11/2016 47
Parameter assignment
4.3 Commands of function blocks

Parameters
The following table lists the parameters of the "Read BarCode" command.

Parameter Description
OffsetBuffer Relative offset within the TXBUF
This parameter indicates the address within the memory area where the first byte of
the data to be sent is to be stored.
Timeout Maximum time for a read operation before a timeout is generated.
If the value of the command parameter Timeout is set to "0", time monitoring does
not occur.
The basic setting for this parameter is 10 ms.
ObjectNumber Linking of an object with its barcode information
The barcode reader can set this number in its read result message frame.
If the input parameter rptcmd of the FB is active, the ObjectNumber is incremented
with each read operation.
Value range of the parameter: 0…1023
After the value 1023 has been exceeded, the counting begins with "0".

4.3.18 Read config

Description
The "Read Config" command is used to read out configuration data from the Ident Unit. RXBUF
is used as an area for configuration data. Configuration data are vendor-specific. The output
parameter trlen of the FB indicates the number of received bytes.

Command code of the command

CMD : BYTE := 16#61;

Parameters
The following table lists the parameters of the "Read Config" command.

Parameter Description
OffsetBuffer Relative offset within the RXBUF
This parameter indicates the address within the memory area where the first byte of
the data to be read is to be stored.

Standard Functions for RFID Systems


48 Function Manual, 11/2016
Parameter assignment
4.3 Commands of function blocks

4.3.19 Set attribute

Description
The "Set attribute" command sets/changes the attributes associated with a file. These
attributes are stored in the directory on the transponder.

Command code of the command

CMD : BYTE := 16#6F;

Parameters
The following table lists the parameters of the "Set attribute" command.

Parameter Description
UID Identification of an individual transponder
UID = 0: Any random transponder
The transponder currently located in the Ident Unit is read.
FileName File to be accessed.
Attributes Valid values:
● Unlimited read/write = bit 0,1 not set
● Read only = bit 0 set
● Single read = bit 1 set
● Defined size = bit 2 set (the file length cannot be changed with a command)
FileType Classification/grouping of the files according to user-specific criteria. Files with the
same characteristics are assigned to the same group. Accordingly, these files are of
the same file type that is displayed with the same value of the FileType command
parameter.
If the parameter is not used, all bytes must be set to "16#20".

4.3.20 Update

Description
The "Update" command writes data to a file located on the transponder. The file length is
updated exactly to the number of written data. This command always refers to the entire file.

Command code of the command

CMD : BYTE := 16#75;

Standard Functions for RFID Systems


Function Manual, 11/2016 49
Parameter assignment
4.3 Commands of function blocks

Parameters
The following table lists the parameters of the "Update" command.

Parameter Description
OffsetBuffer Relative offset within the TXBUF
This parameter indicates the address within the memory area where the first byte of
the data to be sent is to be stored.
UID Identification of an individual transponder
UID = 0: Any random transponder
The transponder currently located in the Ident Unit is read.
FileName File to be accessed.
Length Number of bytes to be written to the file

4.3.21 Write

Description
The "Write" command writes data to a file located on the transponder. If the number of bytes
to be written is smaller than the file length, bytes that are not overwritten remain unchanged.

Command code of the command

CMD : BYTE := 16#77;

Parameters
The following table lists the parameters of the "Write" command.

Parameters Description
OffsetBuffer Relative offset within the TXBUF
This parameter indicates the address within the memory area where the first byte of
the data to be sent is to be stored.
UID Identification of an individual transponder
UID = 0: Any random transponder
The transponder currently located in the Ident Unit is read.
FileName File to be accessed.
Offset Relative offset within the indicated file to which the data are to be written.
● Offset = 0: data begin at file start
● Offset = -1: data are added to the file
Length Number of bytes to be written to the file

Standard Functions for RFID Systems


50 Function Manual, 11/2016
Parameter assignment
4.3 Commands of function blocks

4.3.22 Write config

Description
The "Write config" command is used to modify operation of the Ident Unit, except for
interruption of the communication. It is possible to send new parameters to the Ident Unit
(configuration data). A reset can also be initiated to prompt the Ident Unit to restart operation
("Restart"). TXBUF is used as an area for configuration data. Configuration data are vendor-
specific.
Refer to the documentation of the relevant standard profile RFID system to learn which values
the Config parameter can accept.

Note
The "Write config" command must always be in the first position in the command buffer
(cmdref [1]). When the input parameter init is executed, the "Write config" command is
automatically executed. The data are automatically retrieved from the first buffer. Cmdsel must
be set to 1. If the "Write config" command is started with execute, the input parameter
cmdsel must be set accordingly.

Command code of the command

CMD : BYTE := 16#78;

Parameters
The following table lists the parameters of the "Write config" command.

Parameter Description
OffsetBuffer Relative offset within the TXBUF
This parameter indicates the address within the memory area where the first byte of
the data to be sent is to be stored.
Length Number of configuration data bytes to be written to the Ident Unit
Config ● Config = 0 → not permitted
● Config = 1 → reset, no configuration data
● Config = 2 → no reset, configuration data to be sent
● Config = 3 → reset, configuration data to be sent
● Config > 3 → reserved

Standard Functions for RFID Systems


Function Manual, 11/2016 51
Parameter assignment
4.4 Error messages

4.4 Error messages

4.4.1 Overview
This chapter covers the error and warning concept of the function blocks _PIB_001KB /
_PIB_016KB / _PIB_032KB.
If an error occurs, the output parameter error = TRUE is set. If a warning occurs, the output
parameter warning = TRUE is set. More details about the error or warning are provided in
output parameter status. In the event of an error, the relevant error number is displayed in this
output parameter. If no errors or warnings have occurred, status has a value of "16#00".

Note
The status parameter is not reset when the next command is called and is available until the
next error message. Evaluate the status parameter only when error = TRUE.

The status output parameter consists of a compact array (ARRAY) of 4 bytes. Bit 4 of byte 0
distinguishes between an error message and a warning:
● Bit 4 = 0 → error message pending
● Bit 4 = 1 → warning pending

4.4.2 Error and warning concept


The function blocks _PIB_001KB / _PIB_016KB / _PIB_032KB indicate that the requested
command has been executed successfully. The error messages have the following functions:
1. Controlling of program execution
2. Output of error messages via the user program or the control system

status
In the event of an error, the corresponding error number is displayed in the status output
parameter. If no errors or warnings have occurred, status has a value of "16#00". The status
parameter is not reset when the next command is called and is available until the next error
message.
The error number in the status output parameter consists of a compact array (ARRAY) of 4
bytes, which are described in the table below.

Table 4-4 Structure of 'status' output parameter

Byte Name Type Definition


0 Function_Num Byte Grouping in error messages and warnings, see "Function_Num"
1 Error_Decode Byte Definition of the meaning of Function_Num, Error_Code_1, and Er‐
ror_Code_2, see "Error_Decode"

Standard Functions for RFID Systems


52 Function Manual, 11/2016
Parameter assignment
4.4 Error messages

Byte Name Type Definition


2 Error_Code_1 Byte Contains warning and error numbers, see "Error_Code_1"
3 Error_Code_2 Byte Warnings or vendor-specific errors, see "Error_Code_2"

The following figure shows the structure of the status output parameter.

VWDWXV ':25'

%\WHV )XQFWLRQB1XP (UURUB'HFRGH (UURUB&RGHB (UURUB&RGHB

)XQFWLRQB1XP

%LWV         6HHWDEOH(UURUB&RGHB

)XQFWLRQB&RGH
(UURUB&RGHB  ZDUQLQJ HUURUPHVVDJH
3'8B,GHQWLILHU
)UDPHB6HOHFW

Figure 4-2 Output parameter 'status'

These bytes are described in detail below.

Note
See section "Examples for reading out error numbers" to learn how to read out error messages
and warnings from the status parameter.

Function_Num
The Function_Num byte of the status output parameter consists of 8 bits. They are defined as
follows:

Bit 0 to 3 Function_Code / Error_Code


Bit 4 Error_Code_2 (error/warning)
Bit 5 to 6 PDU_Identifier
Bit 7 Frame_Select

Standard Functions for RFID Systems


Function Manual, 11/2016 53
Parameter assignment
4.4 Error messages

The following table contains the values that can be assumed by the Function_Num byte.

Table 4-5 Function_Num

Frame_Select PDU_Identifier Error_Code_2 Function_Code / Description according to profile


(Bit 7) (Bits 6 to 5) (Bit 4) Error_Code
(Bits 3 to 0)
0 0..3 0/1 0..15 No error
1 0, 1 0/1 0..15 Error does not relate to the PROFIBUS DP protocol
and is not defined for this profile.
1 2 0/1 0..15 Error message relating to PROFIBUS DP protocol
1 3 0/1 0 Vendor-specific code of Error_Code_1 and Er‐
ror_Code_2

1 3 0/1 1 Error_Code_1 provides error information relating to


the transponder
Vendor-specific code of Error_Code_2
1 3 0/1 2 Error_Code_1 provides error information relating to
the radio interface
Vendor-specific code of Error_Code_2
1 3 0/1 3 Error_Code_1 provides error information relating to
the file system
Vendor-specific code of Error_Code_2
1 3 0/1 4 Error_Code_1 provides error information relating to
the Ident Unit (interrogator/barcode reader)
Vendor-specific code of Error_Code_2
1 3 0/1 5 Error_Code_1 provides error information relating to
communication between FB and Ident Unit (except for
PROFIBUS DP errors)
Vendor-specific code of Error_Code_2
1 3 0/1 6 Error_Code_1 provides command-specific error infor‐
mation
Vendor-specific code of Error_Code_2
1 3 0/1 7 Error_Code_1 provides error information generated
internally by the FB
1 3 0/1 8..15 Not defined

Error_Decode
The Error_Decode byte contains the meaning of the bytes Function_Num, Error_Code_1, and
Error_Code_2.
The following table contains the values that can be assumed by the Error_Decode byte.

Table 4-6 Error_Decode

Error_Decode Source Meaning


16#00 Control Not a warning, not an error
16#01 to 16#7F Control Warning (not used for this profile)

Standard Functions for RFID Systems


54 Function Manual, 11/2016
Parameter assignment
4.4 Error messages

Error_Decode Source Meaning


16#80 DPV1 Error report in accordance with IEC 61158-6
16#81 to 16#8F Control Error report matching the nth parameter of the call of the communication FB.
The exact definition of the communication FB is provided in the following doc‐
umentation:
PROFIBUS Communication and Proxy Function Blocks acc. to IEC 61131-3,
Version 1.2, July 2001
16#90 to 16#FD - Reserved
16#FE Profile (FB, Ident Unit) Profile-specific error
16#FF Profile (FB, Ident Unit) Reserved for future use

Error_Code_1
The Error_Code_1 byte supplies a number that assigns the error message or warning. In the
following table, the value "16#FE" is specified for the Error_Decode byte. Bits 0 to 3 correspond
to bits 0 to 3 of the Function_Num byte.

Table 4-7 Error_Code_1

Function_Code / Error_Code_1 Indexed by Meaning


Error_Code (decimal)

Errors and warnings relating to the transponder


1 1 Ident Unit Memory error of the transponder
1 2 Ident Unit Presence error
- transponder is no longer within the transmission window
1 3 Ident Unit Address or command does not match the transponder characteristics
(memory capacity).
1 4 Ident Unit Transponder defective
Transponder or batteries must be replaced.
1 5 Ident Unit Transponder capacity is exceeded.
1 6 Ident Unit Unformatted transponder
1 7 Ident Unit Incompatible data structure of transponder
The transponder must be reformatted.
1 8 Ident Unit The transponder in the transmission window does not have the expected
UID.
1 9 Ident Unit Command is not supported by the transponder
1 10 Ident Unit Access error (e.g. block locked), see ISO 18000-x
1 11...127 Ident Unit Reserved for future profile use
1 128...255 Ident Unit Vendor-specific

Errors and warnings relating to the radio interface


2 1 Ident Unit Time limit exceeded for communication via radio interface
2 2 Ident Unit There are more transponders in the transmission window than is permitted.
2 3…127 Ident Unit Reserved for future profile use
2 128...255 Ident Unit Vendor-specific

Standard Functions for RFID Systems


Function Manual, 11/2016 55
Parameter assignment
4.4 Error messages

Function_Code / Error_Code_1 Indexed by Meaning


Error_Code (decimal)

Errors and warnings relating to the file system


3 1 Ident Unit Error in file name
3 2 Ident Unit File not available
3 3 Ident Unit The type of transponder is incorrect or inappropriate for the selected oper‐
ating mode. A file system cannot be accessed on the transponder.
3 4 Ident Unit Command is being created
No further directory entries are available.
3 5 Ident Unit Command is being created
The directory already contains this file.
3 6 Ident Unit Error relating to access rights
3 7 Ident Unit File length exceeded
3 8 Ident Unit File cannot be accessed or is damaged
3 9…127 Ident Unit Reserved for future profile use
3 128...255 Ident Unit Vendor-specific

Errors and warnings relating to the Ident Unit


4 1 Ident Unit Power supply failure
4 2 Ident Unit Hardware fault in the Ident Unit
4 3 Ident Unit Antenna not operating; e.g., switched off or disconnected from system
4 4 Ident Unit Capacity of command buffer in the Ident Unit is exceeded.
4 5 Ident Unit Capacity of data buffer in the Ident Unit is exceeded.
4 6 Ident Unit Command is not supported by the Ident Unit in this mode.
4 7 Ident Unit Ident Unit is returning a non-specific error message that was indexed by
the cyclic status word (e.g. antenna does not work, etc.). This error mes‐
sage does not relate to a specific command.
4 8…127 Ident Unit Reserved for future profile use
4 128...255 Ident Unit Vendor-specific

Errors and warning relating to the communication between the FB and the Ident Unit
5 1 Ident Unit Incorrect sequence number (SN)
5 2 FB Incorrect sequence number (SN)
5 4 Ident Unit Invalid data block number (DBN)
5 5 FB Invalid DBN
5 6 Ident Unit Invalid data block length (DBL)
5 7 FB Invalid DBL
5 8 Ident Unit Command of another user is being processed
5 9 FB The Ident Unit is performing a hardware reset (Init_Active is set to "1"), and
the init input parameter (bit 15 in cyclic control word) is expected by the FB.
5 10 FB The "CMD" command signal and the relevant acknowledgement do not
match. This is a software or synchronization error that does not occur during
normal operation.
5 11 FB Incorrect sequence of acknowledgement message frame (TDB/DBN)

Standard Functions for RFID Systems


56 Function Manual, 11/2016
Parameter assignment
4.4 Error messages

Function_Code / Error_Code_1 Indexed by Meaning


Error_Code (decimal)
5 12 FB Synchronization error (increment of AC_H/AC_L and CC_H/CC_L in cyclic
control word is incorrect).
The init input parameter of the FB is required for execution.
5 13…127 Ident Unit Reserved for future profile use
5 128...255 Ident Unit Vendor-specific

Command-specific errors and warnings


6 1 Ident Unit Invalid "CMD" command signal
6 2 Ident Unit Invalid command index (CI)
6 3 Ident Unit Invalid command parameter (e.g. data area)
6 4 Ident Unit Object detection error
Error in synchronization between user program and transponder An expec‐
ted command is missing.
6 5 Ident Unit In this state, only the "Write config" command is permitted.
6 6 FB Starting time expired
6 7…127 Ident Unit Reserved for future profile use
6 128...255 FB Vendor-specific

Error information generated internally by the FB


7 1 FB In this state, only the init parameter of the FB is permitted.
7 2 FB "CMD" command signal is not permitted
7 3 FB The Length parameter of the command is too long for the global data re‐
served in RXBUF.
7 4 FB Capacity of RXBUF exceeded (more data were received than memory
available in the RXBUF).
7 5 FB Only the init parameter of the FB is permitted as the next command. All
other commands are rejected.
7 6 FB Wrong index (outside of permissible range of 101 to 108)
7 7 FB Ident Unit is not responding to the init input parameter (Init_Active is expec‐
ted in the cyclic status communication).
7 8 FB Time exceeded during init
7 9…127 FB Reserved for future profile use
7 128…255 FB Vendor-specific

Error_Code_2
If bit 4 of the Function_Num byte is set to "1", then the Error_Code_2 byte contains more
information.
The figure below shows the coding of warnings. Here, the value "16#FE" is specified for the
Error_Decode byte, and the source of the warnings is always the Ident Unit.

Standard Functions for RFID Systems


Function Manual, 11/2016 57
Parameter assignment
4.4 Error messages

(UURUB&RGHB

%LWV  

6HWWR
9HQGRUVSHFLILF
9HQGRUVSHFLILFZKHQWKH,GHQW8QLWLVDEDUFRGHUHDGHU
/RZEDWWHU\VWDWXVZKHQWKH,GHQW8QLWLVDQ5),'

9HQGRUVSHFLILF

Figure 4-3 Error_Code_2

If the warning bit is set to "0", the Error_Code_2 byte can contain vendor-specific information.
The warnings are displayed by the acyclic acknowledgement message frame in byte 5.

4.4.3 Error in acyclic and cyclic data transfer


In addition to the error messages supplied by the Ident Unit and the function blocks, the
following error messages and warnings are specified by the SIMOTION System in the status
output parameter:

Table 4-8 Error messages and warnings during acyclic data transfer: Writing data

Error number Meaning


16#C0845700 Error: Data length
16#C0835700 Error: Index value
16#D080D1xx Warning: Data transfer aborted by user:
"ABORT_CURRENT_COMMAND"
16#C080D3xx Error: too many job repetitions
16#C080D5xx Error: indexed by return value of _writeRecord system function
16#C080D7xx Error: unknown return value of_writeRecord system function

xx: least significant byte of return value of _writeRecord system function

Table 4-9 Error messages and warnings during acyclic data transfer: Reading data

Error number Meaning


16#C0845200 Error: Data length
16#C0835200 Error: Index value
16#D080D0xx Warning: Data transfer aborted by user: "ABORT_CURRENT_COMMAND"
16#C080D2xx Error: too many job repetitions

Standard Functions for RFID Systems


58 Function Manual, 11/2016
Parameter assignment
4.4 Error messages

Error number Meaning


16#C080D4xx Error: indexed by return value of _readRecord system function
16#C080D6xx Error: unknown return value of _readRecord system function

xx: least significant byte of return value of _readRecord system function

Note
For a description of the system functions _writeRecord and _readRecord, see
SIMOTION C2xx / P350 / D4xx System Function/Variables Parameter Manual.
These documents are included in the SIMOTION SCOUT scope of delivery as electronic
documentation.

Table 4-10 Error messages during cyclic data transfer Reading data

Error number Meaning


16#DF80B200 Invalid slot (id), or I/O variables for the RFID device do not exist or are invalid (data
type: BYTE)
16#DF80B600 I/O access failed
16#DF80B700 Invalid area (offset)

Table 4-11 Error messages during cyclic data transfer Writing data

Error number Meaning


16#DE80B200 Invalid slot (id), or I/O variables for the RFID device do not exist or are invalid (data
type: BYTE)
16#DE80B600 I/O access failed
16#DE80B700 Invalid area (offset)

4.4.4 Examples of reading out error numbers


The following examples show you how to read out the meaning of the warnings and error
messages from an error number of the status output parameter.

Example 1
The error output parameter is set to TRUE by the function block _PIB_001KB / _PIB_016KB /
_PIB_032KB. The error number 16#E3FE0700 is displayed in the status output parameter.
This error number can be broken down as follows:

Standard Functions for RFID Systems


Function Manual, 11/2016 59
Parameter assignment
4.4 Error messages

VWDWXV ':25'  ()(

( )(  
%\WHV )XQFWLRQB1XP (UURUB'HFRGH (UURUB&RGHB (UURUB&RGHB

)XQFWLRQB1XP

%LWV         6HHWDEOH(UURUB&RGHB

)XQFWLRQB&RGH 
(UURUB&RGHB  HUURUPHVVDJH
3'8B,GHQWLILHU
)UDPHB6HOHFW

Figure 4-4 Error message: Example 1

From the Function_Num byte, Bit 4 = 0 indicates that an error message is present. From the
table "Function_Num", you receive the following meaning for Function_Code = 3:

Frame_Select PDU_Identifier Error_Code_2 Function_Code / Er‐ Description according to profile


(bit 7) (bits 6 to 5) (bit 4) ror_Code (Bit 3 to 0)
1 3 0/1 3 Error_Code_1 provides error information relating
to the file system;
Vendor-specific code of Error_Code_2

You can find the meaning for Error_Code_1 = 7 in the table "Error_Code_1":

Function_Code / Error_Code_1 Indexed by Meaning


Error_Code (decimal)
3 7 Ident Unit File length exceeded

For error number status = 16#E3FE0700, this results in the error message that the previous
command has attempted to transfer too large a file.

Example 2
The error output parameter is set to TRUE by the function block _PIB_001KB / _PIB_016KB /
_PIB_032KB. The error number 16#C080D5A1 is displayed in the status output parameter.
This error number can be broken down as follows:

Standard Functions for RFID Systems


60 Function Manual, 11/2016
Parameter assignment
4.4 Error messages

VWDWXV ':25'  ()(

&  ' $
%\WHV )XQFWLRQB1XP (UURUB'HFRGH (UURUB&RGHB (UURUB&RGHB

)XQFWLRQB1XP

%LWV         6HHWDEOH(UURUB&RGHB

)XQFWLRQB&RGH 
(UURUB&RGHB  HUURUPHVVDJH
3'8B,GHQWLILHU
)UDPHB6HOHFW

Figure 4-5 Error message: Example 2

From the Function_Num byte, Bit 4 = 0 indicates that an error message is present. From the
table "Function_Num", you receive the following meaning for Function_Code = 0:

Frame_Select PDU_Identifier Error_Code_2 Function_Code / Er‐ Description according to profile


(bit 7) (bits 6 to 5) (bit 4) ror_Code (Bit 3 to 0)
1 2 0/1 0 Error message relating to PROFIBUS DP protocol

Errors of this category are not profile-specific errors and are therefore addressed in section
"Errors during acyclic and cyclic data transfer". In table "Error messages and warnings during
acyclic data transfer: writing data", you will find the meaning of error number
1616#C080D5A1:

Error code Meaning


16#C080D5xx Error: indexed by return value of _writeRecord system function

xx: least significant byte of return value of _writeRecord system function

In the SIMOTION C230-2 System Functions/Variables list manual, you will find the following
entry under _writeRecord :

16#FFFF80A1 Error during data set transfer, job aborted. Negative acknowledgment when
writing to module:
- Module removed during write operation
- Module defective

For error number status = 16#C080D5A1, this results in the error message that the error is
module-specific and the module may have to be replaced.

Standard Functions for RFID Systems


Function Manual, 11/2016 61
Parameter assignment
4.4 Error messages

Standard Functions for RFID Systems


62 Function Manual, 11/2016
Application example 5
5.1 General information on the application example

Introduction
The "E_PIB032" application example shows you how to exchange data between the
SIMOTION system and the RFID system ASM 456 using the _PIB_001KB, _PIB_016KB, and
_PIB_032KB function blocks. The following commands are provided in the application example
for data exchange:
● Initialize the Ident Unit (Write config)
● Format the transponder (Format)
● Create a new file on a formatted transponder (Create)
● Write data to a transponder file (Write)
● Read out the transponder directory (Get directory)

Requirements
The application example is available for the RFID system ASM 456 (type: MOBY I-Filehandler)
and a transponder for a maximum data amount of 32 KB.
The following requirements must be met:
● You have installed the GSD file in your language. You need the GSD file in order to insert
the ASM 456 into the device catalog where you can select it in HW Config.
● You need a transponder for a maximum data amount of 32 KB.
● Vendor-specific data are needed in the example for the "Write config" and "Format"
commands. The vendor-specific data can be found in the user documentation for the RFID
system ASM 456.

Hardware platform
The application example is available for various SIMOTION hardware platforms.

Note
If the application example is not available for your hardware platform, you must adapt the
hardware configuration.

Standard Functions for RFID Systems


Function Manual, 11/2016 63
Application example
5.1 General information on the application example

Calling the application example


The application example can be found on the "SIMOTION Utilities & Applications" CD-ROM.
The "SIMOTION Utilities & Applications" CD-ROM is provided free of charge with SIMOTION
SCOUT.
1. Dearchive and open the project containing the application example.
2. Check the axis configuration: PROFIBUS DP addresses.
3. Save and compile the example project. Then, you can download the example to the
SIMOTION device and switch to RUN mode.

Adapting the application example


The configuration in the example and its available hardware must be adapted.
The following options are available:
1. You can adapt the configuration of the example to the available hardware.
2. You can adapt the configuration of the hardware to the example.

Adapting the configuration of the example to the available hardware


You have assigned a module address <> 256 in HW Config.
1. Open the DP Slave Properties dialog box in HW Config by double-clicking the ASM456
module. Then select the Parameter Assignment tab.
2. In the Parameter Assignment tab, open the Station parameters folder and the Device-
specific parameters subfolder. Set the device-specific parameters as follows:
– USER-Mode = RFID standard profile.
– MOBY-Mode = MOBY I-Filehandler
Acknowledge the entry with OK.

Figure 5-1 Setting device-specific parameters

Standard Functions for RFID Systems


64 Function Manual, 11/2016
Application example
5.1 General information on the application example

3. Set the start address of the input and output address area to the value that you have
assigned in HW Config (e.g. 256).
4. This results in the following addresses for the ZSW/STW, for example:
– pibfhzswin : PIB 256 : Array 4 ("PIB" = Peripheral Input: Byte)
– pibfhstwout : PQB 256 : Array 4 ("PQB" = Peripheral Output: Byte)
Create these I/O addresses in the Symbol Browser.
In the application example, you need vendor-specific data for the "Write config" and "Format"
commands. You obtain the following settings from the user documentation of the ASM 456,
which you must adapt in the application example.
● Vendor-specific data for the "Write config" command:

ASM456_I_FH_WC_LEN : INT := 14;


ASM456_I_FH_WC_DAT : ARRAY [1..ASM456_I_FH_WC_LEN] OF BYTE
:= [4,0,0,0,0,8,16#42,16#34,16#30,16#FF,16#FF,0,0,1];

● Vendor-specific data for the "Format" command:

ASM456_I_FH_FM_LEN : INT := 21;


ASM456_I_FH_FM_DAT_8 : ARRAY [1..ASM456_I_FH_FM_LEN] OF BYTE
:= [8(0),16#0C,4(16#41,16#31),05,01,16#4C,0];
ASM456_I_FH_FM_DAT_32 : ARRAY [1..ASM456_I_FH_FM_LEN] OF BYTE
:= [8(0),16#0C,4(16#41,16#31),06,01,16#4C,0];

Note
When another transponder is used (e.g. for maximum data amount of 1 KB), you must adapt
the following in the application example:
● Adapt the myMdsSize parameter as well as the CONFIG and FORMAT arrays to your
transponder as appropriate.
● Set the myFbPIB parameter: _PIB_001KB.
● Adapt the array length of in/out parameters txref and rxref to the utilized FB as appropriate.

Standard Functions for RFID Systems


Function Manual, 11/2016 65
Application example
5.2 Sequence of the application example

5.2 Sequence of the application example

Command processing
Proceed as follows to initiate the command processing in the example program:
1. Open the Symbol Browser in SIMOTION SCOUT.
2. To select a command, set the myCommand parameter in the Symbol Browser to the
command to be executed.
Note
You must always set the myCommand parameter to the cmdInit command to initialize the
Ident Unit at the beginning of command processing.

3. Start the selected command by setting the myExecuteCmd parameter to TRUE.


4. Wait for the indication that the command processing was completed without errors, i.e.
done = TRUE, error = TRUE and warning = TRUE at the output parameters of the utilized
FB. An error or a warning during command processing is indicated with error = TRUE or
warning = TRUE.
5. Once the command has been processed successfully, you can start additional commands.

Example: Initializing Ident Unit


Vendor-specific configuration data of the ASM456 must be transferred to the transmit data
buffer (TXBUF) of the Ident Unit for initialization of the Ident Unit. The "Write config" command
initializes the Ident Unit and must always be first in the command buffer.
In the example, the "Init" command (cmdInit) is implemented such that all relevant parameters
are set to the required values in Step 1. Proceed as follows to execute the "Init" command (as
well as the implicitly associated "Write-Config" command:
1. In the Symbol Browser, set parameter myCommand = cmdInit.
2. Start the command with myExecuteCmd = TRUE.
3. Wait for the indication that the command processing was completed without errors, i.e.
done = TRUE, error = TRUE and warning = TRUE at the output parameters of the utilized
FB.
Once the command has been processed successfully, you can start additional commands.

Standard Functions for RFID Systems


66 Function Manual, 11/2016
Application example
5.2 Sequence of the application example

Example: Formatting the transponder


The "Format" command initializes the transponder. After formatting, the transponder is ready
for use. Vendor-specific data of the ASM456 must be transferred to the transmit data buffer
(TXBUF) of the Ident Unit for definition of the transponder name. Proceed as follows to execute
the "Format" command:
1. In the Symbol Browser, set parameter myCommand = cmdFormat.
2. Start the command with myExecuteCmd = TRUE.
3. Error-free command execution is indicated in the utilized FB with done = TRUE,
error = TRUE and warning = TRUE. The transponder is formatted and ready for use in the
application.

Example: Creating a (read-only) file on the formatted transponder


The "Create" command is used to create a new file on the formatted transponder. This file is
read-only. Proceed as follows to execute the "Create" command:
1. In the Symbol Browser, set parameter myCommand = cmdCreate.
2. Start the command with myExecuteCmd = TRUE.
3. Error-free command execution is indicated in the utilized FB with done = TRUE,
error = TRUE and warning = TRUE. The file has been created on the transponder.

Example: Writing data to a transponder file


You can use the "Write" command to write data to a file that you previously created on the
transponder. Proceed as follows to execute the "Write" command:
1. In the Symbol Browser, set parameter myCommand = cmdWrite.
2. Assign the data that are to be written to the transponder file to the FileName command
parameter.
3. Start the command with myExecuteCmd = TRUE.
4. Error-free command execution is indicated in the utilized FB with done = TRUE,
error = TRUE and warning = TRUE. The data have been transferred to the transponder file.

Example: Reading out the transponder directory


You can use the "Get directory" command to read out the directory of the transponder. File
names and associated attributes are passed by the transponder. Proceed as follows to execute
the "Get directory" command:
1. In the Symbol Browser, set parameter myCommand = cmdGetDirectory.
2. Start the command with myExecuteCmd = TRUE.
3. Error-free command execution is indicated in the utilized FB with done = TRUE,
error = TRUE and warning = TRUE.
The read out data are displayed in the output parameters of the "Get directory" command
(see parameter description in "Get Directory").

Standard Functions for RFID Systems


Function Manual, 11/2016 67
Application example
5.2 Sequence of the application example

Standard Functions for RFID Systems


68 Function Manual, 11/2016
Appendix A
A.1 List of abbreviations

Table A-1 Abbreviations

Abbreviation Meaning
ASM Interface modules
CI Command index
DBL Data block length
DBN Data block number
DP Distributed I/O
DPV1 Short term for expanded DP functions in PROFIBUS-DP (IEC 61158)
FB Function block
GSD Device data file
IN Input parameters
I&M Identification and maintenance functions
IN/OUT In/out parameter
MOBY Mobile identification system
OUT Output parameters
PIB Proxy Ident Block
PNO PROFIBUS User Organization
RFID Radio Frequency Identification
RXBUF Receive data buffer indicated by the rxref input parameter of the FB
SN Sequence number
ST Structured text
STW Control word
TDB Total number of data blocks
TXBUF Transmit data buffer indicated by the txref input parameter of the FB
UID Unique Identifier (identification of a transponder)
ZSW Status word

Standard Functions for RFID Systems


Function Manual, 11/2016 69
Appendix
A.1 List of abbreviations

Standard Functions for RFID Systems


70 Function Manual, 11/2016
Index

A F
Application example, 63 Function block
_PIB_001KB, 19
_PIB_016KB, 19
C _PIB_032KB, 19
Call example, 25
CMD_STRUCT
Parameters, 33
G
Commands GSD file
Clear, 33 for ASM 456, 12
Create, 34
Delete, 35
Dev status, 35 P
Format, 36
Parameter description, 21
Get, 37
Product description, 13
Get attribute, 38
Get directory, 39
Inventory, 41
Mem status, 43
R
Next, 43 References, 3
Physical read, 44
Physical write, 45
Put, 45 T
Read, 46
Task integration, 24
Read BarCode, 47
Read config, 43, 48
Set attribute, 49
Update, 49
W
Write, 50 Warnings, 52
Write config, 51

E
Error and warning concept, 52
Error messages, 52
Examples, 59
Special cases, 58
status, 52
Error_Code_1, 55
Error_Code_2, 58
Error_Decode, 54

Standard Functions for RFID Systems


Function Manual, 11/2016 71
Index

Standard Functions for RFID Systems


72 Function Manual, 11/2016

You might also like