简体   繁体   中英

how can my RFID reader reading a RFID tag only once?

I have impinj speedway reader and I'm using impinj Ocatne SDK for .net and visual studio 2013 (c#) in order to test and deploy the device. As a first exercise, i executed the example "readtags (described below) of Ocatne SDK, so the reader reads the tags many times until I give up running. However, I would like to know how the reader can read tags only once Thanks

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);

            // Get the default settings
            // We'll use these as a starting point
            // and then modify the settings we're 
            // interested in.
            Settings settings = reader.QueryDefaultSettings();

            // Tell the reader to include the antenna number
            // in all tag reports. Other fields can be added
            // to the reports in the same way by setting the 
            // appropriate Report.IncludeXXXXXXX property.
            settings.Report.IncludeAntennaPortNumber = true;

            // The reader can be set into various modes in which reader
            // dynamics are optimized for specific regions and environments.
            // The following mode, AutoSetDenseReader, monitors RF noise and interference and then automatically
            // and continuously optimizes the reader’s configuration
            settings.ReaderMode = ReaderMode.AutoSetDenseReader;
            settings.SearchMode = SearchMode.DualTarget;
            settings.Session = 2;

            // Enable antenna #1. Disable all others.
            settings.Antennas.DisableAll();
            settings.Antennas.GetAntenna(1).IsEnabled = true;

            // Set the Transmit Power and 
            // Receive Sensitivity to the maximum.
            settings.Antennas.GetAntenna(1).MaxTxPower = true;
            settings.Antennas.GetAntenna(1).MaxRxSensitivity = true;
            // You can also set them to specific values like this...
            //settings.Antennas.GetAntenna(1).TxPowerInDbm = 20;
            //settings.Antennas.GetAntenna(1).RxSensitivityInDbm = -70;

            // Apply the newly modified settings.
            reader.ApplySettings(settings);

            // Assign the TagsReported event handler.
            // This specifies which method to call
            // when tags reports are available.
            reader.TagsReported += OnTagsReported;

            // Start reading.
            reader.Start();
// 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();
        }
        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);
        }
    }

    static void OnTagsReported(ImpinjReader sender, TagReport report)
    {
        // This event handler is called asynchronously 
        // when tag reports are available.
        // Loop through each tag in the report 
        // and print the data.

        foreach (Tag tag in report)
        {
            Console.WriteLine("voici l'antenne : {0}, EPC : {1} ", tag.AntennaPortNumber, tag.Epc);

        }
    }

You can write your program to filter and report tag reads in any number of ways. Impinj providessample code to make it easier for you to get started in terms of data output.

Also, download the latest version of the Octane SDK , open the folder, navigate to "examples", then navigate to (and open) "ReadTagsFiltered" for sample code related to filtering tag reads.

If you set Search Mode to 'Single Target' and use Session 2, the reader will (physically) only read a tag once when it enters the field, and will read it again when it has been out of the field for more than a few seconds. This will enhance the read performance as well (as the reader as more time to read other tags).

You can of course also filter in software, and track which EPCs has already been read.

For more background on Session in RFID, please read here: https://github.com/rainrfid/overview/wiki/2.-The-protocol

当您使用 Session 2 和 Single Target 时,标签只会响应一次,直到它离开现场超过一定时间。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM