Ejemplo n.º 1
0
        public static PARAM_C1G2InventoryCommand CreateInventoryCommand(int Q)
        {
            // Create the Inventory Command and RF Control parameters
            PARAM_C1G2InventoryCommand c1g2Inv = new PARAM_C1G2InventoryCommand();



            // Set the session.
            PARAM_C1G2SingulationControl c1g2Sing = new PARAM_C1G2SingulationControl();

            c1g2Sing.Session               = new TwoBits(1);
            c1g2Sing.TagPopulation         = (ushort)Math.Pow(2, Q);
            c1g2Sing.TagTransitTime        = 0;
            c1g2Inv.C1G2SingulationControl = c1g2Sing;
            c1g2Inv.TagInventoryStateAware = false;

            // Set the search mode.
            PARAM_ImpinjInventorySearchMode impISM = new PARAM_ImpinjInventorySearchMode();

            impISM.InventorySearchMode = ENUM_ImpinjInventorySearchType.Dual_Target;
            c1g2Inv.Custom.Add(impISM);
            return(c1g2Inv);
        }
Ejemplo n.º 2
0
        public static PARAM_C1G2InventoryCommand CreateInventoryCommand(ushort pos, String mask, int truncate, int MB)
        {
            // Create the Inventory Command and RF Control parameters
            PARAM_C1G2InventoryCommand c1g2Inv = new PARAM_C1G2InventoryCommand();


            // Setup the tag filter
            c1g2Inv.C1G2Filter = new PARAM_C1G2Filter[1];

            c1g2Inv.C1G2Filter[0] = new PARAM_C1G2Filter();
            c1g2Inv.C1G2Filter[0].C1G2TagInventoryMask = new PARAM_C1G2TagInventoryMask();
            // Filter on EPC (memory bank #1)
            c1g2Inv.C1G2Filter[0].C1G2TagInventoryMask.MB = new TwoBits((ushort)MB);
            // Start filtering at the address 0x20 (the start of the third word).
            // The first two words of the EPC are the checksum and Protocol Control bits.
            //E20030093116008216007210
            //c1g2Inv.C1G2Filter[0].C1G2TagInventoryMask.Pointer = (ushort)(0x20 + 4 * pos);

            //c1g2Inv.C1G2Filter[0].C1G2TagInventoryMask.Pointer = (ushort)(0x00 + 4 * pos);
            //c1g2Inv.C1G2Filter[0].C1G2TagInventoryMask.TagMask = LLRPBitArray.FromHexString(mask);

            c1g2Inv.C1G2Filter[0].C1G2TagInventoryMask.Pointer = (ushort)(0x20 + pos);
            c1g2Inv.C1G2Filter[0].C1G2TagInventoryMask.TagMask = LLRPBitArray.FromBinString(mask);
            c1g2Inv.C1G2Filter[0].T        = (ENUM_C1G2TruncateAction)truncate;
            c1g2Inv.TagInventoryStateAware = false;
            c1g2Inv.C1G2Filter[0].C1G2TagInventoryStateAwareFilterAction        = new PARAM_C1G2TagInventoryStateAwareFilterAction();
            c1g2Inv.C1G2Filter[0].C1G2TagInventoryStateAwareFilterAction.Action = ENUM_C1G2StateAwareAction.DeassertSLOrB_AssertSLOrA;
            c1g2Inv.C1G2Filter[0].C1G2TagInventoryStateAwareFilterAction.Target = ENUM_C1G2StateAwareTarget.SL;



            /* c1g2Inv.C1G2Filter[1] = new PARAM_C1G2Filter();
             * c1g2Inv.C1G2Filter[1].C1G2TagInventoryMask = new PARAM_C1G2TagInventoryMask();
             * // Filter on EPC (memory bank #1)
             * c1g2Inv.C1G2Filter[1].C1G2TagInventoryMask.MB = new TwoBits(1);
             * // Start filtering at the address 0x20 (the start of the third word).
             * // The first two words of the EPC are the checksum and Protocol Control bits.
             * //E20030093116008216007210
             * c1g2Inv.C1G2Filter[1].C1G2TagInventoryMask.Pointer = (ushort)(0x20 + 4 * 0);
             * c1g2Inv.C1G2Filter[1].C1G2TagInventoryMask.TagMask = LLRPBitArray.FromHexString("D");
             * c1g2Inv.C1G2Filter[1].T = (ENUM_C1G2TruncateAction)truncate;
             * c1g2Inv.TagInventoryStateAware = true;
             * //c1g2Inv.C1G2Filter[1].C1G2TagInventoryStateAwareFilterAction = new PARAM_C1G2TagInventoryStateAwareFilterAction();
             * //c1g2Inv.C1G2Filter[1].C1G2TagInventoryStateAwareFilterAction.Action = ENUM_C1G2StateAwareAction.DeassertSLOrB_AssertSLOrA;
             * //c1g2Inv.C1G2Filter[1].C1G2TagInventoryStateAwareFilterAction.Target = ENUM_C1G2StateAwareTarget.SL;
             */
            // Set the session.
            PARAM_C1G2SingulationControl c1g2Sing = new PARAM_C1G2SingulationControl();

            c1g2Sing.Session        = new TwoBits(1);
            c1g2Sing.TagPopulation  = 64;
            c1g2Sing.TagTransitTime = 0;
            c1g2Sing.C1G2TagInventoryStateAwareSingulationAction = new PARAM_C1G2TagInventoryStateAwareSingulationAction();
            //c1g2Sing.C1G2TagInventoryStateAwareSingulationAction.I = ENUM_C1G2TagInventoryStateAwareI.State_A;
            //c1g2Sing.C1G2TagInventoryStateAwareSingulationAction.S = ENUM_C1G2TagInventoryStateAwareS.SL;

            c1g2Inv.C1G2SingulationControl = c1g2Sing;


            // Set the search mode.
            PARAM_ImpinjInventorySearchMode impISM = new PARAM_ImpinjInventorySearchMode();

            impISM.InventorySearchMode = ENUM_ImpinjInventorySearchType.Dual_Target;
            c1g2Inv.Custom.Add(impISM);
            return(c1g2Inv);
        }
