public void SetTheExtSrcSamplingFrequencywUnits(string channel, string setValue, string units)
        {
            IEXTSOURCE extSource  = EXTSOURCE.GetExtSource(false);
            string     valueToSet = _converter.GigaToMegaHertz(setValue, units);

            _extSourceSourceGroup.SetExtSrcFreq(extSource, channel, valueToSet);
        }
Esempio n. 2
0
        public void ResetTheExternalSource()
        {
            IEXTSOURCE extSource = EXTSOURCE.GetExtSource(false);

            _extSourceSystemGroup.ExtSrcRst(extSource);
            _extSourceSystemGroup.WaitForExternalSource(extSource);
        }
Esempio n. 3
0
        public void GivenAnExternalSource()
        {
            IEXTSOURCE extSource = EXTSOURCE.GetExtSource(true);

            _extSourceSystemGroup.GetExtSrcIDNQuery(extSource);
            //Make sure no errors from previous tests/runs
            _extSourceSystemGroup.ExtSrcCLS(extSource);
        }
Esempio n. 4
0
 public static void CloseAllExtsource()
 {
     if (_EXTSOURCE != null)
     {
         _EXTSOURCE._EXTSOURCEVisaSession.Close();
         _EXTSOURCE = null;
     }
 }
        [AfterTestRun] //MUST be static
        public static void AfterTestRun()
        {
            //Close AWG sessions
            CloseAllAWG();

            // Close SCOPE sessions
            SCOPE.CloseAllScope();

            // Close EXTSOURCE sessions
            EXTSOURCE.CloseAllExternalSources();
        }
Esempio n. 6
0
        private static string ExtSourceConnection;  //!< IP address or name of the External Source

        /// <summary>
        /// Instantiate the %EXTSOURCE class if it is not already open
        ///
        /// NOTE: We only allow one external source in the test system.
        /// </summary>
        /// <param name="create">Each time you call GetExtSource, you need to pass "true" if you want a new session, "false" if you are just looking up the existing session</param>
        /// <returns>Return new or existing sesssion</returns>
        public static EXTSOURCE GetExtSource(bool create = true)
        {
            if (create == true)
            {
                _EXTSOURCE = new EXTSOURCE();

                ExtSourceConnection = AwgSetupSteps.ExtSourceConnectionIP;

                ExtSourceConnection = "TCPIP::" + ExtSourceConnection + "::INSTR";
                _EXTSOURCE._EXTSOURCEVisaSession.Open(ExtSourceConnection);
            }
            return(_EXTSOURCE); // Otherwise, return the existing session
        }
Esempio n. 7
0
        public static void CloseAllExternalSources()
        {
            int retry = 50;

            if (_extSource != null)
            {
                do
                {
                    _extSource.ExtSourceVisaSessionClose();
                    Thread.Sleep(3000);
                } while ((--retry >= 0) && _extSource != null);
                if (retry < 0)
                {
                    Assert.Inconclusive("Unable to close external source visa session properly");
                }
                _extSource = null;
            }
        }
Esempio n. 8
0
        private static string _extSourceConnection; //!< IP address or name of the Scope


        //  shkv 3/4/2015 Fixing the external source issue.
        /// <summary>
        /// Instantiate the %SCOPE class if it is not already open
        /// </summary>
        /// <param name="create">Each time you call GetScope(), you need to pass "true" if you want a new session, "false" if you are just looking up the existing session</param>
        /// <returns>Return new or existing session</returns>
        public static EXTSOURCE GetExtSource(bool create = true)
        {
            if (create == true)
            {
                TekVISANet.VISA EXTSOURCEVisaSession = new TekVISANet.VISA();
                //_scope = new SCOPE(_scope.SCOPEVisaSession);
                string status = "";
                _extSourceConnection = AwgSetupSteps.ExtSourceConnectionIP;
                _extSourceConnection = "TCPIP::" + _extSourceConnection + "::INSTR";

                //bool openSuccessFul = EXTSOURCEVisaSession.Open(_extSourceConnection);
                bool openSuccessFul = EXTSOURCEVisaSession.Open(_extSourceConnection, TekVISANet.TekVISADefs.AccessModes.VI_NO_LOCK, 90000, 5);
                if (!openSuccessFul)
                {
                    int retry = 4;
                    do
                    {
                        openSuccessFul = EXTSOURCEVisaSession.Open(_extSourceConnection);
                    } while ((--retry >= 0) && (!openSuccessFul));

                    try
                    {
                        status = _extSource.ErrorDescription();
                    }
                    catch (Exception)
                    {
                        status = "Object reference not set to an instance of an object.";
                    }
                    //See if the status string contains the word "Success"
                    Regex validatePreMatcher = new Regex(@"Success.+");
                    Match match = validatePreMatcher.Match(status);
                    // Check the status string to see if the operation was sucessful
                    if (!match.Success)
                    {
                        Assert.Inconclusive("Attempt to Open connection failed: " + status);
                    }
                }
                _extSource = new EXTSOURCE(EXTSOURCEVisaSession);
                //! \TODO: Figure out how to test for a valid session and assert here if false
            }
            return(_extSource); // Otherwise, return the existing session
        }
