I'm using the "Motorola EMDK for .NET" for a personal project and I see TagData.TagID
and TagData.MemoryBankData
differ (when the MEMORY_BANK.TID
is selected).
The .NET documentation isn't informative, it simply states:
TagData.TagID Property
Gets the Tag ID
I dug into the "Motorola EMDK for C" API, which is the low-level interface that the .NET SDK wraps around, and it provided more details:
UNIT8* pTagID
Tag ID, for C1G2 this field refers EPC Data.
...that clears things up, except that the value for MEMORY_BANK.EPC
doesn't match TagData.TagID
either!
I looked at the Class 1 Gen 2 specification ( http://www.gs1.org/sites/default/files/docs/uhfc1g2/uhfc1g2_2_0_0_standard_20131101.pdf ) and none of the fields described in the tag's data structures seem to correspond to this TagID
property.
I did wonder if TagData.TagID
is some arbitrary, opaque value generated by the SDK as a means of uniquely identifying each tag, but I noticed that the same values are used in different sessions, so it's definitely deterministic, but what does it mean?
I wrote a program that dumps all of the memory banks of the tags and the TagID
property, this is what I got:
TagData.TagID: "0000000000000000000C7D16" Bank: MEMORY_BANK_EPC , BankData: "743E30000000000000000000000C7D16"
TagData.TagID: "0000000000000000000C7D16" Bank: MEMORY_BANK_RESERVED, BankData: "0000000000000000"
TagData.TagID: "0000000000000000000C7D16" Bank: MEMORY_BANK_TID , BankData: "E20060031A8A034E"
TagData.TagID: "0000000000000000000C7D16" Bank: MEMORY_BANK_USER , BankData: "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
TagData.TagID: "3330323135385F303031" Bank: MEMORY_BANK_EPC , BankData: "EB1728003330323135385F303031"
TagData.TagID: "3330323135385F303031" Bank: MEMORY_BANK_RESERVED, BankData: "0000000000000000030004180CFA"
TagData.TagID: "3330323135385F303031" Bank: MEMORY_BANK_TID , BankData: "E2801130200029431C9701C2"
TagData.TagID: "3330323135385F303031" Bank: MEMORY_BANK_USER , BankData: "00000000"
TagData.TagID: "54573630354C5F303037" Bank: MEMORY_BANK_EPC , BankData: "B63E280054573630354C5F303037"
TagData.TagID: "54573630354C5F303037" Bank: MEMORY_BANK_RESERVED, BankData: "0000000000000000030004190CFA"
TagData.TagID: "54573630354C5F303037" Bank: MEMORY_BANK_TID , BankData: "E2801130200021A11D4501C2"
TagData.TagID: "54573630354C5F303037" Bank: MEMORY_BANK_USER , BankData: "00000000"
TagData.TagID: "54573630354C5F303132" Bank: MEMORY_BANK_EPC , BankData: "D5AA280054573630354C5F303132"
TagData.TagID: "54573630354C5F303132" Bank: MEMORY_BANK_RESERVED, BankData: "0000000000000000030004190CFA"
TagData.TagID: "54573630354C5F303132" Bank: MEMORY_BANK_TID , BankData: "E2801130200021F11D4501C2"
TagData.TagID: "54573630354C5F303132" Bank: MEMORY_BANK_USER , BankData: "00000000"
It appears I didn't look closely enough!
The TagData.TagID
is contained within the EPC
, for example:
TagData.TagID: "3330323135385F303031" Bank: MEMORY_BANK_EPC , BankData: "EB1728003330323135385F303031"
EPC: "EB1728003330323135385F303031"
TagID: "3330323135385F303031"
According to the C1G2 specification, the beginning of the EPC is reserved as such:
0x0000 to 0x000F - StoredCRC - 0xEB17
0x0010 to 0x001F - StoredPC - 0x2800
0x0020 to 0x020F - Actual EPC value - 0x3330323135385F303031
0x0210 to 0x021F - XPC_W1 (Optional) - null
0x0220 to 0x022F - XPC_W2 (Optional) - null
That clears that up then!
But my question now is: can TagID
be trusted to be globally unique like TID
is? My understanding is EPC
does not need to be unique, it's just an arbitrary string and is not a serial number. If this is the case, then what happens in case of an EPC collision?
There is no way to guaranty that any of these fields are unique. All of them can be updated by printer or reader. So you should trust to your RFID tags supplier or print them by your own. EPC collision is not a problem for reader, only for your software.