コード例 #1
0
        private void RefreshReaderDisplay()
        {
            System.Diagnostics.Debug.WriteLine("Refresh Reader Display... ");
            String info = "Not Connected";

            try
            {
                features = reader.QueryFeatureSet();
                status   = reader.QueryStatus();
                settings = reader.QuerySettings();

                info = Formatting.FormatReaderInfo(reader, features, settings, status);
            }
            catch (OctaneSdkException err)
            {
                System.Diagnostics.Debug.WriteLine("DisplaySettings: Octane SDK exception: " + err.Message);
                info = "Octane Exception, Not Connected";
            }
            catch (Exception err)
            {
                System.Diagnostics.Debug.WriteLine("DisplaySettings: Exception: " + err.Message);
                info = "Exception, Not Connected";
            }
            finally
            {
                Display.UpdateReaderInfo(info);
                Display.UpdateConnectButton(this);
            }
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: babyrobot-eu/rfid
        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 TagsReported event handler.
                // This specifies which method to call
                // when tags reports are available.
                reader.TagsReported += OnTagsReported;

                // 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 Peak RSSI
                // 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.IncludePeakRssi = true;

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

                // Loop through all the valid Rx settings.
                FeatureSet features = reader.QueryFeatureSet();
                foreach (RxSensitivityTableEntry rx in features.RxSensitivities)
                {
                    Console.WriteLine("Setting Rx Sensitivity to {0} dBm", rx.Dbm);
                    // Set the receive sensitivity (in dBm).
                    settings.Antennas.GetAntenna(1).RxSensitivityInDbm = rx.Dbm;

                    // Apply the new receive sensitivity settings.
                    reader.ApplySettings(settings);

                    // Start the reader.
                    reader.Start();

                    // Wait
                    Thread.Sleep(1000);

                    // Stop the reader.
                    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);
            }

            // Wait for the user to press enter.
            Console.WriteLine("Press enter to exit.");
            Console.ReadLine();
        }
コード例 #3
0
ファイル: MainWindow.xaml.cs プロジェクト: S8aVv/xArray
        private void Setting_Config(FeatureSet features, Settings settings)
        {
            try
            {
                // Connect to the reader.
                // Change the ReaderHostname constant in SolutionConstants.cs
                // to the IP address or hostname of your reader.
                reader.Connect(Host.Text);

                // Get the reader features to determine if the
                // reader supports a fixed-frequency table.
                features = reader.QueryFeatureSet();

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


                    // Add antenna number to tag report
                    settings.Report.IncludeAntennaPortNumber = true;

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

                    settings.ReaderMode            = read;
                    settings.SearchMode            = search;
                    settings.Session               = Convert.ToUInt16(session.Text);
                    settings.TagPopulationEstimate = 0;

                    // Specify the transmit frequencies to use.
                    // Make sure your reader supports this and
                    // that the frequencies are valid for your region.
                    // readers.(China)
                    settings.TxFrequenciesInMhz.Add(Frequencies);

                    // Start by disabling all of the antennas
                    //settings.Antennas.DisableAll();

                    //string strText = Sector.Text;
                    //string[] strArr = strText.Split(',');
                    //ushort[] usArr = new ushort[strArr.Length];
                    //for(int i = 0; i < strArr.Length; i++)
                    //{
                    //usArr[i] = Convert.ToUInt16(strArr[i]);
                    //}
                    // Enable antennas by specifying an array of antenna IDs
                    // settings.Antennas.EnableById(usArr);
                    // Or set each antenna individually
                    //settings.Antennas.GetAntenna(52).IsEnabled = true;
                    //settings.Antennas.GetAntenna(3).IsEnabled = true;
                    // ...

                    // Set all the antennas to the max transmit power and receive sensitivity
                    settings.Antennas.TxPowerMax       = true;
                    settings.Antennas.RxSensitivityMax = true;
                    // Or set all antennas to a specific value in dBm
                    settings.Antennas.TxPowerInDbm = Convert.ToDouble(Power1.Text);
                    //settings.Antennas.RxSensitivityInDbm = -70.0;
                    // Or set each antenna individually
                    //settings.Antennas.GetAntenna(1).MaxTxPower = true;
                    //settings.Antennas.GetAntenna(1).MaxRxSensitivity = true;
                    //settings.Antennas.GetAntenna(2).TxPowerInDbm = 30.0;
                    //settings.Antennas.GetAntenna(2).RxSensitivityInDbm = -70.0;
                    // ...

                    // xArray only
                    // Enable antennas by sector number
                    //settings.Antennas.EnableBySector(new ushort[] { 3, 4, 5 });

                    // xArray only
                    // Enable antennas by ring number
                    //settings.Antennas.EnableByRing(new ushort[] { 6, 7 });

                    // Tell the reader to include the
                    // RF doppler frequency in all tag reports.
                    settings.Report.IncludeDopplerFrequency = true;

                    // Tell the reader to include the
                    //First Seen Time in all tag reports.
                    settings.Report.IncludeFirstSeenTime = true;

                    // Tell the reader to include the
                    //Last Seen Time in all tag reports.
                    settings.Report.IncludeLastSeenTime = true;

                    // Tell the reader to include the
                    //Last Seen Time in all tag reports.
                    settings.Report.IncludePeakRssi = true;

                    // Tell the reader to include the
                    // RF Phase Angle in all tag reports.
                    settings.Report.IncludePhaseAngle = true;

                    settings.Report.IncludeChannel = true;

                    settings.Report.IncludeSeenCount = true;
                    // 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;

                    // 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);
            }
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: babyrobot-eu/rfid
        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);

                string executingPath = Path.GetFullPath(Path.Combine(Assembly.GetExecutingAssembly().Location, ".."));

                // Query the reader features and print the results.
                Console.WriteLine("Reader Features");
                Console.WriteLine("---------------");
                FeatureSet features = reader.QueryFeatureSet();
                Console.WriteLine("Model name : {0}", features.ModelName);
                Console.WriteLine("Model number : {0}", features.ModelNumber);
                Console.WriteLine("Reader model : {0}", features.ReaderModel.ToString());
                Console.WriteLine("Firmware version : {0}", features.FirmwareVersion);
                Console.WriteLine("Antenna count : {0}\n", features.AntennaCount);

                // Write the reader features to file.
                string featuresFile = Path.Combine(executingPath, "features.xml");
                features.Save(featuresFile);

                // Query the current reader status.
                Console.WriteLine("Reader Status");
                Console.WriteLine("---------------");
                Status status = reader.QueryStatus();
                Console.WriteLine("Is connected : {0}", status.IsConnected);
                Console.WriteLine("Is singulating : {0}", status.IsSingulating);
                Console.WriteLine("Temperature : {0}° C\n", status.TemperatureInCelsius);

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

                // Display the current reader settings.
                DisplayCurrentSettings();

                // Save the settings to file in XML format.
                Console.WriteLine("Saving settings to file.");
                Settings settings     = reader.QuerySettings();
                string   settingsFile = Path.Combine(executingPath, "settings.xml");
                settings.Save(settingsFile);

                // Wait here, so we can edit the
                // settings.xml file in a text editor.
                Console.WriteLine("Edit settings.xml and press enter.");
                Console.ReadLine();

                // Load the modified settings from file.
                Console.WriteLine("Loading settings from file.");
                settings = Settings.Load(settingsFile);

                // Apply the settings we just loaded from file.
                Console.WriteLine("Applying settings from file.\n");
                reader.ApplySettings(settings);

                // Display the settings again to show the changes.
                DisplayCurrentSettings();

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

                // Disconnect from the reader.
                reader.Disconnect();
            }
            catch (OctaneSdkException e)
            {
                // Handle Octane SDK errors.
                Console.WriteLine("Octane SDK exception: {0}", e.Message);
            }
            catch (Exception e)
            {
                // Handle other .NET errors.
                Console.WriteLine("Exception : {0}", e.Message);
            }
        }
