RFID标签分类
1.LF(Low frequency) 低频
2.HF(High Frequency) 高频
3.UHF(Ultra High Frequency) 超高频
4.MW(Micro Wave) 微波
UHF RFID存储区简介
1.TID区
2.EPC区
3.User区
4.Reserved区
以上4个存储区均可写保护。意味着保护后该区永不可写或非安全模式下不可写。读取保护则只对密码区设置有效, 即需要在安全模式下进行访问。TID与EPC则无法设置读取保护。
UHF RFID阅读器操作[ Impinj SDK C#示例 ]
不同阅读器只会有SDK的调用方式有所不同, 功能都相同
1.EPC写入 [ 代码示例 ]
常见的EPC写入、SDK需要先锁定需要操作的RFID标签。
TID锁定: TID唯一码改写,适用于批量更新,准确
EPC锁定: EPC可能存在重复的情况, 影响更新性能
static void ProgramEpc(string tid, string currentEpc,ushort currentPcBits, string newEpc)
{
// 检查指定的 EPCs 是否有效长度
if ((currentEpc.Length % 4 != 0) || (newEpc.Length % 4 != 0))
throw new Exception("EPCs must be a multiple of 16 bits (4 hex chars)");
//创建标签操作序列
TagOpSequence seq = new TagOpSequence();
seq.TargetTag.MemoryBank = MemoryBank.Tid;
seq.TargetTag.Data = tid;
TagWriteOp writeEpc = new TagWriteOp();
writeEpc.Id = EPC_OP_ID;
writeEpc.MemoryBank = MemoryBank.Epc;
writeEpc.Data = TagData.FromHexString(newEpc);
writeEpc.WordPointer = WordPointers.Epc;
//标签访问密码,未加密前默认8个0
writeEpc.AccessPassword = TagData.FromHexString("00000000");
seq.Ops.Add(writeEpc);
if (currentEpc.Length != newEpc.Length)
{
ushort newEpcLenWords = (ushort)(newEpc.Length / 4);
ushort newPcBits = PcBits.AdjustPcBits(currentPcBits, newEpcLenWords);
TagWriteOp writePc = new TagWriteOp();
writePc.Id = PC_BITS_OP_ID;
writePc.MemoryBank = MemoryBank.Epc;
writePc.Data = TagData.FromWord(newPcBits);
writePc.WordPointer = WordPointers.PcBits;
//标签访问密码,未加密前默认8个0
writeEpc.AccessPassword = TagData.FromHexString("00000000");
seq.Ops.Add(writePc);
}
reader.AddOpSequence(seq); //操作序列添加进入阅读器中
}
2.EPC写保护 [代码示例]
防止标签进行初始化后, 其他人员恶意进行非法更新或销毁操作, 使得芯片无法在流程及应用中发挥其作用, 一般标签在初始化后需要进行加密保护或标签供应商出厂前进行加密保护, 加密保护主要包含销毁与访问密码保护。
TagWriteOp writeOp = new TagWriteOp();
writeOp.Id = pcid;
writeOp.AccessPassword = null;
writeOp.MemoryBank = MemoryBank.Reserved;
writeOp.WordPointer = WordPointers.AccessPassword;
writeOp.Data = TagData.FromHexString("00000000");
seq.Ops.Add(writeOp);
//EPC 标签锁定操作
TagLockOp lockOp = new TagLockOp();
lockOp.Id = pcid;
lockOp.AccessPasswordLockType = TagLockState.Lock;
lockOp.UserLockType = TagLockState.Lock;
seq.Ops.Add(lockOp);
3.User区写入 [ 代码示例 ]
// Create a tag write operation.
TagWriteOp writeOp = new TagWriteOp();
// Write to user memory
writeOp.MemoryBank = MemoryBank.User;
// Write two (16-bit) words
writeOp.Data = TagData.FromHexString("00000000");
// Starting at word 0
writeOp.WordPointer = 0;
// Add this tag write op to the tag operation sequence.
seq.Ops.Add(writeOp);
// Add the tag operation sequence to the reader.
// The reader supports multiple sequences.
reader.AddOpSequence(seq);
4.Kill Tag销毁标签 [ 代码示例 ]
未加密的标签销毁密码同访问密码为8个0组成, 销毁密码的过程中, 需要单独给其设定一个销毁密码, 如已设置销毁密码则按设置后的密码, 标签一旦销毁, 则灭活无法正常读取。
static void SequenceWriteTag(string epc)
{
TagOpSequence seq = new TagOpSequence();
var target = new TargetTag();
target.MemoryBank = MemoryBank.Epc;
target.BitPointer = BitPointers.Epc;
target.Data = epc;
seq.TargetTag = target;
TagWriteOp writeOp = new TagWriteOp();
writeOp.AccessPassword = null;
writeOp.MemoryBank = MemoryBank.Reserved;
writeOp.WordPointer = WordPointers.KillPassword;
writeOp.Data = TagData.FromHexString(KILL_PW);
seq.Ops.Add(writeOp);
// Define a tag kill operation.
TagKillOp killOp = new TagKillOp();
// Specify the kill password for this tag.
// The kill password cannot be zero.
killOp.KillPassword = TagData.FromHexString(KILL_PW);
// Add this tag write op to the tag operation sequence.
seq.Ops.Add(killOp);
reader.AddOpSequence(seq);
}
UHF RFID读写器读取性能影响分析
1.阅读器功率
2.阅读器频率
3.阅读器
4.天线的增益及馈线的衰减
5.RFID标签种类
6.读取方向及环境