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);
        }
Exemple #2
0
        /// <summary>
        /// Checks to verify that no system error has occured on the external source
        ///
        /// SYSTem:ERRor?
        /// </summary>
        /// <param name="extSource">the EXTSOURCE object</param>
        /// <returns>System error code and message</returns>
        public void TheExtSrcShouldHaveNoErrors(IEXTSOURCE extSource)
        {
            extSource.GetExtSrcSystemErrorQuery();
            Regex responseRegex = new Regex("^0,\"No error\"$");
            Match m             = responseRegex.Match(extSource.ExtSrcSystemError);

            Assert.IsTrue(m.Success, "An unexpected value:" + extSource.ExtSrcSystemError + " was returned from SYST:ERR?");
        }
Exemple #3
0
 /// <summary>
 /// Saves the external source's settings to a file
 ///
 /// AWGControl:SSave
 /// </summary>
 /// <param name="extSource">the EXTSOURCE object</param>
 /// <param name="filename">filename to save settings to</param>
 /// <param name="msus">mass storage unit specifier aka drive</param>
 public void SaveExtSrcSettings(IEXTSOURCE extSource, string filename, string msus)
 {
     if (msus != "")
     {
         msus = "," + "\"" + msus + "\"";
     }
     extSource.SaveExtSrcSettings(filename, msus);
 }
Exemple #4
0
 /// <summary>
 ///  Restores the AWG's settings from a speficied settings file and MSUS for the external source
 ///
 /// AWGControl:SREStore
 /// </summary>
 /// <param name="extSource">the EXTSOURCE object</param>
 /// <param name="filename">settings file to load</param>
 /// <param name="msus">mass storage unit specifier aka drive</param>
 public void SetExtSrcFileWithMsusRestore(IEXTSOURCE extSource, string filename, string msus)
 {
     if (msus != "")
     {
         msus = "," + "\"" + msus + "\"";
     }
     extSource.SetExtSrcFileWithMsusRestore(filename, msus);
 }
Exemple #5
0
        public void GivenAnExternalSource()
        {
            IEXTSOURCE extSource = EXTSOURCE.GetExtSource(true);

            _extSourceSystemGroup.GetExtSrcIDNQuery(extSource);
            //Make sure no errors from previous tests/runs
            _extSourceSystemGroup.ExtSrcCLS(extSource);
        }
Exemple #6
0
        /// <summary>
        /// Waits for the external source to complete in a matter of seconds
        ///
        /// *OPC?
        /// </summary>
        /// <param name="extSource">the EXTSOURCE object</param>
        /// <param name="timeLimit">How long to wait for the OPC to return</param>
        /// <returns>OPC result</returns>
        public void WaitForTimelimitExternalSource(IEXTSOURCE extSource, string timeLimit)
        {
            uint seconds = uint.Parse(timeLimit);
            uint timeout = seconds * 1000; // Convert to milliseconds

            extSource.GetExtSrcOPCQuery(timeout);
            Assert.AreEqual("1", extSource.ExtSrcOPC, "*OPC? query failed! Error was: " + extSource.ExtSrcOPC);
        }
Exemple #7
0
        /// <summary>
        /// Gets the id of the external source
        ///
        /// *IDN?
        /// </summary>
        /// <param name="extSource">the EXTSOURCE object</param>
        /// <returns>Id of the external source</returns>
        public void GetExtSrcIDNQuery(IEXTSOURCE extSource)
        {
            bool      found       = false;
            const int timesToFind = 3;

            for (int n = 0; n <= timesToFind; n++)                                   //Giving the external source a certain number of tries to get the right response
            {
                extSource.GetExtSrcIDNQuery();                                       //
                found = utils.GetExtSourceIDInformation(extSource.ExtSrcIDResponse); //Parsing ExtSourceID returns a bool
                if (found)                                                           //If returns true, valid id so a ExtSource is talking back!
                {
                    break;
                }
                Thread.Sleep(1000);
            }
            if (!found) //External source still won't talk back
            {
                Assert.Inconclusive("No External Source Found. ID Response returned " + extSource.ExtSrcIDResponse);
            }
        }
        public void WaitForWfmListToAddWfms(IEXTSOURCE extSource, string numEntries, string seconds)
        {
            UTILS.HiPerfTimer timer     = new UTILS.HiPerfTimer();
            double            totalTime = 0;
            int currentEntries          = Int16.Parse(extSource.ExtSrcWfmListSize);
            int expectedEntries         = Int16.Parse(numEntries) + currentEntries;

            while ((totalTime < double.Parse(seconds)))
            {
                timer.Start();
                extSource.GetExtSrcWfmListSize();
                if (Int16.Parse(extSource.ExtSrcWfmListSize) == expectedEntries)
                {
                    return;
                }
                Thread.Sleep(50); // Have to make sure this is between the start/stop commands
                timer.Stop();
                // Add the current interval to the total
                totalTime = totalTime + timer.Duration;
            }
            Assert.Fail("Waveform entries were not added in the allowed " + seconds + " seconds time limit.  Waveform Entries Found: " + extSource.ExtSrcWfmListSize);
        }
Exemple #9
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);
        }
Exemple #10
0
        public void TheCurrentSetupFileOnExtSrcShouldBe(string expectedFile)
        {
            IEXTSOURCE extSource = EXTSOURCE.GetExtSource(false);

            _extSourceControlGroup.TheExtSrcSetupNameShouldBe(extSource, expectedFile);
        }
