Beispiel #1
0
        public void LaunchXArray(ImpinjReader reader, XArray xArray)
        {
            try
            {
                // Connect to the reader.
                // Change the ReaderHostname constant in SolutionConstants.cs
                // to the IP address or hostname of your reader.
                reader.Connect(xArray.Hostname);

                // Assign the LocationReported event handler.
                // This specifies which method to call
                // when a location report is available.
                reader.LocationReported += OnLocationReported;
                // Don't forget to define diagnostic method
                reader.DiagnosticsReported += OnDiagnosticsReported;

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

                // Start the reader
                reader.Start();
            }
            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);
            }
        }
Beispiel #2
0
        bool initReader()
        {
            bool re = false;

            try
            {
                string mReaderIp = ConfigurationManager.AppSettings["ReaderIp"];
                mReader.Connect(mReaderIp);
                mReader.TagsReported  += OnTagsReported;
                mReader.TagOpComplete += OnTagOpComplete;
                Settings settings = mReader.QueryDefaultSettings();

                settings.SearchMode = (SearchMode)int.Parse(ConfigurationManager.AppSettings["SearchMode"].ToString());
                settings.Session    = (ushort)int.Parse(ConfigurationManager.AppSettings["Session"].ToString());
                double power            = double.Parse(ConfigurationManager.AppSettings["AntennaPower"].ToString());
                List <AntennaConfig> ac = settings.Antennas.AntennaConfigs;
                foreach (var v in ac)
                {
                    v.IsEnabled    = true;
                    v.TxPowerInDbm = power;
                }
                settings.Antennas.AntennaConfigs = ac;
                mReader.ApplySettings(settings);
                re = true;
            }
            catch (Exception)
            {
                re = false;
            }

            return(re);
        }
Beispiel #3
0
        public Program()
        {
            try
            {
                reader.Connect(SolutionConstants.ReaderHostname);

                Console.WriteLine("WAM with Location: " + SolutionConstants.ReaderHostname);

                for (int i = 0; i < INTERATIONS; i++)
                {
                    // WAM Role
                    Console.WriteLine("Running WAM. Please wait " + WAM_ROLE_DURATION / 1000 + " Sec." + " Session=" + WAM_SESSION + " Target=" + WAM_SEARCH_MODE);
                    SetupWamMode();
                    System.Threading.Thread.Sleep(WAM_ROLE_DURATION);
                    ShutdownWamMode();
                    Console.WriteLine("WAM Results:  TagsRead=" + WamTags.Count);
                    foreach (var item in WamTags)
                    {
                        Tag tag = item.Value;
                        Console.WriteLine(item.Key + "  Ant=" + tag.AntennaPortNumber + "\tRSSI=" + tag.PeakRssiInDbm);
                    }
                    Console.WriteLine();
                    WamTags.Clear();

                    // Location Role
                    Console.WriteLine("Running Location. Please wait " + LOCATION_ROLE_DURATION / 1000 + " sec.");
                    SetupLocationMode();
                    System.Threading.Thread.Sleep(LOCATION_ROLE_DURATION);
                    ShutdownLocationMode();
                    Console.WriteLine("Location Results: " + LocTags.Count + " Tags Read");
                    foreach (var item in LocTags)
                    {
                        LocationReport tag = item.Value;
                        Console.WriteLine(item.Key + "\tReadCount=" + tag.ConfidenceFactors.ReadCount + "\tX=" + tag.LocationXCm + "\tY=" + tag.LocationYCm);
                    }
                    LocTags.Clear();
                    Console.WriteLine();
                    // Wait for tag percistance to complete before starting WAM again
                    if ((i < INTERATIONS - 1) && (WAM_SESSION == 2 || WAM_SESSION == 3))
                    {
                        Console.WriteLine("Wait " + SESSION_2_OR_3_PERSISTENCE / 1000 + " Sec. for tag percistance to complete before starting WAM again");
                        System.Threading.Thread.Sleep(SESSION_2_OR_3_PERSISTENCE);
                    }
                }
                // Apply the default settings before exiting.
                reader.ApplyDefaultSettings();
                // 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);
            }
        }
