Example #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();
        }
Example #2
0
        private void UpdateReaderSettings()
        {
            System.Diagnostics.Debug.WriteLine("Updating Reader Settings... ");
            reader.ApplyDefaultSettings();

            settings = reader.QuerySettings();
            settings.Antennas.GetAntenna(1).IsEnabled          = true;
            settings.Antennas.GetAntenna(1).RxSensitivityInDbm = SolutionConstants.RxSensitivity;
            settings.Antennas.GetAntenna(1).TxPowerInDbm       = SolutionConstants.TxPower;

            settings.Report.IncludeAntennaPortNumber = true;
            settings.Report.IncludePeakRssi          = true;
            settings.Report.IncludeChannel           = true;
            settings.Report.IncludeCrc = true;
            settings.Report.IncludeDopplerFrequency = true;
            settings.Report.IncludeFastId           = true;
            settings.Report.IncludeFirstSeenTime    = true;
            settings.Report.IncludeGpsCoordinates   = true;
            settings.Report.IncludeLastSeenTime     = true;
            settings.Report.IncludePhaseAngle       = true;
            settings.Report.IncludeSeenCount        = true;
            settings.Report.Mode = ReportMode.Individual;

            reader.ApplySettings(settings);
        }
Example #3
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);
            }
        }
Example #4
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);
        }
Example #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();
    }
Example #6
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);
            }
        }
Example #7
0
        public void configIMP(double power = 28, int searchMode = 1, ushort session = 2)
        {
            try
            {
                Settings settings = mReaderIMP.QueryDefaultSettings();
                settings.Report.Mode = ReportMode.Individual;
                settings.Report.IncludeAntennaPortNumber = true;
                settings.Report.IncludePeakRssi          = true;
                switch (searchMode)
                {
                case 1:
                    settings.SearchMode = SearchMode.DualTarget;
                    break;

                case 2:
                    settings.SearchMode = SearchMode.SingleTarget;
                    break;
                }
                settings.Session = session;
                settings.Antennas.EnableAll();
                settings.Antennas.TxPowerInDbm = power;
                mReaderIMP.ApplySettings(settings);
            }
            catch (Exception)
            {
            }
        }
Example #8
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);
            }
        }
Example #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");
        }
Example #10
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);
            }
        }
Example #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);
            }
        }
Example #12
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);
            }
        }
        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);
            }
        }
Example #14
0
        public double UpdateSettings(ImpinjReader reader, double power, double stepSize)
        {
            Settings settings = reader.QuerySettings();

            settings.Antennas.TxPowerInDbm = power + stepSize;
            reader.ApplySettings(settings);
            Console.WriteLine("Power Level successfully changed");

            return(power + stepSize);
        }
        /// <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();
            }
        }
Example #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 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);
            }
        }
Example #17
0
        public void ApplySettings()
        {
            try
            {
                Console.WriteLine("Starting Configuration...");
                impinjReader.ApplyDefaultSettings();

                settings = impinjReader.QueryDefaultSettings();

                settings.TagPopulationEstimate = 50;

                Console.WriteLine("Setting Session 0");

                settings.Session    = 1;
                settings.ReaderMode = ReaderMode.AutoSetStaticFast;

                settings.SearchMode = SearchMode.SingleTarget;

                Console.WriteLine(" Setting Automode...");
                settings.AutoStart.Mode = AutoStartMode.None;
                settings.AutoStop.Mode  = AutoStopMode.None;



                Console.WriteLine("Setting Report Mode...");
                settings.Report.Mode = ReportMode.Individual;
                settings.Report.IncludeAntennaPortNumber = true;
                settings.Report.IncludeSeenCount         = true;
                settings.Report.IncludePeakRssi          = true;
                settings.Report.IncludeChannel           = false;
                settings.Report.IncludeFirstSeenTime     = false;
                settings.Report.IncludeLastSeenTime      = false;
                settings.Report.IncludePhaseAngle        = false;


                SettingAntennas();

                impinjReader.ApplySettings(settings);

                Console.WriteLine("All Set!");

                impinjReader.TagsReported += TagsReportedHandler;
            }
            catch (OctaneSdkException ex)
            {
                Console.WriteLine("OctaneSdk detected {0}", ex);
            }
            catch (Exception ex)
            {
                Console.WriteLine("Fail to setup {0}", ex);
            }
        }
