• Api Documentation
  • Programmer's Guide
Show / Hide Table of Contents
  • Introduction
  • Generic Reader Interface
    • Connecting to Reader
    • Knowing the Reader Capabilities
    • Configuring the Reader
    • Managing Events
    • Managing Tags
    • Basic Operations
    • Advanced Operations
    • Tag Locationing
    • NXP Commands
    • Impinj Commands
    • Disconnecting from the Reader
  • Reader Management Interface
    • Connecting to the Reader
    • Updating Firmware of the Software
    • Read Points
    • Antenna Modes
    • Reader and System Information
    • Managing Reader Configurations
    • Managing LLRP connection and configuration
    • USB Operation Mode
    • GPI Debounce Time
    • Local Time
    • Time Zone
    • User LED
    • Reader Statistics
    • Restarting the Reader
    • Disconnecting the Reader
    • Cable Loss Compensation
    • Idle Mode
    • Power Negotiation
    • Region configuration
    • User App Deployment
    • User Management

Managing Tags

Application needs to get the Tags from the Dll which are reported by Reader. Tags can be reported as part of an Inventory operation (rfidApi.Actions.Inventory.Perform) or a Read Access operation (rfidApi.Actions.TagAccess.ReadEvent or rfidApi.Actions.TagAccess.ReadWait).

Applications can also configure to receive Tag reports that indicate the results of access operations as shown beneath.

TagStorageSettings tagStorageSettings = rfidApi.Config.GetTagStorageSettings();

tagStorageSettings.EnableAccessReports = true;

rfidApi.Config.SetTagStorageSettings(tagStorageSettings);

Each Tag has a set of associated information along with it. During Inventory operation the Reader reports the EPC-ID of the Tag where as during Read-Access operation the requested Memory Bank Data is also reported apart from EPC-ID. In either case, there is additional information like PC-bits, RSSI, last time seen, tag seen count, etc that will be available for each Tag. This information is reported to the Application as TagData for each Tag reported by the Reader.

The Application can specify its customized memory bank data size using the function rfidApi.Config.SetTagStorageSettings. The Application shall initialize the tag storage settings for TagData so that all Tag allocations reflect the applications customized memory requirement.

TagStorageSettings tagStorageSettings = new TagStorageSettings(100, 512, 512); 

rfidApi.Config.SetTagStorageSettings(tagStorageSettings);

Applications can also choose to enable/disable reporting of certain fields in TAG_DATA. Disabling certain fields can sometimes improve the performance as the Reader and the Dll shall not be processing that information. It can also result in specific behavior. For e.g. disabling reporting of Antenna Id can result in application receiving as single unique tag even though they were multiple entries of the same tag reported from different Antennas. The following snippet shows enabling the reporting of PeakRSSI, Tag Seen count, PC and CRC only and disabling other fields like Antenna ID, time stamps and XPC.

TagStorageSettings tagStorageSettings = rfidApi.Config.GetTagStorageSettings();

tagStorageSettings.TagFields = TAG_FIELD.PC | TAG_FIELD.PEAK_RSSI | TAG_FIELD.TAG_SEEN_COUNT | TAG_FIELD.CRC;

rfidApi.Config.SetTagStorageSettings(tagStorageSettings);

Following are few use-cases that get Tags from the Reader:

Inventory operation: When RFID rfidApi.Actions.Inventory.Perform is invoked, the application will get notified of ReadNotify if tags are reported back from the Reader if registered for read notification. When notified of the same, by default the event argument contains the tag data.

TagData.OpCode for inventory operation will be ACCESS_OPERATION_NONE, and TagData.OpStatus to be ignored.

// Simple Inventory with tag events

rfidApi.Events.ReadNotify += new Events.ReadNotifyHandler(Events_ReadNotify);

TagData reportedTag = new TagData();

rfidApi.Actions.Inventory.Perform();

Thread.Sleep(1000);

rfidApi.Actions.Inventory.Stop();

// Read Notify Event handler

public void Events_ReadNotify(object sender, Events.ReadEventArgs e)

{

Console.WriteLine(e.ReadEventData.TagData.TagID);

if (e.ReadEventData.TagData.OpCode == ACCESS_OPERATION_CODE.ACCESS_OPERATION_READ &&

e.ReadEventData.TagData.OpStatus == ACCESS_OPERATION_STATUS.ACCESS_SUCCESS)

Console.WriteLine(e.ReadEventData.TagData.MemoryBank.ToString()+ 

" : " + e.ReadEventData.TagData.MemoryBankData);

}

Application can call GetReadTags method to fetch tags from the Dll by specifying the number of expected tags.

// Simple Inventory operation for 1 seconds and get the tags

// with GetReadTags method

rfidApi.Actions.Inventory.Perform();

Thread.Sleep(1000);

rfidApi.Actions.Inventory.Stop();

TagData[] remainingTags = rfidApi.Actions.GetReadTags(100);

for(int nIndex = 0; nIndex < remainingTags.Length; nIndex++)

{

Console.WriteLine(remainingTags[nIndex].TagID);

}

Single Tag – Read Access: When the application calls the method rfidApi.Actions.TagAccess.ReadWait to read data from a specific memory bank of a particular tag, the method returns the TagData for which TagData.OpCode will be ACCESS_OPERATION_READ, and TagData.OpStatus indicating the result of the operation; if TagData.OpStatus is ACCESS_SUCCESS, the requested memory bank data can be found in TagData.MemoryBankData.