Esempio n. 9
0
        // Unkown 01/01/01
        /// <summary>
        /// Function for retreiving information from the External Source ID string
        /// </summary>
        /// <param name="IdString">Returned Id string from the External Source</param>
        /// <returns>Returns a boolean with the result of the matching process</returns>
        public bool GetExtSourceIDInformation(string IdString)
        {
            if (string.IsNullOrEmpty(IdString)) //No chance of External Source being valid give up
            {
                return(false);
            }
            EXTSOURCE extsource = EXTSOURCE.GetExtSource(false);
            //This is kind of cute, C# allows us to label the regex group we want with a name, instead of having to use an array index value.
            Regex SrcFeatureMatcher =
                new Regex(@"TEKTRONIX,(?<type>AWG|HSG)(?<model_number>\d+).,(?<serial>.+),SCPI:.+ FW:(?<fwVersion>.+)");
            Match match = SrcFeatureMatcher.Match(IdString.Trim()); //The ID

            //Assert.IsTrue(match.Success); // make sure you got a good match
            if (!match.Success) //ExtSource is there, just isn't talking properly
            {
                return(false);
            }
            //Remember that since we have an instance of the EXTSOURCE accessors for each one in the setup, these values are specific to that AWG
            extsource.model         = match.Groups["model_number"].Value;
            extsource.serial_number = match.Groups["serial"].Value;
            extsource.fw_version    = match.Groups["fwVersion"].Value;
            switch (extsource.model)
            {
            // 5000 "A", "B", "C" series (Indy, Hubble, Kepler)
            case "5002":
            case "5012":
            case "5014":
                extsource.family = "5";
                break;

            // 7000 "A", "B", "C" series (Indy, Hubble, Kepler)
            case "7101":
            case "7061":
            case "7082":
            case "7122":
                extsource.family = "7";
                break;
            }
            return(true); //All matches point to a valid ID string
        }
Esempio n. 10
0
        public void SetupTheAwg7122AsExternalReferenceSource(string fileName, string repRate, string zeroingOn)
        {
            const string channelNumber = "1";
            IEXTSOURCE   extSource     = EXTSOURCE.GetExtSource(false);

            // Put AWG7122C into a known(default) state
            _extSourceSystemGroup.ExtSrcRst(extSource);
            // Always wait for it to complete or you can get into trouble
            _extSourceSystemGroup.WaitForExternalSource(extSource);
            // Turn the interleave mode to On
            const string interleaveOn = "1";

            _extSourceControlGroup.SetExtSrcInterLeaveState(extSource, interleaveOn);
            // Set state on interleave zeroing
            _extSourceControlGroup.SetExtSrcInterLeaveZeroing(extSource, zeroingOn);
            // Loading a known waveform to produce our external clock waveform for reference
            _extSourceSourceGroup.SetExtSrcFunctUser(extSource, fileName, channelNumber);
            // Not sure this is necessary but set the repetition rate
            _extSourceControlGroup.SetExtSrcRepRate(extSource, repRate);
            // Make sure the output state is on for Channel 1
            const string outputStateOn = "1";

            _extSourceSystemGroup.SetExtSrcOutputState(extSource, channelNumber, outputStateOn);
        }
Esempio n. 11
0
        public void SaveTheSetupofExtSrcToFile(string filename, string msus)
        {
            IEXTSOURCE extsource = EXTSOURCE.GetExtSource(false);

            _extSourceControlGroup.SaveExtSrcSettings(extsource, filename, msus);
        }
Esempio n. 12
0
        public void OpenASetupOntoExtSrc(string filename, string msus)
        {
            IEXTSOURCE extSource = EXTSOURCE.GetExtSource(false);

            _extSourceControlGroup.SetExtSrcFileWithMsusRestore(extSource, filename, msus);
        }
Esempio n. 13
0
        public void RestoreAnExtSrcSetupFile(string filename)
        {
            IEXTSOURCE extSource = EXTSOURCE.GetExtSource(false);

            _extSourceControlGroup.SetExtSrcFileRestore(extSource, filename);
        }