Beispiel #4
0
        //array to hold the margin test settings
        //public double currentPower = 0;

        public void ConnectReader(ImpinjReader reader, string hostname, double startPower)
        {
            try {
                Console.WriteLine("Attempting to connect to reader: " + hostname);
                reader.Connect(hostname);
                //connected = true;

                Console.WriteLine("Loading Margin Test Settings onto the reader");

                Settings settings = reader.QueryDefaultSettings();

                settings.Report.IncludeAntennaPortNumber = true;
                settings.Report.Mode           = ReportMode.Individual;
                settings.Antennas.TxPowerInDbm = startPower;
                settings.Report.IncludeFastId  = true;
                settings.Session    = 0;
                settings.SearchMode = SearchMode.SingleTarget;

                reader.ApplySettings(settings);
                Console.WriteLine("Successfully connected, settings Applied");
            }
            catch (OctaneSdkException err)
            {
                System.Diagnostics.Trace.
                WriteLine("An Octane Exception has occurred: {0}", err.Message);
            }
            catch (Exception err)
            {
                System.Diagnostics.Trace.
                WriteLine("An Exception has occured: {0}", err.Message);
            }
        }
Beispiel #5
0
    /// <exception cref="OctaneSdkException">Thrown when we can't connect to the reader</exception>
    public void Start()
    {
        try {
            impinjReader.Connect(readerAddress);
            Console.WriteLine("Reader Connected");
        } catch (OctaneSdkException e) {
            Console.WriteLine(e.ToString());
            Console.WriteLine("Attempting to reconnect in 3 seconds...");
            Thread.Sleep(3000);
            Start();
        }
        Settings settings = impinjReader.QueryDefaultSettings();

        settings.SearchMode   = SearchMode.DualTarget;
        settings.LowDutyCycle = new LowDutyCycleSettings {
            IsEnabled             = true,
            EmptyFieldTimeoutInMs = 10000,
            FieldPingIntervalInMs = 300
        };
        settings.Session                         = 2;
        settings.Report.Mode                     = ReportMode.Individual;
        settings.Report.IncludePeakRssi          = true;
        settings.Report.IncludeLastSeenTime      = true;
        settings.Report.IncludeAntennaPortNumber = true;

        settings.Keepalives.Enabled               = true;
        settings.Keepalives.PeriodInMs            = 2000;
        settings.Keepalives.EnableLinkMonitorMode = true;
        settings.Keepalives.LinkDownThreshold     = 5;

        impinjReader.ApplySettings(settings);
        impinjReader.Start();
    }
Beispiel #6
0
        static void ConnectToReader()
        {
            try
            {
                Console.WriteLine("Attempting to connect to {0} ({1}).",
                                  reader.Name, READER_HOSTNAME);

                // The maximum number of connection attempts
                // before throwing an exception.
                reader.MaxConnectionAttempts = 15;
                // Number of milliseconds before a
                // connection attempt times out.
                reader.ConnectTimeout = 6000;
                // Connect to the reader.
                // Change the ReaderHostname constant in SolutionConstants.cs
                // to the IP address or hostname of your reader.
                reader.Connect(READER_HOSTNAME);
                Console.WriteLine("Successfully connected.");

                // Tell the reader to send us any tag reports and
                // events we missed while we were disconnected.
                reader.ResumeEventsAndReports();
            }
            catch (OctaneSdkException e)
            {
                Console.WriteLine("Failed to connect.");
                throw e;
            }
        }