Exemple #11
0
        public void OpenASetupOntoExtSrc(string filename, string msus)
        {
            IEXTSOURCE extSource = EXTSOURCE.GetExtSource(false);

            _extSourceControlGroup.SetExtSrcFileWithMsusRestore(extSource, filename, msus);
        }
Exemple #12
0
        public void RunTheWaveformInTheExtSrc()
        {
            IEXTSOURCE extSource = EXTSOURCE.GetExtSource(false);

            _extSourceControlGroup.SetExtSrcRunImm(extSource);
        }
Exemple #13
0
        public void GettheCurrentSetupNameOnExtSrc()
        {
            IEXTSOURCE extSource = EXTSOURCE.GetExtSource(false);

            _extSourceControlGroup.GetExtSrcSetupNameQuery(extSource);
        }
Exemple #14
0
        public void SetTheExtSrcRunModeToContinuous()
        {
            IEXTSOURCE extSource = EXTSOURCE.GetExtSource(false);

            _extSourceControlGroup.SetExtSrcRunMode(extSource, "CONTinuous");
        }
Exemple #15
0
        public void SetRepetitionRateOnExternalSource(string setValue)
        {
            IEXTSOURCE extSource = EXTSOURCE.GetExtSource(false);

            _extSourceControlGroup.SetExtSrcRepRate(extSource, setValue);
        }
Exemple #16
0
        public void TheExtSrcRunModeShouldBeGated()
        {
            IEXTSOURCE extSource = EXTSOURCE.GetExtSource(false);

            _extSourceControlGroup.TheExtSrcRunModeShouldBe(extSource, "GAT");
        }
Exemple #17
0
        public void StopTheExtSrc()
        {
            IEXTSOURCE extSource = EXTSOURCE.GetExtSource(false);

            _extSourceControlGroup.SetExtSrcStopImm(extSource);
        }
Exemple #18
0
        public void SetExtSrcTheInterleaveStateOff()
        {
            IEXTSOURCE extSource = EXTSOURCE.GetExtSource(false);

            _extSourceControlGroup.SetExtSrcInterLeaveState(extSource, "OFF");
        }
 /// <summary>
 /// Gets the the size(number of waveforms) of the waveform list from the externl source
 ///
 /// WLISt:SIZE?
 /// </summary>
 /// <param name="extSource">the EXTSOURCE object</param>
 /// <returns>the size(number of waveforms) of the waveform list</returns>
 public void GetExtSrcWfmListSize(IEXTSOURCE extSource)
 {
     extSource.GetExtSrcWfmListSize();
 }
Exemple #20
0
        public void SetTheExtSrcRunModeToTriggered()
        {
            IEXTSOURCE extSource = EXTSOURCE.GetExtSource(false);

            _extSourceControlGroup.SetExtSrcRunMode(extSource, "TRIGgered");
        }
Exemple #21
0
        public void SetTheExtSrcRunModeToSequence()
        {
            IEXTSOURCE extSource = EXTSOURCE.GetExtSource(false);

            _extSourceControlGroup.SetExtSrcRunMode(extSource, "SEQuence");
        }
Exemple #22
0
        public void SetTheExtSrcRunModeToGated()
        {
            IEXTSOURCE extSource = EXTSOURCE.GetExtSource(false);

            _extSourceControlGroup.SetExtSrcRunMode(extSource, "GATed");
        }
Exemple #23
0
        public void RestoreAnExtSrcSetupFile(string filename)
        {
            IEXTSOURCE extSource = EXTSOURCE.GetExtSource(false);

            _extSourceControlGroup.SetExtSrcFileRestore(extSource, filename);
        }
Exemple #24
0
        public void TheExtSrcRunModeShouldBeSequence()
        {
            IEXTSOURCE extSource = EXTSOURCE.GetExtSource(false);

            _extSourceControlGroup.TheExtSrcRunModeShouldBe(extSource, "SEQ");
        }
Exemple #25
0
        public void SaveTheSetupofExtSrcToFile(string filename, string msus)
        {
            IEXTSOURCE extsource = EXTSOURCE.GetExtSource(false);

            _extSourceControlGroup.SaveExtSrcSettings(extsource, filename, msus);
        }
Exemple #26
0
        public void TheExtSrcRunModeShouldBeTriggered()
        {
            IEXTSOURCE extSource = EXTSOURCE.GetExtSource(false);

            _extSourceControlGroup.TheExtSrcRunModeShouldBe(extSource, "TRIG");
        }
Exemple #27
0
        public void GetExternalSourceRunModeValue()
        {
            IEXTSOURCE extSource = EXTSOURCE.GetExtSource(false);

            _extSourceControlGroup.GetExtSrcRunModeQuery(extSource);
        }
 /// <summary>
 /// Creates a new empty waveform in the waveform list of the current setup on the external source
 ///
 /// WLISt:WAVeform:NEW
 /// </summary>
 /// <param name="extSource">the EXTSOURCE object</param>
 /// <param name="wfmName">waveform name</param>
 /// <param name="wfmSize">waveform size(number of points)</param>
 /// <param name="wfmType">waveform type</param>
 public void SetExtSrcWfmNew(IEXTSOURCE extSource, string wfmName, string wfmSize, string wfmType)
 {
     extSource.SetExtSrcWfmNew(wfmName, wfmSize, wfmType);
 }
Exemple #29
0
        public void SetInterleaveZeroingToOn()
        {
            IEXTSOURCE extSource = EXTSOURCE.GetExtSource(false);

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

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