コード例 #5
0
ファイル: Program.cs プロジェクト: KennethLui/TG2
        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);

                // Query the reader features and print the results.
                Console.WriteLine("Reader Features");
                Console.WriteLine("---------------");
                FeatureSet features = reader.QueryFeatureSet();
                Console.WriteLine("Model name : {0}", features.ModelName);
                Console.WriteLine("Model number : {0}", features.ModelNumber);
                Console.WriteLine("Reader model : {0}", features.ReaderModel.ToString());
                Console.WriteLine("Firmware version : {0}", features.FirmwareVersion);
                Console.WriteLine("Antenna count : {0}\n", features.AntennaCount);

                // Write the reader features to file.
                features.Save("features.xml");

                // Query the current reader status.
                Console.WriteLine("Reader Status");
                Console.WriteLine("---------------");
                Status status = reader.QueryStatus();
                Console.WriteLine("Is connected : {0}", status.IsConnected);
                Console.WriteLine("Is singulating : {0}", status.IsSingulating);
                Console.WriteLine("Temperature : {0}° C\n", status.TemperatureInCelsius);

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

                // Display the current reader settings.
                DisplayCurrentSettings();

                // Save the settings to file in XML format.
                Console.WriteLine("Saving settings to file.");
                Settings settings = reader.QuerySettings();
                settings.Save("settings.xml");

                // Wait here, so we can edit the
                // settings.xml file in a text editor.
                Console.WriteLine("Edit settings.xml and press enter.");
                Console.ReadLine();

                // Load the modified settings from file.
                Console.WriteLine("Loading settings from file.");
                settings = Settings.Load("settings.xml");

                // Apply the settings we just loaded from file.
                Console.WriteLine("Applying settings from file.\n");
                reader.ApplySettings(settings);

                // Display the settings again to show the changes.
                DisplayCurrentSettings();

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

                // Disconnect from the reader.
                reader.Disconnect();
            }
            catch (OctaneSdkException e)
            {
                // Handle Octane SDK errors.
                Console.WriteLine("Octane SDK exception: {0}", e.Message);
            }
            catch (Exception e)
            {
                // Handle other .NET errors.
                Console.WriteLine("Exception : {0}", e.Message);
            }
        }