Beispiel #7
0
        public void Connect()
        {
            System.Diagnostics.Debug.WriteLine("Attempting to connect to RFID... ");
            try
            {
                System.Diagnostics.Debug.WriteLine("RFID Hostname: " + Address);

                reader.Connect(Address);
                status = reader.QueryStatus();

                if (status.IsConnected)
                {
                    System.Diagnostics.Debug.WriteLine("RFID Reader Connected");
                    UpdateReaderSettings();
                    RefreshReaderDisplay();
                    reader.Start();
                    System.Diagnostics.Debug.WriteLine("Reader Ready...");
                    //this.CheckConnection();  //starts the connection monitor
                }
                else
                {
                    System.Diagnostics.Debug.WriteLine("Connect to RFID reader failed...");
                }
            }
            catch (OctaneSdkException err)
            {
                System.Diagnostics.Debug.WriteLine("Octane SDK exception: " + err.Message);
            }
            catch (Exception err)
            {
                System.Diagnostics.Debug.WriteLine("Exception: " + err.Message);
            }
        }
Beispiel #8
0
        public async Task Connect()
        {
            await Task.Run(() =>
            {
                try
                {
                    impinjReader.Connect(Address);
                    Console.WriteLine("Reader Impinj Connected");
                    ApplySettings();
                    Console.WriteLine("Reader Impinj Settings Applied");
                }
                catch (OctaneSdkException ex)
                {
                    Console.WriteLine(ex.Message);
                    return(false);
                }
                catch (Exception ex)
                {
                    Console.WriteLine("Exception {0}", ex);
                    return(false);
                }

                return(true);
            });
        }
Beispiel #9
0
        public static void initializeSettings(int numTags, TimeSeriesChart chart)
        {
            // Set the number of tags.
            NUMTAGS = numTags;
            // Set the chart.
            if (chart != null)
            {
                timeSeriesChart = chart;
                shouldGraph     = true;
            }

            // Connect to the reader.
            // Change the ReaderHostname constant in SolutionConstants.cs
            // to the IP address or hostname of your reader.
            reader.Connect(SolutionConstants.ReaderHostname);

            /////////////////////////////////////////
            //    SETTINGS                         //
            /////////////////////////////////////////
            Settings settings = reader.QueryDefaultSettings();

            // All data that we want tag to report.
            settings.Report.IncludeAntennaPortNumber = true;
            settings.Report.IncludeFirstSeenTime     = true;
            settings.Report.IncludePhaseAngle        = true;
            settings.Report.IncludePeakRssi          = true;
            settings.Report.IncludeChannel           = true;

            // Optimize reader for region with low number of tags, low chance of interference.
            settings.ReaderMode = ReaderMode.MaxMiller;
            settings.SearchMode = SearchMode.DualTarget;

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

            // Use same settings as the MultiReader software.
            settings.Antennas.GetAntenna(1).TxPowerInDbm       = 25;
            settings.Antennas.GetAntenna(1).RxSensitivityInDbm = -70;

            // Wait until tag query has ended before sending tag report.
            settings.Report.Mode = ReportMode.WaitForQuery;

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

            // Assign the TagsReported event handler. (Gets all of the tags)
            reader.TagsReported += OnTagsReported;

            // Start reading.
            reader.Start();

            // Initialize CSV Files.
            File.WriteAllText(@"deltatime.csv", string.Empty);
            File.WriteAllText(@"rssi.csv", string.Empty);
            File.WriteAllText(@"velocity.csv", string.Empty);

            Console.WriteLine("Initialized Reader");
        }
Beispiel #10
0
        static void Main(string[] args)
        {
            try
            {
                // Connect to the reader.
                // Pass in a reader hostname or IP address as a
                // command line argument when running the example
                if (args.Length != 1)
                {
                    Console.WriteLine("Error: No hostname specified.  Pass in the reader hostname as a command line argument when running the Sdk Example.");
                    return;
                }
                string hostname = args[0];
                reader.Connect(hostname);

                // 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 TID
                // in all tag reports. We will use FastID
                // to do this. FastID is supported
                // by Impinj Monza 4 and later tags.
                settings.Report.IncludeFastId = true;

                // 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);
            }
        }
Beispiel #11
0
        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
                // RF doppler frequency in all tag reports.
                settings.Report.IncludeDopplerFrequency = true;

                // Use antenna #1
                settings.Antennas.DisableAll();
                settings.Antennas.GetAntenna(1).IsEnabled = true;

                // ReaderMode must be set to DenseReaderM8.
                settings.ReaderMode = ReaderMode.DenseReaderM8;

                // 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);
            }
        }
