Beispiel #1
0
        private void MainFrm_Load(object sender, EventArgs e)
        {
            // reader is our handle to the physical reader.
            //reader = new RFIDReader(this);
            handleTags = new WispHandleTags();
            readerMgr = new ReaderManager(this, handleTags);

            log = new WispLoggingManager();

            // init the saturn object.
            saturn = new SaturnDemo.Saturn();

            // Init midi config
            midi = new MIDI_Control_Demo.Midi();

            // Init bink bonk
            binkBonk = new BinkBonk.BinkBonk_Demo();
            handleTags.setBinkBonkCallback(binkBonk);

            // Setup axis labels for the various graphs.
            InitSOCGraph();
            InitTempGraph();

            // Other init code
            InitTagStats();

            // Grab initial component sizes for easy resize
            formInitialHeight = this.Height;
            pnlTagListInitialHeight = dgvTagStats.Height;

            // Init GUI operational mode to idle (disconnected)
            SetMode(ReaderManager.GuiModes.Idle);
        }
Beispiel #2
0
        private void SetMode(ReaderManager.GuiModes newMode)
        {
            // Switch performs the action
            try
            {
                readerMgr.SetMode(newMode, txtIPAddress.Text);
            }
            catch (Exception e)
            {
                // todo: handle exception
                MessageBox.Show(e.ToString());

            }

            ReaderManager.GuiModes currentMode = readerMgr.getCurrentMode();
            //MessageBox.Show(currentMode.ToString());

            // Lastly, update button enables:

            // Connect button
            if (currentMode == ReaderManager.GuiModes.Idle)
            {
                txtMessages.Text = "Disconnected.";
                lblStatus.Text = "";
                btnConnect.Text = "Connect";
            }
            else
            {
                txtMessages.Text = "Disconnected.";
                lblStatus.Text = "Connected to IP Address: " + txtIPAddress.Text;
                btnConnect.Text = "Disconnect";
            }
            btnConnect.Enabled = true;

            // User inventory start / stop buttons
            btnInv.Enabled = (currentMode != ReaderManager.GuiModes.Idle);
            if (currentMode == ReaderManager.GuiModes.Ready)
                btnInv.Text = "Inventory";
            else
                btnInv.Text = "Stop";

            // settings button
            btnSettings.Enabled = (currentMode == ReaderManager.GuiModes.Ready || currentMode == ReaderManager.GuiModes.UserInventory);

            // Set the mode label to our current mode
            lblMode.Text = "Mode: " + currentMode.ToString();
        }
        // Transfer reader's settings to the GUI
        public void ApplySettingsToGUI(ReaderManager.InventoryConfig config)
        {
            // this sets the cmb box to show the new set values
            cmbSettingsROStartTrigger.SelectedItem = config.startTrigger;
            cmbSettingsROStopTrigger.SelectedItem = config.stopTrigger;
            cmbSettingsReportTrigger.SelectedItem = config.reportTrigger;
            cmbSettingsAIStopTrigger.SelectedItem = config.AITriggerType;

            txtNumReports.Text = config.reportN.ToString();
            txtSettingsNumAttempts.Text = config.numAttempts.ToString();
            txtSettingsNumTags.Text = config.numTags.ToString();
            txtSettingsDuration.Text = config.duration.ToString();
            txtSettingsAITimeout.Text = config.AITimeout.ToString();
        }
 public SettingsForm(ReaderManager readerRef)
 {
     reader = readerRef;
     InitializeComponent();
 }
Beispiel #5
0
 public RFIDReader(ReaderManager newMgr)
 {
     readerMgr = newMgr;
     //SetDefaultReaderConfig();
     //SetDefaultInventoryConfig();
 }
        // Transfer reader's settings to the GUI
        public void ApplySettingsToGUI(ReaderManager.ReaderConfig config)
        {
            bool[] ants = config.antennaID;
            chkSettingsAnt1.Checked = ants[0];
            chkSettingsAnt2.Checked = ants[1];
            chkSettingsAnt3.Checked = ants[2];
            chkSettingsAnt4.Checked = ants[3];
            txtSettingsAttenuation.Text = config.attenuation.ToString();
            txtSettingsChannelIdx.Text = config.channelIndex.ToString();
            txtSettingsHopTableIdx.Text = config.hopTableIndex.ToString();
            for (int idx = 0; idx < cmbSettingsMode.Items.Count; idx++)
            {
                uint id = ((ReaderManager.ReaderMode)cmbSettingsMode.Items[idx]).GetModeIdentifier();
                if (id == config.modeIndex)
                    cmbSettingsMode.SelectedIndex = idx;
            }

            // todo: config.modeIndex;

            //txtSettingsPeriodicTriggerValue.Text = config.periodicTriggerValue.ToString();
            txtSettingsReaderSensitivity.Text = config.readerSensitivity.ToString();
            txtSettingsTagPopulation.Text = config.tagPopulation.ToString();
            txtSettingsTagTransitTime.Text = config.tagTransitTime.ToString();
        }