Example #18
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);
            }
        }
Example #19
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");
        }
    }
Example #20
0
        private void LoadSettings(string file = "settings.xml")
        {
            Settings rdr_settings = Settings.Load(file);

            try
            {
                rdr_settings.Antennas.DisableAll();
                //antenna = view.textBox1.Text;
                //string[] words = antenna.Split(' ');
                foreach (Antenna antenna in Antennas)
                {
                    rdr_settings.Antennas.GetAntenna(antenna.ID).IsEnabled        = antenna.enabled;
                    rdr_settings.Antennas.GetAntenna(antenna.ID).TxPowerInDbm     = antenna.power;
                    rdr_settings.Antennas.GetAntenna(antenna.ID).MaxRxSensitivity = antenna.maxSensitivity;
                }

                rdr_settings.ReaderMode = Mode;

                rdr_settings.Report.IncludeAntennaPortNumber = true;

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

                if (Filter)
                {
                    rdr_settings.Filters.TagFilter1.MemoryBank = MemoryBank.Epc;

                    rdr_settings.Filters.TagFilter1.BitPointer = BitPointers.Epc;
                    // Only match tags with EPCs that start with "xxxx"
                    rdr_settings.Filters.TagFilter1.TagMask = TagMask;
                    // This filter is 16 bits long (one word).
                    //rdr_settings.Filters.TagFilter1.BitCount = 16;
                    rdr_settings.Filters.Mode = TagFilterMode.OnlyFilter1;
                }


                rdr.ApplySettings(rdr_settings);
                Console.WriteLine("Settings Applied");
                rdr_settings = rdr.QuerySettings();
                Console.WriteLine(rdr_settings.Report);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Example #21
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");
            }
        }
Example #22
0
        private void Initialise()
        {
            Settings settings = reader.QueryDefaultSettings();

            settings.Report.IncludeAntennaPortNumber = true;
            settings.Report.IncludePeakRssi          = true;
            // settings.Antennas.TxPowerMax = true;
            settings.Antennas.TxPowerInDbm = TxPowerInDbm;
            //settings.Antennas.RxSensitivityInDbm = 3;
            settings.Antennas.RxSensitivityMax = true;
            //settings.Antennas.TxPowerInDbm = 15;
            // Send a tag report for every tag read.
            settings.Report.Mode = ReportMode.Individual;
            // Apply the newly modified settings.
            reader.ApplySettings(settings);
            reader.TagsReported += OnTagsReported;
        }
Example #23
0
        public bool Connection(string address)
        {
            try
            {
                Reader.Connect("192.168.250.55");
                Reader.Stop();
            }
            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");
                Console.WriteLine(ee.StackTrace);
            }
            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.Report.IncludeSeenCount         = true;

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

            settings.Report.Mode = ReportMode.Individual;

            Antenna();

            Reader.ApplySettings(settings);

            return(Reader.IsConnected);
        }
Example #24
0
        public void Reader(string ipAnden)
        {
            try
            {
                string ipReader = ipAnden;

                if (!reader.IsConnected)
                {
                    reader.Connect(ipReader);

                    Settings settings = reader.QueryDefaultSettings();
                    settings.Report.IncludeAntennaPortNumber = true;
                    settings.Session    = 2;
                    settings.SearchMode = SearchMode.SingleTarget;
                    settings.Report.IncludeLastSeenTime = true;

                    for (ushort a = 1; a <= 4; a++)
                    {
                        settings.Antennas.GetAntenna(a).TxPowerInDbm       = Convert.ToDouble(17);// numericUpDown1.Value
                        settings.Antennas.GetAntenna(a).RxSensitivityInDbm = -70;
                    }
                    reader.ApplySettings(settings);
                    reader.Start();
                }
                reader.TagsReported += new TagsReportedHandler((sReader, report) =>
                {
                    if (BusinessOrders.EmbarqueVivo2(_embarque))
                    {
                        ReadTag(report.Tags[0]);
                    }
                    else
                    {
                        // Mensaje de advertencia por que no se pude agregar otro pallet a un embarque terminado
                        PalletNoValido();
                    }
                });
            }
            catch (Exception ex)
            {
                MessageBox.Show("     No fue posible conectar con el reader.    ");
                this.Dispose();
            }
        }