Beispiel #12
0
        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();

                // Enable keepalives.
                settings.Keepalives.Enabled    = true;
                settings.Keepalives.PeriodInMs = 3000;

                // Enable link monitor mode.
                // If our application fails to reply to
                // five consecutive keepalive messages,
                // the reader will close the network connection.
                settings.Keepalives.EnableLinkMonitorMode = true;
                settings.Keepalives.LinkDownThreshold     = 5;

                // Assign an event handler that will be called
                // when keepalive messages are received.
                reader.KeepaliveReceived += OnKeepaliveReceived;

                // Assign an event handler that will be called
                // if the reader stops sending keepalives.
                reader.ConnectionLost += OnConnectionLost;

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

                // 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);
            }
        }
Beispiel #13
0
        static void Main(string[] args)
        {
            try
            {
                // Connect to the reader.
                // Pass in a reader hostname or IP address as a
                // command line argument when running the example
                if (args.Length != 1)
                {
                    Console.WriteLine("Error: No hostname specified.  Pass in the reader hostname as a command line argument when running the Sdk Example.");
                    return;
                }
                string hostname = args[0];
                reader.Connect(hostname);

                // Assign the TagOpComplete event handler.
                // This specifies which method to call
                // when tag operations are complete.
                reader.TagOpComplete += OnTagOpComplete;

                // Apply the default settings.
                reader.ApplyDefaultSettings();

                // Start reading.
                reader.Start();


                Console.WriteLine("Writing to the tag. Press enter when the operation is complete.");
                // Write random words to user memory
                TagData data = GetRandomData(NUM_WORDS_USER_MEMORY);
                BulkWrite(null, MemoryBank.User, 0, data);
                Console.ReadLine();

                // Remove all operation sequences from the reader that haven't executed.
                reader.DeleteAllOpSequences();

                Console.WriteLine("Reading from the tag. Press enter when the operation is complete.");
                // Read all of User memory
                BulkRead(null, MemoryBank.User, 0, NUM_WORDS_USER_MEMORY);
                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);
            }
        }
Beispiel #14
0
        static void Main(string[] args)
        {
            try
            {
                // Connect to the reader.
                // Pass in a reader hostname or IP address as a
                // command line argument when running the example
                if (args.Length != 1)
                {
                    Console.WriteLine("Error: No hostname specified.  Pass in the reader hostname as a command line argument when running the Sdk Example.");
                    return;
                }
                string hostname = args[0];
                reader.Connect(hostname);

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

                // Enable all of the antenna ports.
                settings.Antennas.EnableAll();

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

                // Assign handlers for various reader events.
                reader.GpiChanged     += OnGpiEvent;
                reader.AntennaChanged += OnAntennaEvent;
                reader.ReaderStarted  += OnReaderStarted;
                reader.ReaderStopped  += OnReaderStopped;

                // Start the reader (required for antenna events).
                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);
            }
        }