Esempio n. 14
0
        public void GettheCurrentSetupNameOnExtSrc()
        {
            IEXTSOURCE extSource = EXTSOURCE.GetExtSource(false);

            _extSourceControlGroup.GetExtSrcSetupNameQuery(extSource);
        }
Esempio n. 15
0
        public void TheCurrentSetupFileOnExtSrcShouldBe(string expectedFile)
        {
            IEXTSOURCE extSource = EXTSOURCE.GetExtSource(false);

            _extSourceControlGroup.TheExtSrcSetupNameShouldBe(extSource, expectedFile);
        }
Esempio n. 16
0
        public void SetTheExtSrcRunModeToGated()
        {
            IEXTSOURCE extSource = EXTSOURCE.GetExtSource(false);

            _extSourceControlGroup.SetExtSrcRunMode(extSource, "GATed");
        }
Esempio n. 17
0
        public void RunTheWaveformInTheExtSrc()
        {
            IEXTSOURCE extSource = EXTSOURCE.GetExtSource(false);

            _extSourceControlGroup.SetExtSrcRunImm(extSource);
        }
Esempio n. 18
0
        public void TheExtSrcRunModeShouldBeSequence()
        {
            IEXTSOURCE extSource = EXTSOURCE.GetExtSource(false);

            _extSourceControlGroup.TheExtSrcRunModeShouldBe(extSource, "SEQ");
        }
Esempio n. 19
0
        public void TheExtSrcRunModeShouldBeTriggered()
        {
            IEXTSOURCE extSource = EXTSOURCE.GetExtSource(false);

            _extSourceControlGroup.TheExtSrcRunModeShouldBe(extSource, "TRIG");
        }
        public void ImportFileIntoExtSrc(string wfmName, string fileName, string format)
        {
            IEXTSOURCE extSource = EXTSOURCE.GetExtSource(false);

            _extSourceMemoryGroup.SetExtSrcMemImport(extSource, wfmName, fileName, format);
        }
Esempio n. 21
0
        public void TheExtSrcRunModeShouldBeGated()
        {
            IEXTSOURCE extSource = EXTSOURCE.GetExtSource(false);

            _extSourceControlGroup.TheExtSrcRunModeShouldBe(extSource, "GAT");
        }
Esempio n. 22
0
        public void SetExtSrcTheInterleaveStateOff()
        {
            IEXTSOURCE extSource = EXTSOURCE.GetExtSource(false);

            _extSourceControlGroup.SetExtSrcInterLeaveState(extSource, "OFF");
        }
Esempio n. 23
0
        public void SetTheExtSrcRunModeToTriggered()
        {
            IEXTSOURCE extSource = EXTSOURCE.GetExtSource(false);

            _extSourceControlGroup.SetExtSrcRunMode(extSource, "TRIGgered");
        }
Esempio n. 24
0
        public void SetTheExtSrcRunModeToSequence()
        {
            IEXTSOURCE extSource = EXTSOURCE.GetExtSource(false);

            _extSourceControlGroup.SetExtSrcRunMode(extSource, "SEQuence");
        }
Esempio n. 25
0
        public void StopTheExtSrc()
        {
            IEXTSOURCE extSource = EXTSOURCE.GetExtSource(false);

            _extSourceControlGroup.SetExtSrcStopImm(extSource);
        }
Esempio n. 26
0
        public void SetRepetitionRateOnExternalSource(string setValue)
        {
            IEXTSOURCE extSource = EXTSOURCE.GetExtSource(false);

            _extSourceControlGroup.SetExtSrcRepRate(extSource, setValue);
        }
Esempio n. 27
0
        public void GetExternalSourceRunModeValue()
        {
            IEXTSOURCE extSource = EXTSOURCE.GetExtSource(false);

            _extSourceControlGroup.GetExtSrcRunModeQuery(extSource);
        }
Esempio n. 28
0
        public void SetTheExtSrcRunModeToContinuous()
        {
            IEXTSOURCE extSource = EXTSOURCE.GetExtSource(false);

            _extSourceControlGroup.SetExtSrcRunMode(extSource, "CONTinuous");
        }
Esempio n. 29
0
        public void SetInterleaveZeroingToOn()
        {
            IEXTSOURCE extSource = EXTSOURCE.GetExtSource(false);

            _extSourceControlGroup.SetExtSrcInterLeaveZeroing(extSource, "ON");
        }
Esempio n. 30
0
        public void TheExtSrcRunModeShouldBeContinuous()
        {
            IEXTSOURCE extSource = EXTSOURCE.GetExtSource(false);

            _extSourceControlGroup.TheExtSrcRunModeShouldBe(extSource, "CONT");
        }