RFID Functions en-US
RFID Functions en-US
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.
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
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
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
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
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).
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.
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.
352),%86FDEOH 5HDGHU
5DGLRLQWHUIDFH
7RDGGLWLRQDO352),%86'3
QRGHV
7UDQVSRQGHU
Components
The most important components of a SIMOTION application for writing to and reading from
transponders are listed below along with their functions.
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.
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
Example:
VAR_GLOBAL
myFbPib001KB : _PIB_001KB; // instance of FB _PIB_001KB
END_VAR
B3,%B.%B3,%B.%B3,%B.%
(1 (12
%22/ H[HFXWH GRQH %22/
,17 W[VWDUW
,17 U[EXIOHQ
,17 U[VWDUW
/$'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.
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.
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.
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.
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.
B3,%B.%B3,%B.%B3,%B.%
(1 (12
%22/ H[HFXWH GRQH %22/
,17 W[VWDUW
,17 U[EXIOHQ
,17 U[VWDUW
/$'VSHFLILFSDUDPHWHUV
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.
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.
/HYHO
H[HFXWH
GRQH
EXV\
HUURU
7LPH
&DVH 7KHH[HFXWHLQSXWSDUDPHWHUUHPDLQV758(XQWLOWKH)%FDOOLVFRPSOHWH7KHH[HFXWHLQSXW
SDUDPHWHUPXVWEHUHVHWDIWHUWKHGRQHSDUDPHWHUKDVUHDFKHG758(
&DVH 7KHH[HFXWHLQSXWSDUDPHWHULVRQO\FORFNHGIRURQHFDOO7KHTXHU\LVQRWDERUWHG
&DVH 6DPHDVFDVHKRZHYHUDQHUURURFFXUV
See also
Error and warning concept (Page 52)
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
// ...
// 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];
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
);
// ...
// ...
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
// ...
END_VAR
END_INTERFACE
IMPLEMENTATION
// ...
// StartUpTask
PROGRAM StartUpPIB
// ...
// ...
// 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
END_PROGRAM
END_IMPLEMENTATION
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.
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.
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".
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.
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".
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.
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
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.
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.
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.
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.
Description
The "Get attribute" command reads out attributes associated with a file. The attributes
(attributes and file type) are stored in the directory.
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".
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
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)
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:
//
// | | | | | ... | | | | | ... | | | | | ... | | | | | ... | | |
// | 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;
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".
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.
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.
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.
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)
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.
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.
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.
Description
The "Physical write" command writes data to a transponder using the physical start address
and the length of the data to be written.
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.
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.
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.
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
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.
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".
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.
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.
Description
The "Set attribute" command sets/changes the attributes associated with a file. These
attributes are stored in the directory on the transponder.
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.
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.
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
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.
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
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
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.
The following figure shows the structure of the status output parameter.
VWDWXV':25'
)XQFWLRQB1XP
%LWV 6HHWDEOH(UURUB&RGHB
)XQFWLRQB&RGH
(UURUB&RGHB ZDUQLQJ HUURUPHVVDJH
3'8B,GHQWLILHU
)UDPHB6HOHFW
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:
The following table contains the values that can be assumed by the Function_Num byte.
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.
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.
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)
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.
(UURUB&RGHB
%LWV
6HWWR
9HQGRUVSHFLILF
9HQGRUVSHFLILFZKHQWKH,GHQW8QLWLVDEDUFRGHUHDGHU
/RZEDWWHU\VWDWXVZKHQWKH,GHQW8QLWLVDQ5),'
9HQGRUVSHFLILF
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.
Table 4-8 Error messages and warnings during acyclic data transfer: Writing data
Table 4-9 Error messages and warnings during acyclic data transfer: Reading data
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
Table 4-11 Error messages during cyclic data transfer Writing data
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:
( )(
%\WHV )XQFWLRQB1XP (UURUB'HFRGH (UURUB&RGHB (UURUB&RGHB
)XQFWLRQB1XP
%LWV 6HHWDEOH(UURUB&RGHB
)XQFWLRQB&RGH
(UURUB&RGHB HUURUPHVVDJH
3'8B,GHQWLILHU
)UDPHB6HOHFW
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:
You can find the meaning for Error_Code_1 = 7 in the table "Error_Code_1":
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:
& ' $
%\WHV )XQFWLRQB1XP (UURUB'HFRGH (UURUB&RGHB (UURUB&RGHB
)XQFWLRQB1XP
%LWV 6HHWDEOH(UURUB&RGHB
)XQFWLRQB&RGH
(UURUB&RGHB HUURUPHVVDJH
3'8B,GHQWLILHU
)UDPHB6HOHFW
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:
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:
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.
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.
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:
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.
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.
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
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