Beispiel #7
0
 public SettingsForm(ReaderManager readerRef)
 {
     reader = readerRef;
     InitializeComponent();
 }
Beispiel #8
0
        private void MainFrm_Load(object sender, EventArgs e)
        {
            // set position of form
            //base.Location = new Point(800, 150);

            // reader is our handle to the physical reader.
            //reader = new RFIDReader(this);
            handleTags = new WispHandleTags();
            readerMgr = new ReaderManager(this, handleTags);

            log = new WispLoggingManager();

            // init the saturn object.
            saturn = new Saturn();

            // Setup axis labels for the various graphs.
            InitSOCGraph();
            InitTempGraph();

            // Other init code
            InitTagStats();

            // Store initial sizes (for resize operation).
            formInitialSize = this.Size;
            pnlTagListInitialSize = pnlTagList.Size;

            // Init GUI operational mode to idle (disconnected)
            SetMode(ReaderManager.GuiModes.Idle);
        }
Beispiel #9
0
        // Sets the client's configuration 
        public void Set_Reader_Config(ReaderManager.ReaderConfig readerconfig)
        {
            // find number of antennas to set
            byte numAntennaToSet = 0;
            ushort antennaSet = 0;
            for (int i = 0; i < readerconfig.antennaID.Length; i++)
                if (readerconfig.antennaID[i]) 
                {
                    antennaSet = (ushort)i;
                    numAntennaToSet++;
                }
            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;
            cmd.C1G2RFControl.ModeIndex = readerconfig.modeIndex;
            cmd.C1G2RFControl.Tari = 0;
            cmd.C1G2SingulationControl = new PARAM_C1G2SingulationControl();
            cmd.C1G2SingulationControl.Session = new TwoBits(0);
            cmd.C1G2SingulationControl.TagPopulation = readerconfig.tagPopulation;
            cmd.C1G2SingulationControl.TagTransitTime = readerconfig.tagTransitTime;
            cmd.TagInventoryStateAware = false;

            msg.AntennaConfiguration = new PARAM_AntennaConfiguration[numAntennaToSet];
            for (ushort i = 1; i < numAntennaToSet + 1; i++)
            {
                msg.AntennaConfiguration[i - 1] = new PARAM_AntennaConfiguration();
                msg.AntennaConfiguration[i - 1].AirProtocolInventoryCommandSettings = new UNION_AirProtocolInventoryCommandSettings();
                msg.AntennaConfiguration[i - 1].AirProtocolInventoryCommandSettings.Add(cmd);

                msg.AntennaConfiguration[i - 1].AntennaID = antennaSet;

                msg.AntennaConfiguration[i - 1].RFReceiver = new PARAM_RFReceiver();
                msg.AntennaConfiguration[i - 1].RFReceiver.ReceiverSensitivity = readerconfig.readerSensitivity;

                msg.AntennaConfiguration[i - 1].RFTransmitter = new PARAM_RFTransmitter();
                msg.AntennaConfiguration[i - 1].RFTransmitter.ChannelIndex = readerconfig.channelIndex;
                msg.AntennaConfiguration[i - 1].RFTransmitter.HopTableID = readerconfig.hopTableIndex;
                msg.AntennaConfiguration[i - 1].RFTransmitter.TransmitPower = (ushort)(61 - (readerconfig.attenuation * 4));
            }
            //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;

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

            msg.KeepaliveSpec = new PARAM_KeepaliveSpec();
            msg.KeepaliveSpec.KeepaliveTriggerType = ENUM_KeepaliveTriggerType.Null;
            msg.KeepaliveSpec.PeriodicTriggerValue = readerconfig.periodicTriggerValue;

            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 = false;

            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 = false;

            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_AISpec;
            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 = true;
            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 = true;

            msg.ResetToFactoryDefault = false;

            MSG_SET_READER_CONFIG_RESPONSE rsp = client.SET_READER_CONFIG(msg, out msg_err, 3000);

            if (rsp != null)
            {
                //textBox2.Text = rsp.ToString() + "\n";
                WriteMessage(rsp.ToString(), "setReaderConfig");
            }
            else if (msg_err != null)
            {
                WriteMessage("setReaderConfig " + rsp.ToString() + "\n");
            }
            else
                WriteMessage("setReaderConfig Commmand time out!" + "\n");

        }
