Ejemplo n.º 1
0
        private void btnOpen_Click(object sender, EventArgs e)
        {
            #region codes ========================================
            Result nRet = Result.FAILURE;

            if (!m_bOpen)
            {
                nRet = R1000Reader.RFIDOpen(0);
                if (nRet != Result.OK)
                {
                    ErrorMessage(nRet, 0, String.Empty);
                    return;
                }

                //set anntena parameter for best Inventory
                AntennaPortConfig pConfig = new AntennaPortConfig();
                R1000Reader.RFIDGetAntennaPortConfiguration(0, ref pConfig);
                //pConfig.powerLevel = 280;
                //pConfig.dwellTime = 300;
                //pConfig.numberInventoryCycles = 8192;
                //R1000Reader.RFIDSetAntennaPortConfiguration(0, ref pConfig);

                //For speed up block write below settings are necessary.
                //FIXEDQ_PARMS FixedParms = new FIXEDQ_PARMS();
                //FixedParms.qValue = 0;
                //FixedParms.retryCount = 0;
                //FixedParms.toggleTarget = 0;
                //FixedParms.repeatUntilNoTags = 0;

                //SINGULATION_ALGORITHM_PARMS AlgParms = (SINGULATION_ALGORITHM_PARMS)FixedParms;

                //R1000Reader.RFIDSingulationAlgorithmParameters(SingulationAlgorithm.FIXEDQ, ref AlgParms, true);

                //SingulationAlgorithm nAlgorithm = SingulationAlgorithm.FIXEDQ;
                //R1000Reader.RFIDSingulationAlgorithm(ref nAlgorithm, true);

                btnOpen.Text = "Close";
                m_bOpen      = true;

                ErrorMessage(0, 0, "Ready");
            }//end if (!m_bOpen)
            else
            {
                R1000Reader.RFIDClose(0);
                btnOpen.Text = "Open";
                m_bOpen      = false;
                ErrorMessage(0, 0, "Close");
            }
            #endregion //end codes
        }
Ejemplo n.º 2
0
        private void btnRefresh_Click(object sender, EventArgs e)
        {
            #region codes ========================================
            if (m_bOpen)
            {
                //Response Mode
                ResponseMode responseMode = ResponseMode.UNKNOWN;
                R1000Reader.RFIDGetResponseMode(ref responseMode);
                if (responseMode == ResponseMode.COMPACT)
                {
                    cmbResponseMode.SelectedIndex = 0;
                }
                else
                {
                    cmbResponseMode.SelectedIndex = 1;
                }

                //Operation Mode
                RadioOperationMode operationMode = RadioOperationMode.UNKNOWN;
                operationMode = R1000Reader.RFIDGetOperationMode();
                if (operationMode == RadioOperationMode.CONTINUOUS)
                {
                    cmbOperationMode.SelectedIndex = 0;
                    m_bContinue = true;
                }
                else
                {
                    cmbOperationMode.SelectedIndex = 1;
                    m_bContinue = false;
                }

                //tag stop count
                numTagStopCount.Value = R1000Reader.RFIDGetStopCount();

                AntennaPortConfig antPortConfig = new AntennaPortConfig();
                R1000Reader.RFIDGetAntennaPortConfiguration(0, ref antPortConfig);
                txtdwelltime.Text   = antPortConfig.dwellTime.ToString();
                txtInvRounds.Text   = antPortConfig.numberInventoryCycles.ToString();
                traPowerLevel.Value = (int)antPortConfig.powerLevel / 10;
                lbldBm.Text         = traPowerLevel.Value.ToString() + "dBm";

                ErrorMessage(0, 0, "Config Refreshed");
            }
            #endregion //end codes
        }
Ejemplo n.º 3
0
        private void btnSet_Click(object sender, EventArgs e)
        {
            #region codes ========================================
            Result nRet = Result.FAILURE;

            AntennaPortConfig antPortConfig = new AntennaPortConfig();
            nRet = R1000Reader.RFIDGetAntennaPortConfiguration(0, ref antPortConfig);
            if (nRet != Result.OK)
            {
                ErrorMessage(0, 0, "Get Antenna Config Failure");
                return;
            }

            antPortConfig.dwellTime             = Convert.ToUInt32(txtdwelltime.Text);
            antPortConfig.numberInventoryCycles = Convert.ToUInt32(txtInvRounds.Text);
            antPortConfig.physicalRxPort        = 3;
            antPortConfig.physicalTxPort        = 3;
            antPortConfig.powerLevel            = (UInt32)traPowerLevel.Value * 10;

            nRet = R1000Reader.RFIDSetAntennaPortState(0, AntennaPortState.ENABLED);
            if (nRet != Result.OK)
            {
                ErrorMessage(0, 0, "Set Antenna Port State Failure");
                return;
            }

            nRet = R1000Reader.RFIDSetAntennaPortConfiguration(0, ref antPortConfig);
            if (nRet != Result.OK)
            {
                ErrorMessage(0, 0, "Set Antenna Config Failure");
            }
            else
            {
                ErrorMessage(0, 0, "Set Config OK");
            }
            #endregion //end codes
        }