2010-01-08 106 views
0

是否可以使用Motorola的EMDK for .NET/Symbol.rfid2.device dll將數據寫入特定的RFID標籤(實際上是其用戶內存)?想象一下,你有2個標籤在你面前,你只想寫數據給其中的一個。將數據寫入特定標記

WriteTag方法似乎不支持這一點。

謝謝。

回答

4

我相信有一個新的EMDK與Symbol.RFID3.device,允許您執行標籤特定的操作。檢查CS_RFID3Sample3。

簽名:

// Summary: 
    //  This method is used to write data to the memory bank of a specific tag. 
    // 
    // Parameters: 
    // tagID: 
    //  EPC-ID of the Tag on which the Write operation is to be performed. 
    // 
    // writeAccessParams: 
    //  Parameters required for the Write operation. 
    // 
    // antennaInfo: 
    //  Antennas on which the current operation is to be performed. If this is null, 
    //  operation will be performed on all Antennas. 
    public void WriteWait(string tagID, TagAccess.WriteAccessParams writeAccessParams, AntennaInfo antennaInfo); 

用例:

public RFIDResults WriteTag(string tagId, string writeData, MEMORY_BANK mb, Int32 offset) 
    { 
     byte[] writeUserData = null; 
     writeUserData = new byte[writeData.Length/2]; 

     ConvertStringToByteArray(writeData, ref writeUserData); 

     TagAccess.WriteAccessParams writeParams = new TagAccess.WriteAccessParams(); 
     writeParams.AccessPassword = 0; 
     writeParams.WriteData = writeUserData; 
     writeParams.WriteDataLength = (uint)writeUserData.Length; 
     writeParams.MemoryBank = mb; 
     writeParams.ByteOffset = (uint)offset; 
     try 
     { 
      m_RfidReader.Actions.TagAccess.WriteWait(tagId, writeParams, null); 
      return RFIDResults.RFID_API_SUCCESS; 
     } 
     catch (OperationFailureException e) 
     { 
      return e.Result; 
     } 
    }