Example #25
0
        public bool Connection(string address)
        {
            if (string.IsNullOrEmpty(address))
            {
                //TODO: Show msg
            }

            try
            {
                Impinj = new ImpinjReader();
                Impinj.Connect(address);
                Impinj.Stop();
            }

            catch (OctaneSdkException ee)
            {
                Console.WriteLine($"Octane SDK exception: Impinj \" {address} \" - {ee.Message} error");
            }

            catch (Exception ee)
            {
                Console.WriteLine($"Exception : Impinj \" {address} \" - {ee.Message} error");
                Console.WriteLine(ee.StackTrace);
            }
            Settings = Impinj.QueryDefaultSettings();

            Settings.Report.IncludeFastId            = true;
            Settings.Report.IncludeFirstSeenTime     = true;
            Settings.Report.IncludeAntennaPortNumber = true;
            Settings.Report.IncludeLastSeenTime      = true;
            Settings.Report.IncludeSeenCount         = true;

            Settings.Report.Mode           = ReportMode.Individual;
            Settings.ReaderMode            = ReaderMode.AutoSetDenseReader; //.AutoSetDenseReader;
            Settings.SearchMode            = SearchMode.DualTarget;         //.DualTarget;
            Settings.Session               = 1;
            Settings.TagPopulationEstimate = Convert.ToUInt16(200);

            Impinj.ApplySettings(Settings);

            return(Impinj.IsConnected);
        }
        public void Connect(string hostname)
        {
            try
            {
                Console.WriteLine("Attempting to connect using:" + hostname);
                reader.Connect(hostname);
                connected = true;

                Settings settings = reader.QueryDefaultSettings();

                settings.Report.IncludeAntennaPortNumber = true;
                settings.Report.Mode                  = ReportMode.Individual;
                settings.Antennas.TxPowerInDbm        = 15.0;
                settings.Report.IncludeGpsCoordinates = true;
                settings.Report.IncludeSeenCount      = true;
                settings.Session    = 2;
                settings.SearchMode = SearchMode.SingleTarget;

                reader.ApplySettings(settings);
                Console.WriteLine("Successfully connected");
                listTags.Items.Clear();
                listTags.Items.Add("Successfuly connected to the reader");

                reader.TagsReported += onTagsReported;
            }
            catch (OctaneSdkException er)
            {
                System.Diagnostics.Trace.
                WriteLine("An Octane SDK exception has occurred : {0}", er.Message);
                listTags.Items.Clear();
                listTags.Items.Add("An Octane SDK Exception has occured: " + er.Message);
            }
            catch (Exception er)
            {
                System.Diagnostics.Trace.
                WriteLine("An exception has occurred : {0}", er.Message);
                listTags.Items.Clear();
                listTags.Items.Add("An exception has occurred: " + er.Message);
            }
        }
Example #27
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (!reader.IsConnected)
     {
         try
         {
             reader.Connect(textBox2.Text);
         }
         catch (Exception ex)
         {
             MessageBox.Show("Hata:" + ex.Message, "Hata!");
         }
         button1.Text = "Disconnect";
         Settings settings = reader.QueryDefaultSettings();
         settings.Report.Mode = ReportMode.Individual;
         reader.ApplySettings(settings);
     }
     else if (reader.IsConnected)
     {
         reader.Disconnect();
         button1.Text = "Connect";
     }
 }