コード例 #6
0
        static void Main(string[] args)
        {
            // DetermineMRT();
            //DetermineMRT(client);
            try
            {
                Client client = new Client();
                client.Start();
                System.Console.WriteLine("Before------------!!!");
                initDataRow();
                InitTagsEPC();
                System.Console.WriteLine("Before Connect!!!");
                reader.Connect(SolutionConstants.ReaderHostname);
                System.Console.WriteLine("Connect!!!");
                FeatureSet features = reader.QueryFeatureSet();
                Settings   settings = reader.QueryDefaultSettings();
                reportSetting(settings);
                settings.Antennas.DisableAll();
                settings.Antennas.GetAntenna(1).IsEnabled = true;
                settings.Antennas.GetAntenna(2).IsEnabled = true;

                SpecifiedTx = 30;
                settings.Antennas.GetAntenna(1).TxPowerInDbm = SpecifiedTx;
                settings.SearchMode = SearchMode.DualTarget;
                settings.Session    = 2;
                settings.ReaderMode = ReaderMode.MaxThroughput;//编码方式
                System.Console.WriteLine("1!");
                settings.Report.Mode = ReportMode.Individual;
                filterTags(settings);
                if (0 != fixFrequency(features, settings))
                {
                    applicactionClose();
                }

                System.Console.WriteLine("3!");
                reader.ApplySettings(settings);
                reader.TagsReported += OnTagsReported;
                List <double> PowerRange = new List <double>();
                //AddTag tag30 = new AddTag();
                //tag30.Test();
                //tag30.Test();
                while (true)
                {
                    //for (double i = 32; i > 28; i = i - 0.25)
                    //{
                    int i = 32;
                    //double i = 29.75;
                    PowerRange.Add(i);

                    IncomingTagNumber30 = 0;
                    IncomingTagNumber37 = 0;
                    IncomingTagNumber59 = 0;
                    IncomingTagNumber25 = 0;
                    IncomingTagNumber44 = 0;
                    IncomingTagNumber51 = 0;
                    IncomingTagNumber16 = 0;
                    IncomingTagNumber41 = 0;
                    IncomingTagNumber60 = 0;
                    IncomingTagNumber46 = 0;
                    IncomingTagNumber47 = 0;
                    IncomingTagNumber68 = 0;
                    IncomingTagNumber35 = 0;
                    IncomingTagNumber01 = 0;
                    IncomingTagNumber17 = 0;
                    IncomingTagNumber40 = 0;
                    IncomingTagNumber45 = 0;
                    IncomingTagNumber48 = 0;
                    IncomingTagNumber54 = 0;
                    IncomingTagNumber53 = 0;
                    IncomingTagNumber52 = 0;
                    IncomingTagNumber58 = 0;
                    SpecifiedTx         = i;

                    settings.Antennas.GetAntenna(1).TxPowerInDbm = SpecifiedTx;
                    reader.ApplySettings(settings);
                    reader.Start();
                    Thread.Sleep(1000);//收集5s数据?
                    reader.Stop();
                    System.Console.WriteLine("Current Tx power is:" + settings.Antennas.GetAntenna(1).TxPowerInDbm);
                    System.Console.WriteLine("IncomingTagNumber30 is:" + IncomingTagNumber30);
                    TagList30.Add(IncomingTagNumber30);
                    //tag30.Count = IncomingTagNumber30;


                    System.Console.WriteLine("IncomingTagNumber37 is:" + IncomingTagNumber37);
                    TagList37.Add(IncomingTagNumber37);
                    int testcount = 9;
                    if (testcount < 10)
                    {
                        client.ReadInput(IncomingTagNumber37);
                        client.Send("00037");
                    }
                    System.Console.WriteLine("IncomingTagNumber59 is:" + IncomingTagNumber59);
                    TagList59.Add(IncomingTagNumber59);
                    System.Console.WriteLine("IncomingTagNumber25 is:" + IncomingTagNumber25);
                    TagList25.Add(IncomingTagNumber25);
                    System.Console.WriteLine("IncomingTagNumber44 is:" + IncomingTagNumber44);
                    TagList44.Add(IncomingTagNumber44);
                    System.Console.WriteLine("IncomingTagNumber51 is:" + IncomingTagNumber51);
                    TagList51.Add(IncomingTagNumber51);
                    System.Console.WriteLine("IncomingTagNumber16 is:" + IncomingTagNumber16);
                    TagList16.Add(IncomingTagNumber16);
                    System.Console.WriteLine("IncomingTagNumber41 is:" + IncomingTagNumber41);
                    TagList41.Add(IncomingTagNumber41);
                    System.Console.WriteLine("IncomingTagNumber60 is:" + IncomingTagNumber60);
                    TagList60.Add(IncomingTagNumber60);
                    System.Console.WriteLine("IncomingTagNumber46 is:" + IncomingTagNumber46);
                    TagList46.Add(IncomingTagNumber46);
                    System.Console.WriteLine("IncomingTagNumber47 is:" + IncomingTagNumber47);
                    TagList47.Add(IncomingTagNumber47);
                    System.Console.WriteLine("IncomingTagNumber68 is:" + IncomingTagNumber68);
                    TagList68.Add(IncomingTagNumber68);
                    System.Console.WriteLine("IncomingTagNumber35 is:" + IncomingTagNumber35);
                    TagList35.Add(IncomingTagNumber35);
                    System.Console.WriteLine("IncomingTagNumber01 is:" + IncomingTagNumber01);
                    TagList01.Add(IncomingTagNumber01);
                    System.Console.WriteLine("IncomingTagNumber17 is:" + IncomingTagNumber17);
                    TagList17.Add(IncomingTagNumber17);
                    System.Console.WriteLine("IncomingTagNumber40 is:" + IncomingTagNumber40);
                    TagList40.Add(IncomingTagNumber40);
                    System.Console.WriteLine("IncomingTagNumber45 is:" + IncomingTagNumber45);
                    TagList45.Add(IncomingTagNumber45);
                    System.Console.WriteLine("IncomingTagNumber48 is:" + IncomingTagNumber48);
                    TagList48.Add(IncomingTagNumber48);
                    System.Console.WriteLine("IncomingTagNumber54 is:" + IncomingTagNumber54);
                    TagList54.Add(IncomingTagNumber54);
                    System.Console.WriteLine("IncomingTagNumber53 is:" + IncomingTagNumber53);
                    TagList53.Add(IncomingTagNumber53);
                    System.Console.WriteLine("IncomingTagNumber52 is:" + IncomingTagNumber52);
                    TagList52.Add(IncomingTagNumber52);
                    System.Console.WriteLine("IncomingTagNumber58 is:" + IncomingTagNumber58);
                    TagList58.Add(IncomingTagNumber58);



                    //}
                }
            }
            catch (OctaneSdkException e)
            {
                Console.WriteLine("Octane SDK exception: {0}", e.Message);
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception : {0}", e.Message);
                //return null;
            }
            //Check the Status Change

            //InspectStatusChange(TxRange);
        }