/*Simple Read Access Operation on Specific Tag*/

string tagId = "1234ABCD00000000000025B1";

TagAccess.ReadAccessParams readAccessParams = new TagAccess.ReadAccessParams();

TagData readAccessTag;

readAccessParams.AccessPassword = 0;

readAccessParams.ByteCount = 8;

readAccessParams.MemoryBank = MEMORY_BANK.MEMORY_BANK_USER;

readAccessParams.ByteOffset = 0;

readAccessTag = rfidApi.Actions.TagAccess.ReadWait(tagId, readAccessParams, null);

Console.WriteLine(readAccessTag.MemoryBank.ToString() + " : " + readAccessTag.MemoryBankData);

Multiple Tags – Read Access: When the application calls the method rfidApi.Actions.TagAccess.ReadEvent to read data from a specific memory bank of multiple tags, the method returns immediately, and reports the Tags asynchronously as done in Inventory operation. Tags reported as part of read access operation will have TagData.OpCode as ACCESS_OPERATION_READ, and TagData.OpStatus indicating the result of the operation; if TagData.OpStatus is ACCESS_SUCCESS, the requested memory bank data can be found in TagData.MemoryBankData.

/*Simple Access Operation on Multiple Tags*/

AutoResetEvent AccessComplete;

AccessComplete = new AutoResetEvent(false);

rfidApi.Events.StatusNotify += new Events.StatusNotifyHandler(Events_StatusNotify);

rfidApi.Events.NotifyInventoryStartEvent = true;

rfidApi.Events.NotifyInventoryStopEvent = true;

rfidApi.Events.NotifyAccessStartEvent = true;

rfidApi.Events.NotifyAccessStopEvent = true;

rfidApi.Events.ReadNotify += new Events.ReadNotifyHandler(Events_ReadNotify);

TagAccess.ReadAccessParams readAccessParams = new TagAccess.ReadAccessParams();

readAccessParams.AccessPassword = 0;

readAccessParams.ByteCount = 0;

readAccessParams.MemoryBank = MEMORY_BANK.MEMORY_BANK_USER;

readAccessParams.ByteOffset = 0;

rfidApi.Actions.TagAccess.ReadEvent(readAccessParams, null, null);

AccessComplete.WaitOne(4000, false);

Access Operation Sequence – Read Access: When the application calls the method rfidApi.Actions.TagAccess.OperationSequence.PerformSequence further to adding operations for Read (using rfidApi.Actions.TagAccess.OperationSequence.Add of ACCESS_OPERATION_CODE.ACCESS_OPERATION_READ), the method rfidApi.Actions.TagAccess.OperationSequence.PerformSequence returns immediately, and reports tags asynchronously.

/*Access Sequence Operation – reads all memory banks */

rfidApi.Events.ReadNotify += new Events.ReadNotifyHandler(Events_ReadNotify);

TagAccess.Sequence.Operation op1 = new TagAccess.Sequence.Operation();

op1.AccessOperationCode = ACCESS_OPERATION_CODE.ACCESS_OPERATION_READ;

op1.ReadAccessParams.MemoryBank = MEMORY_BANK.MEMORY_BANK_RESERVED;

op1.ReadAccessParams.ByteCount = 0;

op1.ReadAccessParams.ByteOffset = 0;

op1.ReadAccessParams.AccessPassword = 0;

rfidApi.Actions.TagAccess.OperationSequence.Add(op1);

TagAccess.Sequence.Operation op2 = new TagAccess.Sequence.Operation();

op2.AccessOperationCode = ACCESS_OPERATION_CODE.ACCESS_OPERATION_READ;

op2.ReadAccessParams.MemoryBank = MEMORY_BANK.MEMORY_BANK_EPC;

op2.ReadAccessParams.ByteCount = 0;

op2.ReadAccessParams.ByteOffset = 0;

op2.ReadAccessParams.AccessPassword = 0;

rfidApi.Actions.TagAccess.OperationSequence.Add(op2);

      TagAccess.Sequence.Operation op3 = new TagAccess.Sequence.Operation();

op3.AccessOperationCode = ACCESS_OPERATION_CODE.ACCESS_OPERATION_READ;

op3.ReadAccessParams.MemoryBank = MEMORY_BANK.MEMORY_BANK_TID;

op3.ReadAccessParams.ByteCount = 0;

op3.ReadAccessParams.ByteOffset = 0;

op3.ReadAccessParams.AccessPassword = 0;

rfidApi.Actions.TagAccess.OperationSequence.Add(op3);

TagAccess.Sequence.Operation op4 = new TagAccess.Sequence.Operation();

op4.AccessOperationCode = ACCESS_OPERATION_CODE.ACCESS_OPERATION_READ;

op4.ReadAccessParams.MemoryBank = MEMORY_BANK.MEMORY_BANK_USER;

op4.ReadAccessParams.ByteCount = 0;

op4.ReadAccessParams.ByteOffset = 0;

op4.ReadAccessParams.AccessPassword = 0;

rfidApi.Actions.TagAccess.OperationSequence.Add(op4);

rfidApi.Actions.TagAccess.OperationSequence.PerformSequence();

/* performs only for 2000 seconds.. */

      Thread.Sleep(2000);

rfidApi.Actions.TagAccess.OperationSequence.StopSequence();
Back to top