Exemplo n.º 1
0
        // WAM code
        public void SetupWamMode()
        {
            Settings settings = reader.QueryDefaultSettings();

            // Put the xArray into location mode
            settings.XArray.Mode = XArrayMode.WideAreaMonitor;

            settings.Report.IncludeAntennaPortNumber = true;
            settings.Report.IncludePeakRssi          = true;
            // Set the reader mode, search mode and session
            settings.ReaderMode            = READER_MODE;
            settings.SearchMode            = WAM_SEARCH_MODE;
            settings.Session               = WAM_SESSION;
            settings.TagPopulationEstimate = TAG_POPULATION_ESTIMATE;

            // Enable all Antennas (Beams)
            settings.Antennas.EnableAll();
            // Gen2 Filtering
            settings = SetupFilter(settings);

            reader.ApplySettings(settings);
            reader.TagsReported += OnTagsReported;

            // Start reading.
            reader.Start();
        }
Exemplo n.º 2
0
        static void singleRead()
        {
            Settings settings = reader.QueryDefaultSettings();

            reader.Start();
            //DSForm = new FormRealTime(TagNames);
            //Application.Run(DSForm);

            Thread.Sleep(5000);
            reader.Stop();
            System.Console.WriteLine("IncomingTagNumber93 is:" + IncomingTagNumber93);
            System.Console.WriteLine("IncomingTagNumber87 is:" + IncomingTagNumber87);
            System.Console.WriteLine("IncomingTagNumber96 is:" + IncomingTagNumber96);

            while (true)
            {
                //for (double i = 30; i > 29.75; i = i - 0.25)
                //{
                double i = 29.75;
                //System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
                //sw.Start();
                IncomingTagNumber93 = 0;
                IncomingTagNumber87 = 0;
                IncomingTagNumber96 = 0;
                SpecifiedTx         = i;
                settings.Antennas.GetAntenna(1).TxPowerInDbm = SpecifiedTx;
                reportSetting(settings);
                settings.Antennas.DisableAll();
                settings.Antennas.GetAntenna(1).IsEnabled = true;
                settings.SearchMode  = SearchMode.DualTarget;
                settings.Session     = 2;
                settings.ReaderMode  = ReaderMode.MaxThroughput;
                settings.Report.Mode = ReportMode.Individual;
                filterTags(settings);

                //
                reader.ApplySettings(settings);
                reader.Start();
                //AddRedundancy();//indicate the start



                //
                //reader.ApplySettings(settings);
                //reader.Start();
                Thread.Sleep(3000);    //收集5s数据?
                System.Console.WriteLine("Current Tx power is:" + settings.Antennas.GetAntenna(1).TxPowerInDbm);
                reader.Stop();
                System.Console.WriteLine("IncomingTagNumber93 is:" + IncomingTagNumber93);
                System.Console.WriteLine("IncomingTagNumber87 is:" + IncomingTagNumber87);
                System.Console.WriteLine("IncomingTagNumber96 is:" + IncomingTagNumber96);
                //}
            }


            applicactionClose();
        }
Exemplo n.º 3
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();
    }
Exemplo n.º 4
0
        static void OnConnectAsyncComplete(ImpinjReader reader, ConnectAsyncResult result, string errorMessage)
        {
            // This event handler is called asynchronously
            // when the connection attempt has completed.

            // Check the result of the connection attempt
            if (result == ConnectAsyncResult.Success)
            {
                // Successfully connection to the reader. Now configure  and start it.
                Console.WriteLine("Successfully connected to {0}", reader.Address);
                reader.ApplyDefaultSettings();
                Console.WriteLine("Starting reader...");
                reader.Start();
                Console.WriteLine("Stopping reader in 5 seconds...");
                Thread.Sleep(5000);
                reader.Stop();
                reader.Disconnect();
                Console.WriteLine("Reader stopped. Press enter to exit.");
            }
            else
            {
                // Failed to connect to the reader
                Console.WriteLine("Failure while connecting to {0} : {1}", reader.Address, errorMessage);
            }
        }
Exemplo n.º 5
0
        static void Main(string[] args)
        {
            Reader       readerObject = new Reader();
            ImpinjReader reader       = new ImpinjReader();
            Stopwatch    s            = new Stopwatch();

            /*
             *  ARGUMENTS IN ORDER:
             *  0: Hostname
             *  1: Start Power
             *  2: End Power
             *  3: Step Size
             *  4: Power Duration
             *  5: CSV File name
             */
            // variable initialization
            string hostname     = args[0];
            double startPower   = Convert.ToDouble(args[1]);
            double endPower     = Convert.ToDouble(args[2]);
            double stepSize     = Convert.ToDouble(args[3]);
            int    duration     = Convert.ToInt32(args[4]);
            string tagName      = args[5];
            double currentPower = startPower;

            // start the margin test
            readerObject.ConnectReader(reader, hostname, currentPower);
            // creating event for when a tag is reportedi

            reader.TagsReported += onTagsReported;


            while (currentPower <= endPower)
            {
                if (reader.IsConnected)
                {
                    reader.Start();
                    s.Start();
                    while (s.Elapsed < TimeSpan.FromSeconds(duration))
                    {
                        //Console.WriteLine("This is a test");
                    }
                    s.Reset();
                    reader.Stop();
                    WriteFileName(tagsRead, tagName, currentPower);
                    // clearing list contents to make room for the next powerlevel
                    tagsRead.Clear();
                    // updating the power setting before running the test again
                    currentPower = readerObject.UpdateSettings(reader, currentPower, stepSize);
                }
                else
                {
                    Console.Write("Reader not connected! ");
                    System.Environment.Exit(1);
                }
                Console.WriteLine("Finished A power cycle");
            }

            Console.WriteLine("Margin test completed. Moving Outputs to /data");
            reader.Disconnect();
        }