Beispiel #15
0
        static void Main(string[] args)
        {
            try
            {
                // This example show some of features specific to spatial readers
                // For examples of Location mode, see the projects named SpatialReaderLocation

                // Connect to the reader.
                // Pass in a reader hostname or IP address as a
                // command line argument when running the example
                if (args.Length != 1)
                {
                    Console.WriteLine("Error: No hostname specified.  Pass in the reader hostname as a command line argument when running the Sdk Example.");
                    return;
                }
                string hostname = args[0];
                reader.Connect(hostname);

                // Turn the beacon LED on for 10 seconds
                Console.WriteLine("Turning beacon on for 10 seconds");
                reader.TurnBeaconOn(10000);

                // Wait for the user to press enter.
                Console.WriteLine("Press enter to continue.");
                Console.ReadLine();

                // Turn off the beacon off
                reader.TurnBeaconOff();

                // Query the state of the tilt sensor
                Console.WriteLine("Querying tilt sensor. Press any key to exit.");
                while (true)
                {
                    // Exit if the user presses a key
                    if (Console.KeyAvailable)
                    {
                        break;
                    }
                    Status status = reader.QueryStatus();
                    Console.WriteLine("X = {0}, Y = {1}",
                                      status.TiltSensor.XAxis, status.TiltSensor.YAxis);
                }

                // 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);
            }
        }
        public MainWindow(string[] args)
        {
            InitializeComponent();

            try
            {
                // Connect to the reader.
                // Pass in a reader hostname or IP address as a
                // command line argument when running the example
                if (args.Length != 1)
                {
                    System.Diagnostics.Trace.
                    WriteLine("Error: No hostname specified.  Pass in the reader hostname as a command line argument when running the Sdk Example.");
                    return;
                }
                string hostname = args[0];
                reader.Connect(hostname);

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

                // Send a tag report for every tag read.
                settings.Report.Mode = ReportMode.Individual;

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

                // Assign the TagsReported event handler.
                // This specifies which method to call
                // when tags reports are available.
                // This method will in turn call a delegate
                // to update the UI (Listbox).
                reader.TagsReported += OnTagsReported;
            }
            catch (OctaneSdkException ex)
            {
                // An Octane SDK exception occurred. Handle it here.
                System.Diagnostics.Trace.
                WriteLine("An Octane SDK exception has occurred : {0}", ex.Message);
            }
            catch (Exception ex)
            {
                // A general exception occurred. Handle it here.
                System.Diagnostics.Trace.
                WriteLine("An exception has occurred : {0}", ex.Message);
            }
        }
Beispiel #17
0
        static void Main(string[] args)
        {
            // Defines the sources of configuration information for the
            // application.
            var builder = new ConfigurationBuilder()
                          .SetBasePath(Directory.GetCurrentDirectory())
                          .AddJsonFile("appsettings.json");

            // Create the configuration object that the application will
            // use to retrieve configuration information.
            var configuration = builder.Build();

            // Retrieve the configuration information.
            configValue = configuration.GetConnectionString("MainDisplayDB");

            Console.WriteLine("a. The read tag will automatically be served to the Teleprompt Screen, if the screen is empty");
            Console.WriteLine("b. If the screen is not empty, await the read tag to queue until available");
            Console.WriteLine("c. If the screen is empty and there's queue waiting. Pop the queue and load to Teleprompt screen");

            try
            {
                reader.Connect(SolutionConstants.ReaderHostname);

                reader.TagsReported += OnTagsReported;

                reader.ApplyDefaultSettings();

                reader.Start();

                Console.WriteLine("\n\nEnter word. 'Yallah!' to quit.\n\n\n");

                string quitline = Console.ReadLine();

                if (quitline.ToLower() == "yallah!")
                {
                    Console.WriteLine("\n\nExiting!!!");

                    reader.Stop();

                    reader.Disconnect();
                }
            }
            catch (OctaneSdkException e)
            {
                Console.WriteLine("Octane SDK exception: {0}", e.Message);

                Console.ReadLine();
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception : {0}", e.Message);

                Console.ReadLine();
            }
        }
        /// <summary>
        /// Start method from main thread
        /// </summary>
        public void Run()
        {
            try
            {
                Reader.Connect(Properties.Resources.ReaderHost);

                Impinj.OctaneSdk.Settings settings = Reader.QueryDefaultSettings();

                settings.Report.IncludeAntennaPortNumber = true;
                settings.Report.IncludePeakRssi          = true;
                settings.Report.IncludeDopplerFrequency  = true;
                settings.Report.IncludePhaseAngle        = true;
                settings.Report.IncludeLastSeenTime      = true;
                settings.Report.IncludeChannel           = true;

                settings.ReaderMode = ReaderMode.MaxMiller;
                settings.SearchMode = SearchMode.DualTarget;
                settings.Session    = 2;

                settings.Antennas.DisableAll();
                settings.Antennas.GetAntenna(1).IsEnabled = true;
                settings.Antennas.GetAntenna(2).IsEnabled = true;
                settings.Antennas.GetAntenna(3).IsEnabled = true;
                settings.Antennas.GetAntenna(4).IsEnabled = true;

                settings.Antennas.GetAntenna(1).MaxTxPower       = true;
                settings.Antennas.GetAntenna(1).MaxRxSensitivity = true;
                settings.Antennas.GetAntenna(2).MaxTxPower       = true;
                settings.Antennas.GetAntenna(2).MaxRxSensitivity = true;
                settings.Antennas.GetAntenna(3).MaxTxPower       = true;
                settings.Antennas.GetAntenna(3).MaxRxSensitivity = true;
                settings.Antennas.GetAntenna(4).MaxTxPower       = true;
                settings.Antennas.GetAntenna(4).MaxRxSensitivity = true;

                Reader.ApplySettings(settings);

                Reader.TagsReported += OnTagsReported;

                Reader.Start();

                ObjectUpdate.Elapsed += new ElapsedEventHandler(UpdateObjectStatus);
                ObjectUpdate.Interval = 1 * 1000;
                ObjectUpdate.Enabled  = true;
            }
            catch (OctaneSdkException e)
            {
                Console.WriteLine("Octane SDK exception: {0}", e.Message);
                ErrorHandler.ProcessRFIDConnectionError();
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception : {0}", e.Message);
                ErrorHandler.ProcessRFIDConnectionError();
            }
        }