Example #28
0
 /// <summary>
 /// Initializes RFID configuration
 /// </summary>
 public void initRFID()
 {
     try
     {
         System.Diagnostics.Debug.WriteLine("initRFID 阅读器链接" + ItemString.ReaderIP);
         // Connect to the reader
         reader.Connect(ItemString.ReaderIP);
         // Get the default settings
         Settings settings = reader.QueryDefaultSettings();
         // My setting
         settings = settingReportInformation(settings);
         //只能读到一个信号时的配置
         //settings.Antennas.GetAntenna(1).TxPowerInDbm = power;
         //settings.Antennas.GetAntenna(2).TxPowerInDbm = power;
         // Apply the newly modified settins
         reader.ApplySettings(settings);
         // Assign the TagsReported event handler.
         reader.TagsReported += OnTagsReported;
         if (!reader.IsConnected)
         {
             System.Diagnostics.Debug.WriteLine("initRFID 阅读器链接失败");
         }
         reader.Start();                               //这里 如果Reader.stop() 执行后在执行start() 则就报错
         System.Diagnostics.Debug.WriteLine("initRFID 阅读器设置完成");
     }
     catch (OctaneSdkException e)
     {
         //Headle Octane SDK errors.
         System.Diagnostics.Debug.WriteLine("initRFID: OctaneSdkException : {0} 阅读器链接失败", e.Message);
     }
     catch (Exception e)
     {
         //Handle other .Net errors.
         System.Diagnostics.Debug.WriteLine("initRFID: Exception : {0}", e.Message);
     }
 }