コード例 #7
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 TagsReported event handler.
                // This specifies which method to call
                // when tags reports are available.
                reader.TagsReported += OnTagsReported;

                // 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 Peak RSSI
                // 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.IncludePeakRssi = true;

                // Loop through all the valid Tx settings.
                FeatureSet features = reader.QueryFeatureSet();
                foreach (TxPowerTableEntry tx in features.TxPowers)
                {
                    // Set the transmit power (in dBm).
                    Console.WriteLine("Setting Tx Power to {0} dBm", tx.Dbm);
                    settings.Antennas.GetAntenna(1).TxPowerInDbm = tx.Dbm;

                    // Apply the new transmit power settings.
                    reader.ApplySettings(settings);

                    // Start the reader.
                    reader.Start();

                    // Wait
                    Thread.Sleep(1000);

                    // Stop the reader.
                    reader.Stop();
                }

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

                // Disconnect from the reader.
                reader.Disconnect();
            }
            catch (OctaneSdkException e)
            {
                Console.WriteLine("Octane SDK exception: {0}", e.Message);
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception : {0}", e.Message);
            }
        }
コード例 #8
0
ファイル: Program.cs プロジェクト: babyrobot-eu/rfid
        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 reader features to determine if the
                // reader supports a fixed-frequency table.
                FeatureSet features = reader.QueryFeatureSet();

                if (features.IsHoppingRegion && features.ReaderModel != ReaderModel.SpeedwayR120 && features.ReaderModel != ReaderModel.SpeedwayR220)
                {
                    // 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.IncludeChannel = true;

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

                    // Specify the transmit frequencies to use.
                    // Make sure your reader supports this and
                    // that the frequencies are valid for your region.
                    // The following example is for FCC readers.
                    settings.ReducedPowerFrequenciesInMhz.Add(902.75);
                    settings.ReducedPowerFrequenciesInMhz.Add(903.25);
                    settings.ReducedPowerFrequenciesInMhz.Add(903.75);
                    settings.ReducedPowerFrequenciesInMhz.Add(904.25);
                    settings.ReducedPowerFrequenciesInMhz.Add(904.75);
                    settings.ReducedPowerFrequenciesInMhz.Add(905.25);
                    settings.ReducedPowerFrequenciesInMhz.Add(905.75);
                    settings.ReducedPowerFrequenciesInMhz.Add(906.25);
                    settings.ReducedPowerFrequenciesInMhz.Add(906.75);
                    settings.ReducedPowerFrequenciesInMhz.Add(907.25);
                    settings.ReducedPowerFrequenciesInMhz.Add(907.75);
                    settings.ReducedPowerFrequenciesInMhz.Add(908.25);
                    settings.ReducedPowerFrequenciesInMhz.Add(908.75);
                    settings.ReducedPowerFrequenciesInMhz.Add(909.25);
                    settings.ReducedPowerFrequenciesInMhz.Add(909.75);

                    settings.Antennas.DisableAll();
                    settings.Antennas.GetAntenna(1).IsEnabled = 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();
                }
                else
                {
                    Console.WriteLine("This reader does not allow reduced power frequencies to be specified.");
                }
            }
            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);
            }
        }