Ejemplo n.º 3
0
        private void Set_Reader_Config()
        {
            try
            {
                MSG_SET_READER_CONFIG msg = new MSG_SET_READER_CONFIG();

                msg.AccessReportSpec = new PARAM_AccessReportSpec();
                msg.AccessReportSpec.AccessReportTrigger = ENUM_AccessReportTriggerType.End_Of_AccessSpec;

                PARAM_C1G2InventoryCommand cmd = new PARAM_C1G2InventoryCommand();
                cmd.C1G2RFControl = new PARAM_C1G2RFControl();

                cmd.C1G2RFControl.ModeIndex = 1000;

                // 1000 = AD - Auto Dense Interrogator
                // 1001 = AS - Auto Single Interrogator
                //    0 = 0 - High Speed 640k bps
                //    1 = 1 - Hybrid 80k/160k bps
                //    2 = 2 - Dense Reader M=4 HiSpd
                //    3 = 3 - Dense Reader M=8 LoSpd
                //    4 = 4 - Dense Reader MaxMiller
                cmd.C1G2RFControl.Tari = 0;
                cmd.C1G2SingulationControl = new PARAM_C1G2SingulationControl();
                cmd.C1G2SingulationControl.Session = new TwoBits(1);
                cmd.C1G2SingulationControl.TagPopulation = 32;

                cmd.C1G2SingulationControl.Session.Equals(1);

                cmd.C1G2SingulationControl.TagTransitTime = 0;
                cmd.TagInventoryStateAware = false;
                PARAM_ImpinjInventorySearchMode search_mode = new PARAM_ImpinjInventorySearchMode();

                search_mode.InventorySearchMode = ENUM_ImpinjInventorySearchType.Dual_Target;

                //search_mode.InventorySearchMode = ENUM_ImpinjInventorySearchType.Dual_Target;
                cmd.AddCustomParameter(search_mode);

                //msg.AntennaConfiguration[0].AntennaID = 0;  // 0 = all 4 antennas

                //msg.AntennaConfiguration = new PARAM_AntennaConfiguration[1];
                /*
                if (cbAnt1.Checked == true)
                {
                    msg.AntennaConfiguration[0].AntennaID = 1;
                }

                if (cbAnt2.Checked == true)
                {
                    msg.AntennaConfiguration[0].AntennaID = 2;
                }

                if (cbAnt3.Checked == true)
                {
                    msg.AntennaConfiguration[0].AntennaID = 3;
                }

                if (cbAnt4.Checked == true)
                {
                    msg.AntennaConfiguration[0].AntennaID = 4;
                }
               */
                msg.AntennaConfiguration = new PARAM_AntennaConfiguration[0];
                msg.AntennaConfiguration[0].AntennaID = 0;
                //
                msg.AntennaConfiguration[0] = new PARAM_AntennaConfiguration();
                msg.AntennaConfiguration[0].AirProtocolInventoryCommandSettings = new UNION_AirProtocolInventoryCommandSettings();
                //msg.AntennaConfiguration[0] = new PARAM_AntennaConfiguration();

                msg.AntennaConfiguration[0].AirProtocolInventoryCommandSettings = new UNION_AirProtocolInventoryCommandSettings();
                msg.AntennaConfiguration[0].AirProtocolInventoryCommandSettings.Add(cmd);
                msg.AntennaConfiguration[0].RFReceiver = new PARAM_RFReceiver();
                msg.AntennaConfiguration[0].RFReceiver.ReceiverSensitivity = 1;// (ushort)tbReaderSensitivity.Value;
                // 1 = max, 2 = -70, 3 = -69, 4 = -68, 5 = -67...
                msg.AntennaConfiguration[0].RFTransmitter = new PARAM_RFTransmitter();
                msg.AntennaConfiguration[0].RFTransmitter.ChannelIndex = 1;
                msg.AntennaConfiguration[0].RFTransmitter.HopTableID = 1;
                msg.AntennaConfiguration[0].RFTransmitter.TransmitPower = 30;//(ushort)tbTxPower.Value;

                //###########################################################################################
                //###########################################################################################
                //###########################################################################################
                // made change so Matho could test channel index values for Japanese readers
                //ushort i;
                //i = ushort.Parse(tbChannelIndex.Text);
                //msg.AntennaConfiguration[0].RFTransmitter.ChannelIndex = i;
                //MessageBox.Show("Channel Index = " + i.ToString());
                // made change so Matho could test channel index values for Japanese readers
                //###########################################################################################
                //###########################################################################################
                //###########################################################################################

                //////if you want to set antenana property. un-comment following code. Impinj reader does not support
                //msg.AntennaProperties = new PARAM_AntennaProperties[1];
                //msg.AntennaProperties[0] = new PARAM_AntennaProperties();
                //msg.AntennaProperties[0].AntennaConnected = true;
                //msg.AntennaProperties[0].AntennaGain = 0;
                //msg.AntennaProperties[0].AntennaID = 0;
                //////If you want to enable fixed frequency feature. un-comment following code.
                //PARAM_ImpinjFixedFrequencyList fix_list = new PARAM_ImpinjFixedFrequencyList();
                //fix_list.FixedFrequencyMode = ENUM_FixedFrequencyMode.Disabled;
                //cmd.AddCustomParameter(fix_list);
                //////If you want to enable reduced power list, un-comment following code and add channels
                //PARAM_ImpinjReducedPowerFrequencyList power_list = new PARAM_ImpinjReducedPowerFrequencyList();
                //power_list.ReducedPowerMode = ENUM_ImpinjReducedPowerMode.Enabled;
                //power_list.ChannelList.Add(chanellist);
                //cmd.AddCustomParameter(power_list);
                //////If you want to enable low duty cycle, un-comment following code
                //PARAM_ImpinjLowDutyCycle lowDuty = new PARAM_ImpinjLowDutyCycle();
                //lowDuty.LowDutyCycleMode =  ENUM_ImpinjLowDutyCycleMode.Disabled;
                //lowDuty.EmptyFieldTimeout = 0;
                //lowDuty.FieldPingInterval = 0;
                //cmd.AddCustomParameter(lowDuty);
                //////If you want to select reader events to send to application, change the following code
                //msg.EventsAndReports = new PARAM_EventsAndReports();
                //msg.EventsAndReports.HoldEventsAndReportsUponReconnect = false;
                //msg.KeepaliveSpec = new PARAM_KeepaliveSpec();
                //msg.KeepaliveSpec.KeepaliveTriggerType = ENUM_KeepaliveTriggerType.Null;
                //msg.KeepaliveSpec.PeriodicTriggerValue = 0;
                msg.ReaderEventNotificationSpec = new PARAM_ReaderEventNotificationSpec();
                msg.ReaderEventNotificationSpec.EventNotificationState = new PARAM_EventNotificationState[7];
                msg.ReaderEventNotificationSpec.EventNotificationState[0] = new PARAM_EventNotificationState();
                msg.ReaderEventNotificationSpec.EventNotificationState[0].EventType = ENUM_NotificationEventType.AISpec_Event;
                msg.ReaderEventNotificationSpec.EventNotificationState[0].NotificationState = false;

                msg.ReaderEventNotificationSpec.EventNotificationState[1] = new PARAM_EventNotificationState();
                msg.ReaderEventNotificationSpec.EventNotificationState[1].EventType = ENUM_NotificationEventType.Antenna_Event;
                msg.ReaderEventNotificationSpec.EventNotificationState[1].NotificationState = false;

                msg.ReaderEventNotificationSpec.EventNotificationState[2] = new PARAM_EventNotificationState();
                msg.ReaderEventNotificationSpec.EventNotificationState[2].EventType = ENUM_NotificationEventType.GPI_Event;
                msg.ReaderEventNotificationSpec.EventNotificationState[2].NotificationState = false;

                msg.ReaderEventNotificationSpec.EventNotificationState[3] = new PARAM_EventNotificationState();
                msg.ReaderEventNotificationSpec.EventNotificationState[3].EventType = ENUM_NotificationEventType.Reader_Exception_Event;
                msg.ReaderEventNotificationSpec.EventNotificationState[3].NotificationState = false;

                msg.ReaderEventNotificationSpec.EventNotificationState[4] = new PARAM_EventNotificationState();
                msg.ReaderEventNotificationSpec.EventNotificationState[4].EventType = ENUM_NotificationEventType.Upon_Hopping_To_Next_Channel;
                msg.ReaderEventNotificationSpec.EventNotificationState[4].NotificationState = false;

                msg.ReaderEventNotificationSpec.EventNotificationState[5] = new PARAM_EventNotificationState();
                msg.ReaderEventNotificationSpec.EventNotificationState[5].EventType = ENUM_NotificationEventType.ROSpec_Event;
                msg.ReaderEventNotificationSpec.EventNotificationState[5].NotificationState = false;

                msg.ReaderEventNotificationSpec.EventNotificationState[6] = new PARAM_EventNotificationState();
                msg.ReaderEventNotificationSpec.EventNotificationState[6].EventType = ENUM_NotificationEventType.Report_Buffer_Fill_Warning;
                msg.ReaderEventNotificationSpec.EventNotificationState[6].NotificationState = false;

                msg.ROReportSpec = new PARAM_ROReportSpec();
                msg.ROReportSpec.N = 1;
                msg.ROReportSpec.ROReportTrigger = ENUM_ROReportTriggerType.Upon_N_Tags_Or_End_Of_ROSpec;

                msg.ROReportSpec.TagReportContentSelector = new PARAM_TagReportContentSelector();

                msg.ROReportSpec.TagReportContentSelector.AirProtocolEPCMemorySelector = new UNION_AirProtocolEPCMemorySelector();
                PARAM_C1G2EPCMemorySelector c1g2mem = new PARAM_C1G2EPCMemorySelector();
                c1g2mem.EnableCRC = false;
                c1g2mem.EnablePCBits = false;
                msg.ROReportSpec.TagReportContentSelector.AirProtocolEPCMemorySelector.Add(c1g2mem);

                msg.ROReportSpec.TagReportContentSelector.EnableAccessSpecID = false;
                msg.ROReportSpec.TagReportContentSelector.EnableAntennaID = false;
                msg.ROReportSpec.TagReportContentSelector.EnableChannelIndex = false;
                msg.ROReportSpec.TagReportContentSelector.EnableFirstSeenTimestamp = true;
                msg.ROReportSpec.TagReportContentSelector.EnableInventoryParameterSpecID = false;
                msg.ROReportSpec.TagReportContentSelector.EnableLastSeenTimestamp = false;
                msg.ROReportSpec.TagReportContentSelector.EnablePeakRSSI = true;
                msg.ROReportSpec.TagReportContentSelector.EnableROSpecID = false;
                msg.ROReportSpec.TagReportContentSelector.EnableSpecIndex = false;
                msg.ROReportSpec.TagReportContentSelector.EnableTagSeenCount = false;

                /////If you want to enable GPIO function, un-comment following code.

                //msg.GPIPortCurrentState = new PARAM_GPIPortCurrentState[1];
                //msg.GPIPortCurrentState[0] = new PARAM_GPIPortCurrentState();
                //msg.GPIPortCurrentState[0].Config = true;
                //msg.GPIPortCurrentState[0].GPIPortNum = 2;
                //msg.GPIPortCurrentState[0].State = ENUM_GPIPortState.Low;

                //msg.GPOWriteData = new PARAM_GPOWriteData[1];
                //msg.GPOWriteData[0] = new PARAM_GPOWriteData();
                //msg.GPOWriteData[0].GPOData = true;
                //msg.GPOWriteData[0].GPOPortNumber = 1;

                //////If you want to use tag direction function, un-comment following code

                //PARAM_ImpinjTagDirectionReporting imp_tag_reporting = new PARAM_ImpinjTagDirectionReporting();

                //imp_tag_reporting.AntennaConfiguration = ENUM_ImpinjTagDirectionAntennaConfiguration.Dual_Antenna;
                //imp_tag_reporting.EnableTagDirection = true;
                //msg.ROReportSpec.AddCustomParameter(imp_tag_reporting);

                /////If you want to set sub-region, un-comment following code

                //PARAM_ImpinjSubRegulatoryRegion sub_region = new PARAM_ImpinjSubRegulatoryRegion();
                //sub_region.RegulatoryRegion = ENUM_ImpinjRegulatoryRegion.FCC_Part_15_247;
                //msg.AddCustomParameter(sub_region);

                //msg.ResetToFactoryDefault = false;

                MSG_SET_READER_CONFIG_RESPONSE rsp = reader.SET_READER_CONFIG(msg, out msg_err, 2121);

            }
            catch (Exception ex)
            {
                //MessageBox.Show(ex.ToString());
            }
        }
