Ejemplo n.º 1
0
        private void connectInstrumentToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                InstrumentControl sgTest = new InstrumentControl();
                string            id     = sgTest.IdentifySignalGenerator(parameter.SGVISAAddress);
                if (id.ToUpper().IndexOf("N5182") != -1)
                {
                    iSgControl = (SGControl)mxg;
                    Log("MXG found!");
                }
                else
                {
                    iSgControl = (SGControl)psg;
                    Log("ESG/PSG found");
                }


                if (!iSgControl.GetInitializedStatus())
                {
                    Log("Initialize SG!");
                    iSgControl.Initialize(parameter.SGVISAAddress);
                }
                if (!xSA.Initialized)
                {
                    Log("Initialize xSA!");
                    xSA.Initialize(parameter.xSAVISAAddress);
                    xSA.SendCommand("inst:sel wlan");
                    Thread.Sleep(2000);
                    //xSA.SendCommand("INST:SEL WLAN");
                    // Select 11ax 80Mhz
                    xSA.SendCommand("RAD:STAN AX80");
                    // configure EVM measurement
                    xSA.SendCommand("CONF:EVM");
                }
                if (!n6700x.Initialized)
                {
                    Log("Initialize Power Supply.");
                    n6700x.Initialize(parameter.N6700VISAAddress);
                }
                // Add MXA Initialization code here.
            }
            catch (Exception ex)
            {
                Log(ex.Message);
            }
        }