Exemple #1
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);
            }
        }
        public void VerifyTag(string key, ImpinjReader reader)
        {
            if (tagList.Contains(key))
            {
                // checking for a duplicate tag value
                if (tagsVerified.Contains(key))
                {
                    UpdateListbox(key, 1);
                    Console.WriteLine("Found Duplicate Tag in list. Please remove this from the roll");
                }
                else
                {
                    tagList.Remove(key);
                    tagsVerified.Add(key);
                    UpdateListbox(key, 0);  // 0 == tag verified
                    reader.SetGpo(1, true);
                    // success animation
                    Storyboard sb = FindResource("PlaySuccessAnimation") as Storyboard;
                    sb.Begin();
                    Thread.Sleep(1000);
                    reader.SetGpo(1, false);
                }
            }
            // checking for tag duplicates (not in tagList but already in verified list)
            else if (tagsVerified.Contains(key))
            {
                UpdateListbox(key, 1);  // 1 == tag duplicate
                Console.WriteLine("Found Duplicate Tag");

                // failure animation
                Storyboard sb = FindResource("PlayFailureAnimation") as Storyboard;
                sb.Begin();
            }
            else
            {
                UpdateListbox(key, 25); // any number that isnt 0 or 1 == tag could not be verified
                Console.WriteLine("Could not find tag");

                // failure animation
                Storyboard sb = FindResource("PlayFailureAnimation") as Storyboard;
                sb.Begin();
            }
        }
Exemple #3
0
        static void Main(string[] args)
        {
            ushort i;

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

                // 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);
            }
        }
Exemple #4
0
        static void Main(string[] args)
        {
            try
            {
                string defaultIp = "speedwayr-10-9f-bb.local";
                string usedIp;

                // 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.");
                    Console.WriteLine("Using Default Parameters: " + defaultIp);
                    usedIp = defaultIp;
                }
                else
                {
                    usedIp = args[0];
                }
                string       hostname = usedIp;
                ImpinjReader reader   = new ImpinjReader();

                Console.WriteLine("Configuring general purpose outputs.");

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

                // GPO 1 will go high when tags when tags are read.
                settings.Gpos.GetGpo(1).Mode = GpoMode.ReaderInventoryTagsStatus;

                // GPO 2 will go high when a client application connects to the reader.
                settings.Gpos.GetGpo(2).Mode = GpoMode.LLRPConnectionStatus;

                // GPO 3 will pulse high for the specified period of time.
                settings.Gpos.GetGpo(3).Mode = GpoMode.Pulsed;
                settings.Gpos.GetGpo(3).GpoPulseDurationMsec = 1000;

                // GPO 4 will behave as a regular GPO.
                settings.Gpos.GetGpo(4).Mode = GpoMode.Normal;

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

                // Start reading.
                reader.Start();

                // Set the GPO high, every three seconds.
                // The GPO will remain high for the period
                // specified by GpoPulseDurationMsec.
                for (int i = 0; i < 5; i++)
                {
                    reader.SetGpo(3, true);
                    Thread.Sleep(3000);
                }

                // 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);
            }
        }
Exemple #5
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);

                Console.WriteLine("Configuring general purpose outputs.");

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

                // GPO 1 will go high when tags when tags are read.
                settings.Gpos.GetGpo(1).Mode = GpoMode.ReaderInventoryTagsStatus;

                // GPO 2 will go high when a client application connects to the reader.
                settings.Gpos.GetGpo(2).Mode = GpoMode.LLRPConnectionStatus;

                // GPO 3 will pulse high for the specified period of time.
                settings.Gpos.GetGpo(3).Mode = GpoMode.Pulsed;
                settings.Gpos.GetGpo(3).GpoPulseDurationMsec = 1000;

                // GPO 4 will behave as a regular GPO.
                settings.Gpos.GetGpo(4).Mode = GpoMode.Normal;

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

                // Start reading.
                reader.Start();

                // Set the GPO high, every three seconds.
                // The GPO will remain high for the period
                // specified by GpoPulseDurationMsec.
                for (int i = 0; i < 5; i++)
                {
                    reader.SetGpo(3, true);
                    Thread.Sleep(3000);
                }

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