コード例 #9
0
ファイル: Program1.cs プロジェクト: recheal-zhang/RDTrack
        static MSExcel.Workbook excelDoc;         //Excel文档变量



        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();
                FeatureSet featureset = reader.QueryFeatureSet();

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

                //丁丁姐加入还有一个phaseRadian  是弧度值,不过无所谓了  可以互相转换
                settings.Report.IncludePhaseAngle       = true;
                settings.Report.IncludeDopplerFrequency = true;
                settings.Report.IncludePeakRssi         = true;

                // Set the reader mode, search mode and session
                //settings.ReaderMode = ReaderMode.AutoSetDenseReader;
                settings.ReaderMode = ReaderMode.DenseReaderM8;
                settings.SearchMode = SearchMode.DualTarget;
                settings.Session    = 2;
                settings.TxFrequenciesInMhz.Clear();
                settings.TxFrequenciesInMhz.Add(924.375);

                Console.WriteLine("TxFrequency : {0}", "settings");


                // Enable antenna #1. Disable all others.
                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(5).IsEnabled  = true;
                settings.Antennas.GetAntenna(6).IsEnabled  = true;
                settings.Antennas.GetAntenna(7).IsEnabled  = true;
                settings.Antennas.GetAntenna(8).IsEnabled  = true;
                settings.Antennas.GetAntenna(9).IsEnabled  = true;
                settings.Antennas.GetAntenna(10).IsEnabled = true;
                settings.Antennas.GetAntenna(11).IsEnabled = true;
                settings.Antennas.GetAntenna(12).IsEnabled = true;
                settings.Antennas.GetAntenna(13).IsEnabled = true;
                settings.Antennas.GetAntenna(14).IsEnabled = true;
                settings.Antennas.GetAntenna(15).IsEnabled = true;
                settings.Antennas.GetAntenna(16).IsEnabled = true;
                settings.Antennas.GetAntenna(17).IsEnabled = true;
                settings.Antennas.GetAntenna(18).IsEnabled = true;
                settings.Antennas.GetAntenna(19).IsEnabled = true;
                settings.Antennas.GetAntenna(20).IsEnabled = true;
                settings.Antennas.GetAntenna(21).IsEnabled = true;
                settings.Antennas.GetAntenna(22).IsEnabled = true;
                settings.Antennas.GetAntenna(23).IsEnabled = true;
                settings.Antennas.GetAntenna(24).IsEnabled = true;
                settings.Antennas.GetAntenna(25).IsEnabled = true;
                settings.Antennas.GetAntenna(26).IsEnabled = true;
                settings.Antennas.GetAntenna(27).IsEnabled = true;
                settings.Antennas.GetAntenna(28).IsEnabled = true;
                settings.Antennas.GetAntenna(29).IsEnabled = true;
                settings.Antennas.GetAntenna(30).IsEnabled = true;
                settings.Antennas.GetAntenna(31).IsEnabled = true;
                settings.Antennas.GetAntenna(32).IsEnabled = true;


                // Set the Transmit Power and
                // Receive Sensitivity to the maximum.
                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;
                settings.Antennas.GetAntenna(5).MaxTxPower        = true;
                settings.Antennas.GetAntenna(5).MaxRxSensitivity  = true;
                settings.Antennas.GetAntenna(6).MaxTxPower        = true;
                settings.Antennas.GetAntenna(6).MaxRxSensitivity  = true;
                settings.Antennas.GetAntenna(7).MaxTxPower        = true;
                settings.Antennas.GetAntenna(7).MaxRxSensitivity  = true;
                settings.Antennas.GetAntenna(8).MaxTxPower        = true;
                settings.Antennas.GetAntenna(8).MaxRxSensitivity  = true;
                settings.Antennas.GetAntenna(9).MaxTxPower        = true;
                settings.Antennas.GetAntenna(9).MaxRxSensitivity  = true;
                settings.Antennas.GetAntenna(10).MaxTxPower       = true;
                settings.Antennas.GetAntenna(10).MaxRxSensitivity = true;
                settings.Antennas.GetAntenna(11).MaxTxPower       = true;
                settings.Antennas.GetAntenna(11).MaxRxSensitivity = true;
                settings.Antennas.GetAntenna(12).MaxTxPower       = true;
                settings.Antennas.GetAntenna(12).MaxRxSensitivity = true;
                settings.Antennas.GetAntenna(13).MaxTxPower       = true;
                settings.Antennas.GetAntenna(13).MaxRxSensitivity = true;
                settings.Antennas.GetAntenna(14).MaxTxPower       = true;
                settings.Antennas.GetAntenna(14).MaxRxSensitivity = true;
                settings.Antennas.GetAntenna(15).MaxTxPower       = true;
                settings.Antennas.GetAntenna(15).MaxRxSensitivity = true;
                settings.Antennas.GetAntenna(16).MaxTxPower       = true;
                settings.Antennas.GetAntenna(16).MaxRxSensitivity = true;
                settings.Antennas.GetAntenna(17).MaxTxPower       = true;
                settings.Antennas.GetAntenna(17).MaxRxSensitivity = true;
                settings.Antennas.GetAntenna(18).MaxTxPower       = true;
                settings.Antennas.GetAntenna(18).MaxRxSensitivity = true;
                settings.Antennas.GetAntenna(19).MaxTxPower       = true;
                settings.Antennas.GetAntenna(19).MaxRxSensitivity = true;
                settings.Antennas.GetAntenna(20).MaxTxPower       = true;
                settings.Antennas.GetAntenna(20).MaxRxSensitivity = true;
                settings.Antennas.GetAntenna(21).MaxTxPower       = true;
                settings.Antennas.GetAntenna(21).MaxRxSensitivity = true;
                settings.Antennas.GetAntenna(22).MaxTxPower       = true;
                settings.Antennas.GetAntenna(22).MaxRxSensitivity = true;
                settings.Antennas.GetAntenna(23).MaxTxPower       = true;
                settings.Antennas.GetAntenna(23).MaxRxSensitivity = true;
                settings.Antennas.GetAntenna(24).MaxTxPower       = true;
                settings.Antennas.GetAntenna(24).MaxRxSensitivity = true;
                settings.Antennas.GetAntenna(25).MaxTxPower       = true;
                settings.Antennas.GetAntenna(25).MaxRxSensitivity = true;
                settings.Antennas.GetAntenna(26).MaxTxPower       = true;
                settings.Antennas.GetAntenna(26).MaxRxSensitivity = true;
                settings.Antennas.GetAntenna(27).MaxTxPower       = true;
                settings.Antennas.GetAntenna(27).MaxRxSensitivity = true;
                settings.Antennas.GetAntenna(28).MaxTxPower       = true;
                settings.Antennas.GetAntenna(28).MaxRxSensitivity = true;
                settings.Antennas.GetAntenna(29).MaxTxPower       = true;
                settings.Antennas.GetAntenna(29).MaxRxSensitivity = true;
                settings.Antennas.GetAntenna(30).MaxTxPower       = true;
                settings.Antennas.GetAntenna(30).MaxRxSensitivity = true;
                settings.Antennas.GetAntenna(31).MaxTxPower       = true;
                settings.Antennas.GetAntenna(31).MaxRxSensitivity = true;
                settings.Antennas.GetAntenna(32).MaxTxPower       = true;
                settings.Antennas.GetAntenna(32).MaxRxSensitivity = true;

                // You can also set them to specific values like this...
                //settings.Antennas.GetAntenna(1).TxPowerInDbm = 20;
                //settings.Antennas.GetAntenna(1).RxSensitivityInDbm = -70;

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

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

                // Start reading.
                reader.Start();

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

                // Stop reading.
                reader.Stop();

                // Disconnect from the reader.
                reader.Disconnect();
            }
            catch (OctaneSdkException e)
            {
                // Handle Octane SDK errors.
                Console.WriteLine("Octane SDK exception: {0}", e.Message);
            }
            catch (Exception e)
            {
                // Handle other .NET errors.
                Console.WriteLine("Exception : {0}", e.Message);
            }
        }