Ejemplo n.º 4
0
        private void Set_Reader_Config()
        {
            MSG_SET_READER_CONFIG msg = new MSG_SET_READER_CONFIG();
            //msg.AccessReportSpec = new PARAM_AccessReportSpec();
            //msg.AccessReportSpec.AccessReportTrigger = ENUM_AccessReportTriggerType.End_Of_AccessSpec;

            PARAM_C1G2InventoryCommand cmd = new PARAM_C1G2InventoryCommand();

            cmd.C1G2RFControl                         = new PARAM_C1G2RFControl();
            cmd.C1G2RFControl.ModeIndex               = 2;
            cmd.C1G2RFControl.Tari                    = 0;
            cmd.C1G2SingulationControl                = new PARAM_C1G2SingulationControl();
            cmd.C1G2SingulationControl.Session        = new TwoBits(1);
            cmd.C1G2SingulationControl.TagPopulation  = 0;
            cmd.C1G2SingulationControl.TagTransitTime = 1000;
            cmd.TagInventoryStateAware                = false;

            PARAM_ImpinjInventorySearchMode search_mode = new PARAM_ImpinjInventorySearchMode();

            search_mode.InventorySearchMode = ENUM_ImpinjInventorySearchType.Dual_Target;
            cmd.AddCustomParameter(search_mode);

            msg.AntennaConfiguration    = new PARAM_AntennaConfiguration[1];
            msg.AntennaConfiguration[0] = new PARAM_AntennaConfiguration();
            msg.AntennaConfiguration[0].AirProtocolInventoryCommandSettings = new UNION_AirProtocolInventoryCommandSettings();

            msg.AntennaConfiguration[0].AirProtocolInventoryCommandSettings.Add(cmd);
            msg.AntennaConfiguration[0].AntennaID = 0;

            msg.AntennaConfiguration[0].RFReceiver = new PARAM_RFReceiver();
            msg.AntennaConfiguration[0].RFReceiver.ReceiverSensitivity = 12;

            msg.AntennaConfiguration[0].RFTransmitter = new PARAM_RFTransmitter();
            msg.AntennaConfiguration[0].RFTransmitter.ChannelIndex  = 1;
            msg.AntennaConfiguration[0].RFTransmitter.HopTableID    = 1;
            msg.AntennaConfiguration[0].RFTransmitter.TransmitPower = 61;

            ////msg.AntennaProperties = new PARAM_AntennaProperties[1];
            ////msg.AntennaProperties[0] = new PARAM_AntennaProperties();
            ////msg.AntennaProperties[0].AntennaConnected = true;
            ////msg.AntennaProperties[0].AntennaGain = 0;
            ////msg.AntennaProperties[0].AntennaID = 1;



            //PARAM_ImpinjFixedFrequencyList fix_list = new PARAM_ImpinjFixedFrequencyList();
            //fix_list.FixedFrequencyMode = ENUM_FixedFrequencyMode.Disabled;
            //cmd.AddCustomParameter(fix_list);

            //PARAM_ImpinjPresetPowerFrequencyList power_list = new PARAM_ImpinjPresetPowerFrequencyList();
            //power_list.PresetPowerMode = ENUM_PresetPowerMode.Disabled;
            //power_list.Reserved = 0;
            //cmd.AddCustomParameter(power_list);

            //PARAM_ImpinjLowDutyCycle lowDuty = new PARAM_ImpinjLowDutyCycle();
            //lowDuty.LowDutyCycleMode = ENUM_LowDutyCycleMode.Disabled;
            //lowDuty.EmptyFieldTimeout = 0;
            //lowDuty.FieldPingInterval = 0;
            //cmd.AddCustomParameter(lowDuty);

            //msg.EventsAndReports = new PARAM_EventsAndReports();
            //msg.EventsAndReports.HoldEventsAndReportsUponReconnect = false;

            //msg.KeepaliveSpec = new PARAM_KeepaliveSpec();
            //msg.KeepaliveSpec.KeepaliveTriggerType = ENUM_KeepaliveTriggerType.Null;
            //msg.KeepaliveSpec.PeriodicTriggerValue = 0;

            //msg.ReaderEventNotificationSpec = new PARAM_ReaderEventNotificationSpec();
            //msg.ReaderEventNotificationSpec.EventNotificationState = new PARAM_EventNotificationState[5];
            //msg.ReaderEventNotificationSpec.EventNotificationState[0] = new PARAM_EventNotificationState();
            //msg.ReaderEventNotificationSpec.EventNotificationState[0].EventType = ENUM_NotificationEventType.AISpec_Event;
            //msg.ReaderEventNotificationSpec.EventNotificationState[0].NotificationState = true;

            //msg.ReaderEventNotificationSpec.EventNotificationState[1] = new PARAM_EventNotificationState();
            //msg.ReaderEventNotificationSpec.EventNotificationState[1].EventType = ENUM_NotificationEventType.Antenna_Event;
            //msg.ReaderEventNotificationSpec.EventNotificationState[1].NotificationState = true;

            //msg.ReaderEventNotificationSpec.EventNotificationState[2] = new PARAM_EventNotificationState();
            //msg.ReaderEventNotificationSpec.EventNotificationState[2].EventType = ENUM_NotificationEventType.GPI_Event;
            //msg.ReaderEventNotificationSpec.EventNotificationState[2].NotificationState = true;

            //msg.ReaderEventNotificationSpec.EventNotificationState[3] = new PARAM_EventNotificationState();
            //msg.ReaderEventNotificationSpec.EventNotificationState[3].EventType = ENUM_NotificationEventType.Reader_Exception_Event;
            //msg.ReaderEventNotificationSpec.EventNotificationState[3].NotificationState = true;

            //msg.ReaderEventNotificationSpec.EventNotificationState[4] = new PARAM_EventNotificationState();
            //msg.ReaderEventNotificationSpec.EventNotificationState[4].EventType = ENUM_NotificationEventType.RFSurvey_Event;
            //msg.ReaderEventNotificationSpec.EventNotificationState[4].NotificationState = true;

            msg.ROReportSpec   = new PARAM_ROReportSpec();
            msg.ROReportSpec.N = 1;
            msg.ROReportSpec.ROReportTrigger = ENUM_ROReportTriggerType.Upon_N_Tags_Or_End_Of_ROSpec;

            msg.ROReportSpec.TagReportContentSelector = new PARAM_TagReportContentSelector();
            msg.ROReportSpec.TagReportContentSelector.AirProtocolEPCMemorySelector = new UNION_AirProtocolEPCMemorySelector();
            PARAM_C1G2EPCMemorySelector c1g2mem = new PARAM_C1G2EPCMemorySelector();

            c1g2mem.EnableCRC    = true;
            c1g2mem.EnablePCBits = true;
            msg.ROReportSpec.TagReportContentSelector.AirProtocolEPCMemorySelector.Add(c1g2mem);

            msg.ROReportSpec.TagReportContentSelector.EnableAccessSpecID             = true;
            msg.ROReportSpec.TagReportContentSelector.EnableAntennaID                = true;
            msg.ROReportSpec.TagReportContentSelector.EnableChannelIndex             = true;
            msg.ROReportSpec.TagReportContentSelector.EnableFirstSeenTimestamp       = true;
            msg.ROReportSpec.TagReportContentSelector.EnableInventoryParameterSpecID = true;
            msg.ROReportSpec.TagReportContentSelector.EnableLastSeenTimestamp        = true;
            msg.ROReportSpec.TagReportContentSelector.EnablePeakRSSI     = true;
            msg.ROReportSpec.TagReportContentSelector.EnableROSpecID     = false;
            msg.ROReportSpec.TagReportContentSelector.EnableSpecIndex    = true;
            msg.ROReportSpec.TagReportContentSelector.EnableTagSeenCount = true;

            msg.GPIPortCurrentState               = new PARAM_GPIPortCurrentState[1];
            msg.GPIPortCurrentState[0]            = new PARAM_GPIPortCurrentState();
            msg.GPIPortCurrentState[0].Config     = true;
            msg.GPIPortCurrentState[0].GPIPortNum = 2;
            msg.GPIPortCurrentState[0].State      = ENUM_GPIPortState.Low;

            msg.GPOWriteData                  = new PARAM_GPOWriteData[1];
            msg.GPOWriteData[0]               = new PARAM_GPOWriteData();
            msg.GPOWriteData[0].GPOData       = true;
            msg.GPOWriteData[0].GPOPortNumber = 1;

            //PARAM_ImpinjTagDirectionReporting imp_tag_reporting = new PARAM_ImpinjTagDirectionReporting();

            //imp_tag_reporting.AntennaConfiguration = ENUM_TagDirectionAntennaConfiguration.Dual_Antenna;
            //imp_tag_reporting.EnableTagDirection = true;
            //imp_tag_reporting.Reserved = 0;

            //msg.ROReportSpec.AddCustomParameter(imp_tag_reporting);

            ////PARAM_ImpinjSubRegulatoryRegion sub_region = new PARAM_ImpinjSubRegulatoryRegion();
            ////sub_region.RegulatoryRegion = ENUM_ImpinjRegulatoryRegion.FCC_Part_15_247;
            ////msg.AddCustomParameter(sub_region);

            //msg.ResetToFactoryDefault = false;

            MSG_SET_READER_CONFIG_RESPONSE rsp = reader.SET_READER_CONFIG(msg, out msg_err, 12000);

            if (rsp != null)
            {
                textBox2.Text = rsp.ToString();
            }
            else if (msg_err != null)
            {
                textBox2.Text = rsp.ToString();
            }
            else
            {
                textBox2.Text = "Commmand time out!";
            }
        }