Exemplo n.º 6
0
 private void buttonStart_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         // Don't call the Start method if the
         // reader is already running.
         if (!reader.QueryStatus().IsSingulating)
         {
             // Start reading.
             reader.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);
     }
 }
Exemplo n.º 7
0
 public async Task StartReading()
 {
     await Task.Run(() =>
     {
         try
         {
             if (IsConnected)
             {
                 impinjReader.Start();
                 _isReading = true;
             }
         }
         catch (OctaneSdkException ex)
         {
             Console.WriteLine(ex.Message);
             return(false);
         }
         catch (Exception ex)
         {
             Console.WriteLine("Exception {0}", ex);
             return(false);
         }
         return(true);
     });
 }
Exemplo n.º 8
0
        public override void StartInventory()
        {
            if (!isInventory)
            {
                Invoke(new Action(() =>
                {
                    dataGridView1_msg.Rows.Clear();
                    lblWorkStatus.Text = "开始扫描";
                    if (btnStart.Enabled)
                    {
                        Start();
                    }
                    label_readTags.Text   = "0";
                    label11_writeTag.Text = "0";
                }));

                mWriteTagCount        = 0;
                mWriteSuccessTagCount = 0;
                SetInventoryResult(0);
                epcList.Clear();

                mReader.Start();
                isInventory  = true;
                lastReadTime = DateTime.Now;
            }
        }
Exemplo n.º 9
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);
            }
        }
Exemplo n.º 10
0
 private void epc_oku_Click(object sender, EventArgs e)
 {
     if (reader.IsConnected)
     {
         reader.Start();
     }
 }
Exemplo n.º 11
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);
            }
        }
Exemplo n.º 12
0
 public void startRead()
 {
     try
     {
         if (mReaderType == READER_TYPE.READER_IMP)
         {
             mReaderIMP.Start();
         }
         if (mReaderType == READER_TYPE.READER_TM)
         {
             mReaderTM.StartReading();
         }
         if (mReaderType == READER_TYPE.READER_DLX_PM)
         {
             mReaderDLXPM.StartInventory(mComPort, RadioOperationMode.Continuous, 1);
         }
         if (mReaderType == READER_TYPE.READER_XD_PM)
         {
             mReaderXDPM.StartInventory(1000, 8192u, false);
         }
     }
     catch (Exception)
     {
     }
 }
Exemplo n.º 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);

                // 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);
            }
        }
Exemplo n.º 14
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");
        }
Exemplo n.º 15
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);
            }
        }
Exemplo n.º 16
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);
            }
        }
Exemplo n.º 17
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);
            }
        }
Exemplo n.º 18
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();
            }
        }
Exemplo n.º 19
0
        /// <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();
            }
        }
Exemplo n.º 20
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);
            }
        }
Exemplo n.º 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);

                // 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);
            }
        }
Exemplo n.º 22
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);
            }
        }
Exemplo n.º 23
0
 private static void Reader_ConnectAsyncComplete(ImpinjReader reader, ConnectAsyncResult result, string errorMessage)
 {
     if (result == ConnectAsyncResult.Success)
     {
         reader.ApplyDefaultSettings();
         reader.Start();
         Console.WriteLine("Started...");
     }
     else
     {
         Console.WriteLine(errorMessage);
     }
 }
Exemplo n.º 24
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);
            }
        }
Exemplo n.º 25
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");
        }
    }
Exemplo n.º 26
0
        //Boton para iniciar lectura del speedway
        private void button1_Click(object sender, EventArgs e)
        {
            switch (btnIniDetLectSpeedway.Text)
            {
            case "Iniciar Lectura Speedway":

                #region Speedway
                try
                {
                    reader.ApplyDefaultSettings();
                    Settings settings = reader.QuerySettings();
                    settings.Antennas.DisableAll();
                    settings.Antennas.GetAntenna(1).IsEnabled = true;
                    settings.Report.Mode           = ReportMode.BatchAfterStop;
                    settings.Report.Mode           = ReportMode.BatchAfterStop;
                    settings.AutoStart.Mode        = AutoStartMode.Periodic;
                    settings.AutoStart.PeriodInMs  = 3000;
                    settings.AutoStop.Mode         = AutoStopMode.Duration;
                    settings.AutoStop.DurationInMs = 1500;
                    reader.ApplySettings(settings);
                    btnIniDetLectSpeedway.Text = "Detener Lectura Speedway";
                    reader.TagsReported       += OnTagsReported;
                    reader.Start();
                }
                catch
                {
                    MessageBox.Show("Speedway no conectado");
                }
                #endregion
                break;

            case "Detener Lectura Speedway":
                //reader.Stop();
                btnIniDetLectSpeedway.Text = "Iniciar Lectura Speedway";
                reader.TagsReported       -= OnTagsReported;
                break;
            }
        }
Exemplo n.º 27
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);
        }
Exemplo n.º 28
0
        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";
        }
 public bool StartRead()
 {
     try
     {
         reader.Start();
         return(true);
     }
     catch (Exception ex)
     {
         return(false);
     }
     finally
     {
     }
 }
Exemplo n.º 30
0
 public void startRead()
 {
     try
     {
         if (mReaderType == READER_TYPE.READER_IMP)
         {
             mReaderIMP.Start();
         }
         if (mReaderType == READER_TYPE.READER_TM)
         {
             mReaderTM.StartReading();
         }
     }
     catch (Exception)
     {
     }
 }