0

是否可以使用 Motorola 的 EMDK for .NET / Symbol.rfid2.device dll 将数据写入特定的 RFID 标签(实际上是写入其用户内存)?想象一下,您面前有 2 个标签,并且您只想将数据写入其中一个。

WriteTag 方法似乎不支持这一点。

4

1 回答 1

4

我相信有一个带有 Symbol.RFID3.device 的新 EMDK 允许您执行特定于标签的操作。检查 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;
        }
    }
于 2010-06-16T15:06:57.170 回答