Several users have reported issues with the Octane SDK dropping or not reporting tags.
The lack of tag reporting is due to Octane SDK depending on the thread that calls the Event Handlers (E.g. OnTagsReported, OnTagOpComplete, etc..) in your code. If the user defines code in the event handler that is time consuming or calls out to an external resource such as a database, the Octane SDK will not be able to process the tags being reported by the reader.
For the lack of tag reporting, move the time consuming code to a separate thread.
Let's go through an example that is loosely based on the examples provided by the .NET Octane SDK. It will read tags from the field of view and process them one by one on a separate thread.
Note: The Octane SDK comes in both .NET (currently version 2.30.1 from Nuget) and Java (currently 1.30.1 from here). The code featured in this article was written for .NET and may be convertible to Java.
*** Note: This example was run against Octane SDK .NET version 2.30.1 against a reader with Octane Firmware 188.8.131.52. We do not guarantee this will work against any other versions. Nor do we guarantee this will be supported in future versions of Octane SDK .NET. ***
The example below uses the following Usings:
The Main code snippet shows a High level overview of what we plan to do.
The program initializes the system by connecting to your reader/gateway, registering the Event Handlers, and applying the settings to the reader. Should the program throw an unexpected exception or be changed to exit, the finalize method will make sure to stop and disconnect from the reader.
The reader gets setup to use Dual Target and Auto Set Dense Reader with antenna 1 at 20 dBM and -70 Receive Sensitivity:
To perform the operations in this program successfully, there is a Blocking Collection Data Structure that will communicate which tags were read and help with communicating among multiple threads.
The OnTagsReported Event Handler is very simple. It just gets tag reports, trims each EPC value, and adds them to the tagsSeen Collection:
The Complex Operations are performed in a separate function (performComplexOperationsOnSeenTags). While the tagsSeen collection isn't completed, one EPC will be removed from the collection at a time. Each tag will be operated on.
You can now update the code in the performComplexOperationsOnSeenTags method to perform time consuming operations.
Copyright ©2018 Impinj, Inc. All rights reserved.
You may use and modify this code under the terms of the Impinj Software Tools License & Disclaimer.
Visit this link for full license details, or contact Impinj, Inc. for a copy of the Impinj Software Tools License & Disclaimer.