Beispiel #10
0
 public RFIDReader(ReaderManager newMgr)
 {
     readerMgr = newMgr;
     //SetDefaultReaderConfig();
     //SetDefaultInventoryConfig();
 }
Beispiel #11
0
        private MSG_ADD_ACCESSSPEC GetAccessSpecMsg(ReaderManager.ReaderConfig readerconfig)
        {
            MSG_ADD_ACCESSSPEC msg = new MSG_ADD_ACCESSSPEC();
            msg.AccessSpec = new PARAM_AccessSpec();

            msg.AccessSpec.AccessSpecID = 1001;
            msg.AccessSpec.AntennaID = 0;        //0 :  applys to all antennae,
            msg.AccessSpec.ProtocolID = ENUM_AirProtocols.EPCGlobalClass1Gen2;
            msg.AccessSpec.CurrentState = ENUM_AccessSpecState.Disabled;
            msg.AccessSpec.ROSpecID = 123;

            //define trigger
            msg.AccessSpec.AccessSpecStopTrigger = new PARAM_AccessSpecStopTrigger();
            msg.AccessSpec.AccessSpecStopTrigger.AccessSpecStopTrigger = ENUM_AccessSpecStopTriggerType.Null;
            msg.AccessSpec.AccessSpecStopTrigger.OperationCountValue = 3;

            return msg;
        }
Beispiel #12
0
        private void AddWriteAccessSpec(string tagID, string maskBits, string writeData, ReaderManager.ReaderConfig readerconfig)
        {
            MSG_ADD_ACCESSSPEC msg = GetAccessSpecMsg(readerconfig);
            AddTagSpec(tagID, maskBits, msg);
            AddWriteAccessCommand(msg, writeData);

            msg.AccessSpec.AccessReportSpec = new PARAM_AccessReportSpec();
            msg.AccessSpec.AccessReportSpec.AccessReportTrigger = ENUM_AccessReportTriggerType.Whenever_ROReport_Is_Generated;

            SendAccessSpec(msg);
        }
Beispiel #13
0
        //////////////////////////////////////////////////////////////////////////////////////
        //////////////////////////////////////////////////////////////////////////////////////
        //////////////////////////////////////////////////////////////////////////////////////
        //////////////////////////////////////////////////////////////////////////////////////
        //////////////////////////////////////////////////////////////////////////////////////
        //////////////////////////////////////////////////////////////////////////////////////



        #region Access Spec

        public void AddReadAccessSpec(string tagID, string maskBits, ushort wordCount, ushort wordPtr, ReaderManager.ReaderConfig readerconfig)
        {
            MSG_ADD_ACCESSSPEC msg = GetAccessSpecMsg(readerconfig);
            AddTagSpec(tagID, maskBits, msg);
            AddReadAccessCommand(wordCount, wordPtr, msg);

            msg.AccessSpec.AccessReportSpec = new PARAM_AccessReportSpec();
            msg.AccessSpec.AccessReportSpec.AccessReportTrigger = ENUM_AccessReportTriggerType.Whenever_ROReport_Is_Generated;

            SendAccessSpec(msg);
        }