Beispiel #19
0
        static void Main(string[] args)
        {
            try
            {
                // This example show the minimum program required to read tags.
                // If you require more control over the reader settings,
                // take a look at the ReadTags example.

                // Connect to the reader.
                // Pass in a reader hostname or IP address as a
                // command line argument when running the example

                /*if (args.Length != 1)
                 * {
                 *  Console.WriteLine("Error: No hostname specified.  Pass in the reader hostname as a command line argument when running the Sdk Example.");
                 *  return;
                 * }
                 * string hostname = args[0];*/
                string hostname = "speedwayr-10-9f-bb.local";
                reader.Connect(hostname);

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

                // Apply the default settings.
                reader.ApplyDefaultSettings();

                // 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);
            }
        }
Beispiel #20
0
        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 TID
                // in all tag reports. We will use FastID
                // to do this. FastID is supported
                // by Impinj Monza 4 and later tags.
                settings.Report.IncludeFastId = true;

                // 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);
            }
        }
Beispiel #21
0
        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);

                // Assign the TagOpComplete event handler.
                // This specifies which method to call
                // when tag operations are complete.
                reader.TagOpComplete += OnTagOpComplete;

                // Apply the default settings.
                reader.ApplyDefaultSettings();

                // Start reading.
                reader.Start();


                Console.WriteLine("Writing to the tag. Press enter when the operation is complete.");
                // Write random words to user memory
                TagData data = GetRandomData(NUM_WORDS_USER_MEMORY);
                BulkWrite(null, MemoryBank.User, 0, data);
                Console.ReadLine();

                // Remove all operation sequences from the reader that haven't executed.
                reader.DeleteAllOpSequences();

                Console.WriteLine("Reading from the tag. Press enter when the operation is complete.");
                // Read all of User memory
                BulkRead(null, MemoryBank.User, 0, NUM_WORDS_USER_MEMORY);
                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);
            }
        }
Beispiel #22
0
        static void Main(string[] args)
        {
            try
            {
                // This example show some of features specific to xArray
                // For examples of Location and Transition modes, see the projects
                // named XArrayLocation and XArrayTransition

                // Connect to the reader.
                // Change the ReaderHostname constant in SolutionConstants.cs
                // to the IP address or hostname of your reader.
                reader.Connect(SolutionConstants.ReaderHostname);

                // Turn the beacon LED on for 10 seconds
                Console.WriteLine("Turning beacon on for 10 seconds");
                reader.TurnBeaconOn(10000);

                // Wait for the user to press enter.
                Console.WriteLine("Press enter to continue.");
                Console.ReadLine();

                // Turn off the beacon off
                reader.TurnBeaconOff();

                // Query the state of the tilt sensor
                Console.WriteLine("Querying tilt sensor. Press any key to exit.");
                while (true)
                {
                    // Exit if the user presses a key
                    if (Console.KeyAvailable)
                    {
                        break;
                    }
                    Status status = reader.QueryStatus();
                    Console.WriteLine("X = {0}, Y = {1}",
                                      status.TiltSensor.XAxis, status.TiltSensor.YAxis);
                }

                // 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);
            }
        }
