2013-07-18 20 views
0

我正在研究RFID标签。我使用Speedway Revolution Reader(R-420)读取标签。 http://www.impinj.com/Speedway_Revolution_UHF_RFID_Reader.aspx 我使用Confidex Steelware Micro ETSI Monza标签(产品号3000127) http://www.confidex.com/products-and-services/compare-uhf-products/524-confidex-steelwave-micro。我正在使用Impinj的Octane SDK。 我面临的问题是,当我试图锁定用户内存时,出现错误。RFID锁定用户存储器

这是我使用的代码:

static void Main(string[] args) 
    { 
     try 
     { 
      // Connect to the reader. 
      // Change the ReaderHostname constant in SolutionConstants.cs 
      // to the IP address or hostname of your reader. 
      reader.Connect(SolutionConstants.ReaderHostname); 

      // Assign the TagOpComplete event handler. 
      // This specifies which method to call 
      // when tag operations are complete. 
      reader.TagOpComplete += OnTagOpComplete; 

      // Configure the reader with the default settings. 
      reader.ApplyDefaultSettings(); 

      // Create a tag operation sequence. 
      // You can add multiple read, write, lock, kill and QT 
      // operations to this sequence. 
      TagOpSequence seq = new TagOpSequence(); 


      // Define a tag write operation that sets the access password. 
      TagWriteOp writeOp = new TagWriteOp(); 
      // Assumes that current access password is not set 
      // (zero is the default) 
      writeOp.AccessPassword = null; 
      // The access password is in the Reserved memory bank. 
      writeOp.MemoryBank = MemoryBank.Reserved; 
      // A pointer to the start of the access password. 
      writeOp.WordPointer = WordPointers.AccessPassword; 
      // The new access password to write. 
      writeOp.Data = TagData.FromHexString("11112222"); 

      // Add this tag write op to the tag operation sequence. 
      seq.Ops.Add(writeOp); 

      // Create a tag lock operation to lock the 
      // access password and User memory. 
      TagLockOp lockOp = new TagLockOp(); 
      lockOp.AccessPasswordLockType = TagLockState.Lock; 
      lockOp.EpcLockType = TagLockState.Lock; 


      // Add this tag lock op to the tag operation sequence. 
      seq.Ops.Add(lockOp); 

      // Add the tag operation sequence to the reader. 
      // The reader supports multiple sequences. 
      reader.AddOpSequence(seq); 

      // Start the reader 
      reader.Start(); 
     } 
     catch (OctaneSdkException e) 
     { 
      // Handle Octane SDK errors. 
      Console.WriteLine("Octane SDK exception: {0}", e.Message); 
     } 
     catch (Exception e) 
     { 
      // Handle other .NET errors. 
      Console.WriteLine("Exception : {0}", e.Message); 
     } 

     // Wait for the user to press enter. 
     Console.WriteLine("Press enter to exit."); 
     Console.ReadLine(); 

     // Stop reading. 
     reader.Stop(); 

     // Disconnect from the reader. 
     reader.Disconnect(); 
    } 

    // This event handler will be called when tag 
    // operations have been executed by the reader. 
    static void OnTagOpComplete(ImpinjReader reader, TagOpReport report) 
    { 
     // Loop through all the completed tag operations 
     foreach (TagOpResult result in report) 
     { 
      if (result is TagWriteOpResult) 
      { 
       // These are the results of settings the access password. 
       // Cast it to the correct type. 
       TagWriteOpResult writeResult = result as TagWriteOpResult; 
       // Print out the results. 
       Console.WriteLine("Set access password complete."); 
       Console.WriteLine("EPC : {0}", writeResult.Tag.Epc); 
       Console.WriteLine("Status : {0}", writeResult.Result); 
       Console.WriteLine("Number of words written : {0}", writeResult.NumWordsWritten); 
      } 
      else if (result is TagLockOpResult) 
      { 
       // Cast it to the correct type. 
       // These are the results of locking the access password or user memory. 
       TagLockOpResult lockResult = result as TagLockOpResult; 
       // Print out the results. 
       Console.WriteLine("Lock operation complete."); 
       Console.WriteLine("EPC : {0}", lockResult.Tag.Epc); 
       Console.WriteLine("Status : {0}", lockResult.Result); 
      } 
     } 
    } 
} 

}

这是我收到的错误:

+0

您是否尝试通过简单的ASCII命令与RFID进行通信? – Tigran

+0

不,我还没试过。可以分享任何ASCII命令的链接吗? –

+0

不太清楚在不同制造商之间是否有共同的命令集(只是不知道)。你应该*在RFID标签本身中提供一些文件。几年前,我做了这个(我有一个制造商自己提供的通信协议的文档),但我不知道它是否与你的情况不同 - – Tigran

回答

0

如果您按照上述指南中的步骤操作,没有理由不应该使用该标签,除非标签已被锁定。

由于锁定状态通常无法被阅读器读取,但只能被推断出来,可能在这种情况下,您使用的标签(或多个标签)出于某种原因已被锁定。我建议尝试使用几种不同类型的标签(如果可能的话,使用不同的IC),以查看错误是否在整个板上持续存在。