コード例 #10
0
        private void button2_Click(object sender, EventArgs e)
        {
            try
            {
                reader.Connect("192.168.0.211");
                Settings   settings = reader.QueryDefaultSettings();
                FeatureSet features = reader.QueryFeatureSet();

                settings.Report.IncludeAntennaPortNumber = true;

                //settings.Report.Mode = ReportMode.WaitForQuery;
                settings.Report.Mode = ReportMode.Individual;
                //settings.Report.Mode = ReportMode.BatchAfterStop;

                settings.ReaderMode            = ReaderMode.MaxThroughput;
                settings.SearchMode            = SearchMode.DualTarget;
                settings.Session               = 1;
                settings.TagPopulationEstimate = 32;//设置预读数量

                //设置标签过滤器,只有符合过滤器的标签才能读取
                //settings.Filters.Mode = TagFilterMode.OnlyFilter1;
                //settings.Filters.TagFilter1.MemoryBank = MemoryBank.Epc;
                //settings.Filters.TagFilter1.BitPointer = 0x20;
                //settings.Filters.TagFilter1.TagMask = TagData.FromHexString("3008");


                //设置发送功率(分贝毫瓦)
                settings.Antennas.GetAntenna(1).TxPowerInDbm = 15;
                settings.Antennas.GetAntenna(2).TxPowerInDbm = 15;
                settings.Antennas.GetAntenna(3).TxPowerInDbm = 15;
                settings.Antennas.GetAntenna(4).TxPowerInDbm = 15;
                //设置接收功率(分贝毫瓦)
                //settings.Antennas.GetAntenna(1).RxSensitivityInDbm = 15;
                //settings.Antennas.GetAntenna(2).RxSensitivityInDbm = 15;
                //settings.Antennas.GetAntenna(3).RxSensitivityInDbm = 15;
                //settings.Antennas.GetAntenna(4).RxSensitivityInDbm = 15;

                //设置低负荷周期
                //LowDutyCycleSettings ldc = new LowDutyCycleSettings();
                //ldc.EmptyFieldTimeoutInMs = 500;
                //ldc.FieldPingIntervalInMs = 200;
                //ldc.IsEnabled = true;
                //settings.LowDutyCycle = ldc;

                //设置读取TID
                settings.Report.IncludeFastId = true;
                //设置读取标签信号
                settings.Report.IncludePeakRssi = true;

                //设置发送频率

                /*List<double> freqList = new List<double>();
                 * freqList.Add(865.7);
                 * freqList.Add(866.3);
                 * freqList.Add(866.9);
                 * freqList.Add(867.5);
                 * settings.TxFrequenciesInMhz = freqList;*/
                reader.ApplySettings(settings);//应用设置
                reader.TagsReported += OnTagsReported;

                reader.Start();
                button2.Enabled = false;
            }
            catch (Exception ex)
            {
                LogHelper.WriteLog("通道门读取产品信息失败", ex);
            }
        }