Beispiel #23
0
        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();

                // Enable all of the antenna ports.
                settings.Antennas.EnableAll();

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

                // Assign handlers for various reader events.
                reader.GpiChanged     += OnGpiEvent;
                reader.AntennaChanged += OnAntennaEvent;
                reader.ReaderStarted  += OnReaderStarted;
                reader.ReaderStopped  += OnReaderStopped;

                // Start the reader (required for antenna events).
                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);
            }
        }
Beispiel #24
0
    // Use this for initialization
    void Start()
    {
        // init bricks
        ImpinjReader reader = new ImpinjReader();
        var          cube2  = GameObject.CreatePrimitive(PrimitiveType.Cube);

        cube2.AddComponent <Rigidbody> ();
        cube2.transform.position = new Vector3(0, 5, 3);
        try
        {
            reader.Connect("SpeedwayR-10-25-32");

            Settings settings = reader.QueryDefaultSettings();

            // Enable all of the antenna ports.
            settings.Antennas.EnableAll();

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

            // Assign event handlers for GPI and antenna events.
//			reader.GpiChanged += OnGpiEvent;
//			reader.AntennaChanged += OnAntennaEvent;

            // Start the reader (required for antenna events).
            reader.Start();

            // Wait for the user to press enter.
            print("Press enter to exit.");
            Console.ReadLine();

            // Stop reading.
            reader.Stop();

            // Disconnect from the reader.
            reader.Disconnect();
        }
        catch (OctaneSdkException e)
        {
            // Handle Octane SDK errors.
            print(e.Message);
            print("oct");
        }
        catch (Exception e)
        {
            // Handle other .NET errors.
            print("net");
            print(e.Message);
            print("net");
        }
    }
Beispiel #25
0
        private void connect()
        {
            rdr      = new ImpinjReader();
            rdr.Name = ReaderIP + ":" + reader_port;
            Console.WriteLine("connecting to: " + ReaderIP + ":" + reader_port);
            //rdr.Connect(reader_ip, reader_port);
            rdr.Connect(ReaderIP);

            rdr.ApplyDefaultSettings();
            rdr.TagsReported += OnTagsReported;
            LoadSettings();
            rdr.Start();
            startedEvent(this, EventArgs.Empty);
        }
Beispiel #26
0
        public bool connect()
        {
#if DEBUG
            return(false);
#endif
            bool re = false;

            if (mReaderType == READER_TYPE.READER_IMP)
            {
                try
                {
                    mReaderIMP = new ImpinjReader();
                    mReaderIMP.TagsReported += this.tagsReportedIMP;

                    mReaderIMP.Connect(mIp);
                    mReaderIMP.ApplyDefaultSettings();

                    configIMP(mPower);

                    re = true;
                }
                catch (Exception)
                {
                    re = false;
                }
            }

            if (mReaderType == READER_TYPE.READER_TM)
            {
                try
                {
                    Reader.SetSerialTransport("tcp", SerialTransportTCP.CreateSerialReader);
                    mReaderTM          = Reader.Create(string.Format("tcp://{0}", mIp));
                    mReaderTM.TagRead += tagsReportedTM;

                    mReaderTM.Connect();

                    configTM(mPower);

                    re = true;
                }
                catch (Exception)
                {
                    re = false;
                }
            }

            return(re);
        }
        public void connect()
        {
            rdr      = new ImpinjReader();
            rdr.Name = reader_ip + ":" + reader_port;
            Console.WriteLine("connecting to: " + reader_ip + ":" + reader_port);
            //rdr.Connect(reader_ip, reader_port);
            rdr.Connect(reader_ip);

            rdr.ApplyDefaultSettings();
            rdr.TagsReported += OnTagsReported;
            ReadSettingsFromFile();
            rdr.Start();
            statusLabel.ForeColor = Color.Green;
            statusLabel.Text      = "Status: Connected";
        }