Example #29
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;

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

                // Create a tag read operation for User memory.
                TagReadOp readUser = new TagReadOp();
                // Read from user memory
                readUser.MemoryBank = MemoryBank.User;
                // Read two (16-bit) words
                readUser.WordCount = 2;
                // Starting at word 0
                readUser.WordPointer = 0;

                // Create a tag read operation for TID memory.
                TagReadOp readTid = new TagReadOp();
                // Read from TID memory
                readTid.MemoryBank = MemoryBank.Tid;
                // Read two (16-bit) words
                readTid.WordCount = 2;
                // Starting at word 0
                readTid.WordPointer = 0;

                // Add these operations to the reader as Optimized Read ops.
                // Optimized Read ops apply to all tags, unlike
                // Tag Operation Sequences, which can be applied to specific tags.
                // Speedway Revolution supports up to two Optimized Read operations.
                settings.Report.OptimizedReadOps.Add(readUser);
                settings.Report.OptimizedReadOps.Add(readTid);

                // Store the operation IDs for later.
                opIdUser = readUser.Id;
                opIdTid  = readTid.Id;

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

                // 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);
            }
        }
        void bw_DoWork(object sender, DoWorkEventArgs e)
        {
            // Connect to the reader.
            // Change the ReaderHostname constant in SolutionConstants.cs
            // to the IP address or hostname of your reader.
            try
            {
                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;


                // Set the reader mode, search mode and session
                settings.ReaderMode = ReaderMode.DenseReaderM8;     //AutoSetDenseReader;    //KM   DenseReaderM8;
                settings.SearchMode = SearchMode.DualTarget;
                //settings.Session = 2;
                //settings.Report.IncludeFastId = true;  //KM
                //settings.TagPopulationEstimate = 1;  //KM

                LowDutyCycleSettings ldc = new LowDutyCycleSettings(); //KM
                ldc.EmptyFieldTimeoutInMs = 1000;                      //KM
                ldc.FieldPingIntervalInMs = 200;                       //KM
                ldc.IsEnabled             = true;                      //KM
                settings.LowDutyCycle     = ldc;                       //KM

                // Enable antenna #1. Disable all others.
                settings.Antennas.DisableAll();
                //for (ushort i = 0; i < Antennas.Count; i++)
                //{
                //    settings.Antennas.GetAntenna(Antennas[i].Port).IsEnabled = Antennas[i].Enabled;
                //    settings.Antennas.GetAntenna(Antennas[i].Port).RxSensitivityInDbm = Antennas[i].RXStrength;
                //    // Set the Transmit Power and
                //    // Receive Sensitivity to the maximum.
                //    // You can also set them to specific values like this...
                //    settings.Antennas.GetAntenna(Antennas[i].Port).TxPowerInDbm = Antennas[i].TXStrength;
                //    settings.Antennas.GetAntenna(Antennas[i].Port).MaxRxSensitivity = false;
                //    settings.Antennas.GetAntenna(Antennas[i].Port).MaxTransmitPower = false;
                //    settings.Antennas.GetAntenna(Antennas[i].Port).PortNumber = Antennas[i].Port;



                //    //settings.Antennas.GetAntenna(1).RxSensitivityInDbm = -70;
                //}
                // Apply the newly modified settings.
                settings.Report.IncludePeakRssi = true;



                if (Filter != "" && Filter != null)
                {
                    settings.Filters.Mode = TagFilterMode.OnlyFilter1;
                    settings.Filters.TagFilter1.MemoryBank = MemoryBank.Epc;

                    settings.Filters.TagFilter1.BitPointer = BitPointers.Epc;
                    //settings.Filters.TagFilter1.TagMask = Filter;
                }
                reader.ApplySettings(settings);
                reader.TagsReported += OnTagsReported;
                isConnected          = true;
            }
            catch (Exception ex)
            {
                isConnected = false;
            }
            finally
            {
            }
        }
        public void ConnectAndPrepareAllReaders()
        {
            foreach (string readerName in ReaderNames)
            {
                ImpinjReader reader = new ImpinjReader();

                try
                {
                    // Set the reader identity. It can be any object.
                    // This is passed back with events and tag reports.
                    reader.Name = readerName;
                    //reader.ReaderIdentity = readerName;

                    // Change the level of logging detail. The default is Error.
                    //reader.LogLevel = LogLevel.Error;

                    // Attach to events
                    Reader.TagsReported += OnTagsReported;
                    Reader.ReaderStarted += OnReaderStarted;
                    Reader.ReaderStopped += OnReaderStopped;

                    // Connect to the reader. The name is the host name
                    // or IP address.
                    Reader.Connect(_ReaderIP);

                    // Clear the reader of any RFID operation and configuration.
                    Reader.ApplyDefaultSettings();

                    // Query the default settings for the reader. Settings
                    // include which antennas are enabled, when to report and
                    // optional report fields. Typically you will prepare the
                    // reader by getting the default settings and adjusting them.
                    //
                    // This example sets the reader to send a tag report
                    // immediately on every tag observation. Message buffering
                    // improves overall efficiency but introduces a small
                    // delay before the application is notified of a tag.
                    // Message buffering is enabled by default.
                    Settings settings = Reader.QueryDefaultSettings();
                    settings.Report.Mode = ReportMode.Individual;

                    settings.ReaderMode = ReaderMode.AutoSetDenseReader; // Adjust ช่องความถี่
                    settings.SearchMode = SearchMode.TagFocus; //จับสัญญาน ไวขึ้น
                    settings.Session = 1;

                    settings.AutoStart.Mode = AutoStartMode.GpiTrigger;
                    settings.AutoStart.GpiPortNumber = 1;
                    settings.AutoStart.GpiLevel = true;
                    settings.AutoStop.Mode = AutoStopMode.GpiTrigger;
                    settings.AutoStop.GpiPortNumber = 1;
                    settings.AutoStop.GpiLevel = false;
                    settings.Report.IncludeAntennaPortNumber = true;

                    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).MaxRxSensitivity = true;
                    settings.Antennas.GetAntenna(1).TxPowerInDbm = 25;
                    settings.Antennas.GetAntenna(2).MaxRxSensitivity = true;
                    settings.Antennas.GetAntenna(2).TxPowerInDbm = 25;
                    settings.Antennas.GetAntenna(3).MaxRxSensitivity = true;
                    settings.Antennas.GetAntenna(3).TxPowerInDbm = 25;
                    settings.Antennas.GetAntenna(4).MaxRxSensitivity = true;
                    settings.Antennas.GetAntenna(4).TxPowerInDbm = 25;
                    reader.ApplySettings(settings);
                    
                    // Add this reader to the list of readers.
                    readers.Add(reader);
                }
                catch (Exception ex)
                {
                    //Console.WriteLine("Exception {0} for reader {1}", ex, readerName);
                    try
                    {
                        reader.Disconnect();
                    }
                    catch (OctaneSdkException octaneSdkException)
                    {
                        //Console.WriteLine("OctaneSdk detected {0}", octaneSdkException);
                    }
                    catch (Exception exception)
                    {
                        //Console.WriteLine("Exception {0}", exception);
                    }
                }
            }
        }