コード例 #11
0
        static void Main(string[] args)
        {
            try
            {
                System.Console.WriteLine("Before------------!!!");
                initDataRow();
                InitTagsEPC();

                // Connect to the reader.
                // Change the ReaderHostname constant in SolutionConstants.cs
                // to the IP address or hostname of your reader.
                System.Console.WriteLine("Before Connect!!!");
                reader.Connect(SolutionConstants.ReaderHostname);
                System.Console.WriteLine("Connect!!!");
                // 获取当前默认设置
                // Get the reader features to determine if the
                // reader supports a fixed-frequency table.
                FeatureSet features = reader.QueryFeatureSet();

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

                // Use antenna #2

                settings.Antennas.DisableAll();
                settings.Antennas.GetAntenna(1).IsEnabled = true;
                settings.Antennas.GetAntenna(2).IsEnabled = true;
                //settings.Antennas.EnableAll();
                //for (double i = 10; i < 32; i = i + 0.25)
                //{
                SpecifiedTx = 30;
                settings.Antennas.GetAntenna(1).TxPowerInDbm = SpecifiedTx;


                //settings.Antennas.GetAntenna(1).RxSensitivityInDbm = -55;
                //settings.Antennas.GetAntenna(2).TxPowerInDbm = 32;
                // settings.Antennas.GetAntenna(2).RxSensitivityInDbm = -55;


                //settings.ReaderMode = ReaderMode.AutoSetDenseReader;
                settings.SearchMode = SearchMode.DualTarget;
                settings.Session    = 2;
                // ReaderMode must be set to DenseReaderM4 or DenseReaderM8.
                settings.ReaderMode = ReaderMode.MaxThroughput;//编码方式
                System.Console.WriteLine("1!");
                // 每读取一个tag就report
                // Send a tag report for every tag read.
                settings.Report.Mode = ReportMode.Individual;

                filterTags(settings);
                // System.Console.WriteLine("4!");
                if (0 != fixFrequency(features, settings))
                {
                    applicactionClose();
                }

                // Apply the newly modified settings.
                System.Console.WriteLine("3!");
                reader.ApplySettings(settings);
                System.Console.WriteLine("5!");
                // Assign the TagsReported event handler.
                // This specifies which method to call
                // when tags reports are available.
                reader.TagsReported += OnTagsReported;
                //reader.TagsReported += OnTagsReported2;//Original EventHandler
                // Read with fix tx power
                singleRead();
                //singleRead2();//Original singleReader

                // multiple tx power read
                // txPowerRead(features, settings);
            }
            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);
            }
        }
コード例 #12
0
ファイル: RfidTool.cs プロジェクト: Nydxy/rftool
        /// <summary>
        /// 获取阅读器信息
        /// </summary>
        /// <param name="address"></param>
        /// <returns></returns>
        public static int GetReaderInfo(string address)
        {
            try
            {
                var reader = new ImpinjReader();
                reader.Connect(address);

                // Query the reader features and print the results.
                Console.WriteLine("Reader Features");
                Console.WriteLine("---------------");
                FeatureSet features = reader.QueryFeatureSet();
                Console.WriteLine("Model name : {0}", features.ModelName);
                Console.WriteLine("Model number : {0}", features.ModelNumber);
                Console.WriteLine("Reader model : {0}", features.ReaderModel.ToString());
                Console.WriteLine("Firmware version : {0}", features.FirmwareVersion);
                Console.WriteLine("Antenna count : {0}\n", features.AntennaCount);

                // Query the current reader status.
                Console.WriteLine("Reader Status");
                Console.WriteLine("---------------");
                Status status = reader.QueryStatus();
                Console.WriteLine("Is connected : {0}", status.IsConnected);
                Console.WriteLine("Is singulating : {0}", status.IsSingulating);
                Console.WriteLine("Temperature : {0}° C\n", status.TemperatureInCelsius);

                // Query the current reader settings and print the results.
                Console.WriteLine("Reader Settings");
                Console.WriteLine("---------------");

                Settings settings = reader.QueryDefaultSettings();
                Console.WriteLine("Reader mode : {0}", settings.ReaderMode);
                Console.WriteLine("Search mode : {0}", settings.SearchMode);
                Console.WriteLine("Session : {0}", settings.Session);

                if (settings.Antennas.GetAntenna(1).MaxRxSensitivity)
                {
                    Console.WriteLine("Rx sensitivity (Antenna 1) : Max");
                }
                else
                {
                    Console.WriteLine("Rx sensitivity (Antenna 1) : {0} dBm",
                                      settings.Antennas.GetAntenna(1).RxSensitivityInDbm);
                }

                if (settings.Antennas.GetAntenna(1).MaxTxPower)
                {
                    Console.WriteLine("Tx power (Antenna 1) : Max");
                }
                else
                {
                    Console.WriteLine("Tx power (Antenna 1) : {0} dBm",
                                      settings.Antennas.GetAntenna(1).TxPowerInDbm);
                }

                Console.WriteLine("");
                return(0);
            }
            catch (OctaneSdkException e)
            {
                // Handle Octane SDK errors.
                Console.WriteLine("Octane SDK exception: {0}", e.Message);
                return(1);
            }
            catch (Exception e)
            {
                // Handle other .NET errors.
                Console.WriteLine("Exception : {0}", e.Message);
                return(1);
            }
        }