Beispiel #14
0
        //////////////////////////////////////////////////////////////////////////////////////
        //////////////////////////////////////////////////////////////////////////////////////
        //////////////////////////////////////////////////////////////////////////////////////
        //////////////////////////////////////////////////////////////////////////////////////
        //////////////////////////////////////////////////////////////////////////////////////
        //////////////////////////////////////////////////////////////////////////////////////




        #region RO Spec
        /// <summary>
        /// Communicates the information of a ROSpec to the Reader.
        /// </summary>
        public void Add_RoSpec(ReaderManager.InventoryConfig inventoryconfig, ReaderManager.ReaderConfig readerconfig)
        {
            // Create a new message to be sent to the client
            MSG_ADD_ROSPEC msg = new MSG_ADD_ROSPEC();

            msg.ROSpec = new PARAM_ROSpec();
            msg.ROSpec.CurrentState = ENUM_ROSpecState.Disabled;   // Reader's current state: Disable 
            msg.ROSpec.Priority = 0x00;     // specifies the priority of the rospect                           
            msg.ROSpec.ROSpecID = 123;

            //==============================
            // Start condition
            msg.ROSpec.ROBoundarySpec = new PARAM_ROBoundarySpec();
            msg.ROSpec.ROBoundarySpec.ROSpecStartTrigger = new PARAM_ROSpecStartTrigger();
            // Null – No start trigger. The only way to start the ROSpec is with a START_ROSPEC from the Client.
            // 1 Immediate
            // 2 Periodic
            // 3 GPI
            // Note: This ROSpect starts immediatelly
            msg.ROSpec.ROBoundarySpec.ROSpecStartTrigger.ROSpecStartTriggerType = inventoryconfig.startTrigger;


            // Stop condition
            msg.ROSpec.ROBoundarySpec.ROSpecStopTrigger = new PARAM_ROSpecStopTrigger();
            // 0 Null – Stop when all AISpecs are done, or when preempted, or with a STOP_ROSPEC from the Client.
            // 1 Duration
            // 2 GPI with a timeout value
            // DurationTriggerValue: Duration in milliseconds

            // Trigger 1
            msg.ROSpec.ROBoundarySpec.ROSpecStopTrigger.ROSpecStopTriggerType = inventoryconfig.stopTrigger;

            //msg.ROSpec.ROBoundarySpec.ROSpecStopTrigger.DurationTriggerValue = 1000;


            // ROReportSpec triger 
            // 0 None
            // 1 (Upon N TagReportData Parameters or End of AISpec) Or (End of RFSurveySpec) - N=0 is unlimited.
            // 2 Upon N TagReportData Parameters or End of ROSpec N=0 is unlimited.

            // N: Unsigned Short Integer. This is the number of TagReportData Parameters used in ROReportTrigger = 1 and 2.
            // If N = 0, there is no limit on the number of TagReportData Parameters. 
            // This field SHALL be ignored when ROReportTrigger = 0.
            msg.ROSpec.ROReportSpec = new PARAM_ROReportSpec();
            msg.ROSpec.ROReportSpec.ROReportTrigger = inventoryconfig.reportTrigger;
            msg.ROSpec.ROReportSpec.N = inventoryconfig.reportN;


            // Report 2
            //msg.ROSpec.ROReportSpec.ROReportTrigger = ENUM_ROReportTriggerType.Upon_N_Tags_Or_End_Of_ROSpec;
            //msg.ROSpec.ROReportSpec.N = 0; 

            msg.ROSpec.ROReportSpec.TagReportContentSelector = new PARAM_TagReportContentSelector();
            msg.ROSpec.ROReportSpec.TagReportContentSelector.EnableAccessSpecID = true;
            msg.ROSpec.ROReportSpec.TagReportContentSelector.EnableAntennaID = true;
            msg.ROSpec.ROReportSpec.TagReportContentSelector.EnableChannelIndex = true;
            msg.ROSpec.ROReportSpec.TagReportContentSelector.EnableFirstSeenTimestamp = true;
            msg.ROSpec.ROReportSpec.TagReportContentSelector.EnableInventoryParameterSpecID = true;
            msg.ROSpec.ROReportSpec.TagReportContentSelector.EnableLastSeenTimestamp = true;
            msg.ROSpec.ROReportSpec.TagReportContentSelector.EnablePeakRSSI = true;
            msg.ROSpec.ROReportSpec.TagReportContentSelector.EnableROSpecID = true;
            msg.ROSpec.ROReportSpec.TagReportContentSelector.EnableSpecIndex = true;
            msg.ROSpec.ROReportSpec.TagReportContentSelector.EnableTagSeenCount = true;

            msg.ROSpec.SpecParameter = new UNION_SpecParameter();

            // Antena inventory operation
            PARAM_AISpec aiSpec = new PARAM_AISpec();

            // 12345

            aiSpec.AntennaIDs = new UInt16Array();
            //aiSpec.AntennaIDs.Add(0);       //0 :  applys to all antennae,
            for (ushort i = 1; i < readerconfig.antennaID.Length + 1; i++)
                if (readerconfig.antennaID[i - 1])
                {
                    aiSpec.AntennaIDs.Add(i);
                }
            // Stop trigger parameter 
            // 0 Null – Stop when ROSpec is done.
            // 1 Duration
            // 2 GPI with a timeout value
            // 3 Tag observation

            //if (inventorymode)
            //{
                // TriggerType: Integer
                // Possible Values: Value Modulation
                // ------ ------------
                // 0 Upon seeing N tag observations, or timeout
                // 1 Upon seeing no more new tag observations for t ms,or timeout
                // 2 N attempts to see all tags in the FOV, or timeout

                if (inventoryconfig.AITriggerType == ENUM_AISpecStopTriggerType.Tag_Observation)
                {
                    // Antena inventory operation
                    aiSpec.AISpecStopTrigger = new PARAM_AISpecStopTrigger();
                    aiSpec.AISpecStopTrigger.AISpecStopTriggerType = ENUM_AISpecStopTriggerType.Tag_Observation;
                    aiSpec.AISpecStopTrigger.TagObservationTrigger = new PARAM_TagObservationTrigger();

                    if (inventoryconfig.numAttempts == 0)
                    {
                        // Trigger type 1: works
                        aiSpec.AISpecStopTrigger.TagObservationTrigger.TriggerType = ENUM_TagObservationTriggerType.Upon_Seeing_N_Tags_Or_Timeout;
                        aiSpec.AISpecStopTrigger.TagObservationTrigger.NumberOfTags = inventoryconfig.numTags;
                        aiSpec.AISpecStopTrigger.TagObservationTrigger.Timeout = inventoryconfig.AITimeout;   // There is no time out
                    }
                    else
                    {
                        // Trigger type 2
                        aiSpec.AISpecStopTrigger.TagObservationTrigger.TriggerType = ENUM_TagObservationTriggerType.N_Attempts_To_See_All_Tags_In_FOV_Or_Timeout;
                        aiSpec.AISpecStopTrigger.TagObservationTrigger.NumberOfAttempts = inventoryconfig.numAttempts;
                        aiSpec.AISpecStopTrigger.TagObservationTrigger.Timeout = inventoryconfig.AITimeout;   // There is no time out
                    }

                }
                else if (inventoryconfig.AITriggerType == ENUM_AISpecStopTriggerType.Duration)
                {
                    // Antena inventory operation
                    aiSpec.AISpecStopTrigger = new PARAM_AISpecStopTrigger();
                    aiSpec.AISpecStopTrigger.AISpecStopTriggerType = ENUM_AISpecStopTriggerType.Duration;
                    aiSpec.AISpecStopTrigger.DurationTrigger = inventoryconfig.duration;
                }

                else if (inventoryconfig.AITriggerType == ENUM_AISpecStopTriggerType.GPI_With_Timeout)
                {
                    aiSpec.AISpecStopTrigger = new PARAM_AISpecStopTrigger();
                    aiSpec.AISpecStopTrigger.AISpecStopTriggerType = ENUM_AISpecStopTriggerType.GPI_With_Timeout;
                    aiSpec.AISpecStopTrigger.GPITriggerValue.Timeout = inventoryconfig.AITimeout;
                }

            //}


            // Operational parameters for an inventory using a single air protocol.
            aiSpec.InventoryParameterSpec = new PARAM_InventoryParameterSpec[1];
            aiSpec.InventoryParameterSpec[0] = new PARAM_InventoryParameterSpec();
            aiSpec.InventoryParameterSpec[0].InventoryParameterSpecID = 1234;
            aiSpec.InventoryParameterSpec[0].ProtocolID = ENUM_AirProtocols.EPCGlobalClass1Gen2;

            msg.ROSpec.SpecParameter.Add(aiSpec);   // Add operational parameters to Add_ROSpec msg

            // Send message to client and get the response

            MSG_ADD_ROSPEC_RESPONSE rsp = client.ADD_ROSPEC(msg, out msg_err, 3000);


            if (rsp != null)
            {
                //textBox2.Text = rsp.ToString() + "\n";
                WriteMessage(rsp.ToString(), "Add_RoSpec");
                WriteMessage("Add_RoSpec \n");
            }
            else if (msg_err != null)
            {
                WriteMessage("Add_RoSpec " + msg_err.ToString() + "\n");
            }
            else
                WriteMessage("Add_RoSpec Command time out!" + "\n");

        }
 public AttenTestForm()
 {
     attenMgr = new AttenuatorTest();
     readerMgr = new ReaderManager(this, attenMgr);
     InitializeComponent();
 }