Beispiel #28
0
        static void Main(string[] args)
        {
            ushort i;

            try
            {
                // Connect to the reader.
                // Pass in a reader hostname or IP address as a
                // command line argument when running the example
                if (args.Length != 1)
                {
                    Console.WriteLine("Error: No hostname specified.  Pass in the reader hostname as a command line argument when running the Sdk Example.");
                    return;
                }
                string hostname = args[0];
                reader.Connect(hostname);

                // Configure the reader with the default settings.
                reader.ApplyDefaultSettings();

                // Turn the general purpose outputs
                // (GPOs) on one at a a time
                Console.WriteLine("Setting general purpose outputs...");
                for (i = 1; i <= 4; i++)
                {
                    reader.SetGpo(i, true);
                    Thread.Sleep(1500);
                    reader.SetGpo(i, false);
                }

                // Wait for the user to press enter.
                Console.WriteLine("Press enter to exit.");
                Console.ReadLine();

                // 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);
            }
        }
Beispiel #29
0
        private void ButtonStart_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (start == true)
                {
                    reader.Connect(ipAddress);
                    Initialise();
                    start = false;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Cannot Connect to Reader\nEither try again in 30s or reboot the reader and this application",
                                "Error creating connection",
                                MessageBoxButton.OK, MessageBoxImage.Error);
            }

            try
            {
                if (!reader.QueryStatus().IsSingulating)
                {
                    Initialise();
                    reader.Start();

                    buttonStart.Content = "STOP";
                }
                else if (reader.QueryStatus().IsSingulating)
                {
                    reader.Stop();
                    buttonStart.Content = "START";
                }
            }
            catch (OctaneSdkException ex)
            {
                // An Octane SDK exception occurred. Handle it here.
                System.Diagnostics.Trace.
                WriteLine("An Octane SDK exception has occurred : {0}", ex.Message);
            }
            catch (Exception ex)
            {
                // A general exception occurred. Handle it here.
                System.Diagnostics.Trace.
                WriteLine("An exception has occurred : {0}", ex.Message);
            }
        }
Beispiel #30
0
        public void Connect(string ip)
        {
            //readers.Add(new ImpinjReader(textBox1.Text, "Reader #1"));
            Reader = new ImpinjReader(ip, "1");

            if (Reader.IsConnected)
            {
                Reader.Disconnect();
            }

            try
            {
                Reader.Connect();

                Settings settings = Reader.QueryDefaultSettings();
                settings.Report.IncludeAntennaPortNumber = true;
                settings.Report.IncludePhaseAngle        = true;
                settings.Report.IncludeChannel           = true;
                settings.Report.IncludeDopplerFrequency  = true;
                settings.Report.IncludeFastId            = true;
                settings.Report.IncludeFirstSeenTime     = true;
                settings.Report.IncludeLastSeenTime      = true;
                settings.Report.IncludePeakRssi          = true;
                settings.Report.IncludeSeenCount         = true;
                settings.Report.IncludePcBits            = true;

                settings.ReaderMode            = ReaderMode.MaxThroughput; //.AutoSetDenseReader;
                settings.SearchMode            = SearchMode.DualTarget;    //.DualTarget;
                settings.Session               = 1;
                settings.TagPopulationEstimate = Convert.ToUInt16(200);

                SetAntennaSettings(settings);
                settings.Report.Mode = ReportMode.Individual;

                Reader.ApplySettings(settings);
            }
            catch (OctaneSdkException ee)
            {
                Console.WriteLine("Octane SDK exception: Reader #1" + ee.Message, "error");
            }
            catch (Exception ee)
            {
                // Handle other .NET errors.
                Console.WriteLine("Exception : Reader #1" + ee.Message, "error");
            }
        }