コード例 #13
0
ファイル: RfidTool.cs プロジェクト: Nydxy/rftool
        /// <summary>
        /// 获得阅读器信息
        /// </summary>
        /// <returns></returns>
        public RfidReaderInfo GetReaderInfo()
        {
            try
            {
                if (!reader.IsConnected)
                {
                    RedirectStandardOut.Invoke("Connecting to reader...");
                    reader.Connect(option.HostName);
                    RedirectStandardOut.Invoke("Connection established.");
                    RedirectStandardOut.Invoke("");
                }

                RfidReaderInfo result = new RfidReaderInfo();

                // Query the reader features and print the results.
                RedirectStandardOut.Invoke("Reader Features");
                RedirectStandardOut.Invoke("---------------");
                FeatureSet features = reader.QueryFeatureSet();
                RedirectStandardOut.Invoke($"Model name : {features.ModelName}");
                result.ModelName = features.ModelName;
                RedirectStandardOut.Invoke($"Model number : {features.ModelNumber}");
                result.ModelNumber = features.ModelNumber.ToString();
                RedirectStandardOut.Invoke($"Reader model : {features.ReaderModel.ToString()}");
                result.ReaderModel = features.ReaderModel.ToString();
                RedirectStandardOut.Invoke($"Firmware version : {features.FirmwareVersion}");
                result.FirmwareVersion = features.FirmwareVersion;
                RedirectStandardOut.Invoke($"Antenna count : {features.AntennaCount}\n");
                result.AntennaCount = features.AntennaCount;

                // Query the current reader status.
                RedirectStandardOut.Invoke("Reader Status");
                RedirectStandardOut.Invoke("---------------");
                Status status = reader.QueryStatus();
                RedirectStandardOut.Invoke($"Is connected : {status.IsConnected}");
                result.IsConnected = status.IsConnected;
                RedirectStandardOut.Invoke($"Is singulating : {status.IsSingulating}");
                RedirectStandardOut.Invoke($"Temperature : {status.TemperatureInCelsius}° C\n");

                // Query the current reader settings and print the results.
                RedirectStandardOut.Invoke("Reader Settings");
                RedirectStandardOut.Invoke("---------------");

                Settings settings = reader.QueryDefaultSettings();
                RedirectStandardOut.Invoke($"Reader mode : {settings.ReaderMode}");
                RedirectStandardOut.Invoke($"Search mode : {settings.SearchMode}");
                RedirectStandardOut.Invoke($"Session : {settings.Session}");


                for (ushort i = 1; i <= features.AntennaCount; i++)
                {
                    RedirectStandardOut.Invoke($"[Antenna {i.ToString()}]");
                    if (settings.Antennas.GetAntenna(i).MaxRxSensitivity)
                    {
                        RedirectStandardOut.Invoke("Rx sensitivity : Max");
                    }
                    else
                    {
                        RedirectStandardOut.Invoke($"Rx sensitivity : {settings.Antennas.GetAntenna(i).RxSensitivityInDbm} dBm");
                    }

                    if (settings.Antennas.GetAntenna(i).MaxTxPower)
                    {
                        RedirectStandardOut.Invoke("Tx power : Max");
                    }
                    else
                    {
                        RedirectStandardOut.Invoke($"Tx power : {settings.Antennas.GetAntenna(i).TxPowerInDbm} dBm");
                    }

                    RedirectStandardOut.Invoke("");
                }

                return(result);
            }
            catch (OctaneSdkException e)
            {
                // Handle Octane SDK errors.
                RedirectStandardOut.Invoke($"Octane SDK exception: {e.Message}");
                return(null);
            }
            catch (Exception e)
            {
                // Handle other .NET errors.
                RedirectStandardOut.Invoke($"Exception : {e.Message}");
                return(null);
            }
        }
コード例 #14
0
ファイル: Program.cs プロジェクト: KennethLui/TG2
        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 reader features to determine if the
                // reader supports a fixed-frequency table.
                FeatureSet features = reader.QueryFeatureSet();

                if (!features.IsHoppingRegion)
                {
                    // 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;

                    // Specify the transmit frequencies to use.
                    // Make sure your reader supports this and
                    // that the frequencies are valid for your region.
                    // The following example is for ETSI (Europe)
                    // readers.
                    settings.TxFrequenciesInMhz.Add(865.7);
                    settings.TxFrequenciesInMhz.Add(866.3);
                    settings.TxFrequenciesInMhz.Add(866.9);
                    settings.TxFrequenciesInMhz.Add(867.5);

                    // 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();
                }
                else
                {
                    Console.WriteLine("This reader does not allow the transmit frequencies to be specified.");
                }

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