User's Manual

CAEN RFID API User Manual
17
Reading and writing Gen2 tags
Gen2 tags contains a memory with the following structure:
MSB
LSB
...
10
h
TID [15:00]
1F
h
00
h
TID [31:16]
0F
h
MSB
LSB
Bank 11
USER
EPC [15:0]
...
Bank 10
TID
20
h
EPC [N:N-15]
2F
h
10
h
PC [15:00]
1F
h
00
h
CRC-16 [15:00]
0F
h
Bank 01
EPC
MSB
LSB
...
Bank 00
RESERVED
30
h
Access Passwd [15:00]
3F
h
20
h
Access Passwd [31:16]
2F
h
10
h
Kill Passwd [15:00]
1F
h
00
h
Kill Passwd [31:16]
0F
h
The inventory process returns the EPC code that is part of the content of the EPC memory bank as a side-effect of the
singulation process. All the memory content, anyway, can be read using the Gen2 Read command and the rewritable
memory can be written using the Gen2 Write command.
The CAEN RFID API provides methods to read (ReadTag_EPC_C1G2) and write (WriteTag_EPC_C1G2) data into the tags'
memory; the methods implement internally a Select command that is used to identify the tag on which execute the
read or write command permitting to read/write into a specific tag even if multiple tags are inside the reading zone.
The identification of the tag is executed by matching the EPC code that can be previously obtained by an inventory
process. The other parameters needed to execute the read and write command are the memory bank, the starting
address, the data length and, in case of the write command, the data that have to be written.
The API provides also a “secured” version of those commands that require a password as an additional parameter.
These variants of the methods have to be used in the case the Access password is set into the tag. Tags with a non-zero
Access password are “protected” (in Gen2 terminology: tags with a non-zero Access password are in Open state) and
the user needs to know and passes to the tag the Access password in order to write into the tag's memory (in Gen2
terminology: the tag has to switch in Secured state using the password before to allow to write).