示例#1
0
        public override void Run()
        {
            // ToDo: Add test case code.
            RunChildSteps(); //If the step supports child steps.


            MyInst.ScpiCommand(":INSTrument:SELect {0}", InstMode);
            MyInst.ScpiCommand("*OPC");
            MyInst.ScpiCommand(":CALCulate:SELected:MARKer{0}:ACTivate", MarkerNo);
            MyInst.ScpiCommand(":CALCulate:SELected:MARKer{0}:AOFF", MarkerNo);
            // Marker BW
            MarkerBWdata = MyInst.ScpiQuery <System.Double[]>(Scpi.Format(":CALCulate:SELected:MARKer{0}:BWIDth:DATA?", MarkerNo), true);
            MyInst.ScpiCommand(":CALCulate:SELected:MARKer{0}:BWIDth:STATe {1}", MarkerNo, MarkerBWstate);
            MyInst.ScpiCommand(":CALCulate:SELected:MARKer{0}:FUNCtion:BWIDth:THReshold {1}", MarkerNo, MarkerBWThreshold);
            MyInst.ScpiCommand(":CALCulate:SELected:MARKer{0}:FORMat {1}", MarkerNo, MarkerFormat);
            MyInst.ScpiCommand(":CALCulate:SELected:MARKer{0}:STATe {1}", MarkerNo, MarkerMode);
            MyInst.ScpiCommand(":CALCulate:SELected:MARKer{0}:TRACe {1}", MarkerNo, TraceNum);
            MyInst.ScpiCommand(":CALCulate:SELected:MARKer{0}:X {1}", MarkerNo, MarkerX);
            MarkerPhase = MyInst.ScpiQuery <System.Double>(Scpi.Format(":CALCulate:SELected:MARKer{0}:Y?", MarkerNo), true);
            MyInst.ScpiCommand(":CALCulate:SELected:MARKer{0}:FUNCtion:MAXimum", MarkerNo);
            MyInst.ScpiCommand(":CALCulate:SELected:MARKer{0}:FUNCtion:MINimum", MarkerNo);
            // If no verdict is used, the verdict will default to NotSet.
            // You can change the verdict using UpgradeVerdict() as shown below.
            // UpgradeVerdict(Verdict.Pass);
        }
示例#2
0
        public override void Run()
        {
            // ToDo: Add test case code.
            RunChildSteps(); //If the step supports child steps.

            MyInst.ScpiCommand(":SOURce:ARB:FUNCtion:TYPE {0},{1}", ArbType, ChanList);
            MyInst.ScpiCommand(":SOURce:ARB:FUNCtion:SHAPe {0},{1}", ArbFunction, ChanList);

            // Dwell
            if (ArbType == EArbType.CURRent)
            {
                MyInst.ScpiCommand(":SOURce:ARB:CURRent:CDWell:DWELl {0},{1}", CDwellTime, ChanList);
                MyInst.ScpiCommand(":FORMat:DATA ASC");
                MyInst.ScpiCommand(":SOURce:ARB:CURRent:CDWell:LEVel {0},{1}", CDwellLevel, ChanList);
                CDwellPoints = MyInst.ScpiQuery <System.Int32[]>(Scpi.Format(":SOURce:ARB:CURRent:CDWell:POINts? {0}", ChanList), true);
                MyInst.ScpiCommand(":SOURce:ARB:CURRent:CONVert {0}", ChanList);
            }
            else if (ArbType == EArbType.VOLTage)
            {
                MyInst.ScpiCommand(":SOURce:ARB:VOLTage:CDWell:DWELl {0},{1}", VDwellTime, ChanList);
                MyInst.ScpiCommand(":FORMat:DATA ASC");
                MyInst.ScpiCommand(":SOURce:ARB:VOLTage:CDWell:LEVel {0},{1}", VDwellLevel, ChanList);
                VDwellPoints = MyInst.ScpiQuery <System.Int32[]>(Scpi.Format(":SOURce:ARB:VOLTage:CDWell:POINts? {0}", ChanList), true);
                MyInst.ScpiCommand(":SOURce:ARB:VOLTage:CONVert {0}", ChanList);
            }


            // UpgradeVerdict(Verdict.Pass);
        }
示例#3
0
        public void ScpiArrayTest4()
        {
            string[] result = Scpi.Parse <string[]>("\"\"\"\",\"test");
            Assert.AreEqual(2, result.Length);

            Assert.AreEqual("\"\"\"\"", result[0]);
            Assert.AreEqual("\"test", result[1]);
        }
 public override void Run()
 {
     MyInst.ScpiCommand(":DISPlay:BRIGhtness {0}", Brightness);
     MyInst.ScpiCommand(":DISPlay:CONTrast {0}", Contrast);
     MyInst.ScpiCommand(":DISPlay:CAPTure");
     MyInst.ScpiCommand(":DISPlay:REMote {0}", RemoteStatus);
     QueryRemoteStatus = MyInst.ScpiQuery <System.Boolean>(Scpi.Format(":DISPlay:REMote?"), true);
 }
示例#5
0
        public void ScpiAttrTest1()
        {
            var inv      = Scpi.Parse <A>("Cee");
            var result   = Scpi.Format("ASD:BDS {0} {1} {2} {3} {4} {5} {6}", inv, true, false, E.B2, E.C2, E.D2, 3.14);
            var expected = "ASD:BDS Cee ON OFF B21 Ce2e D2 3.14";

            Assert.AreEqual(A.C, inv);
            Assert.AreEqual(expected, result);
        }
示例#6
0
 /// <inheritdoc />
 public void SetRfOutputState(EState outputState)
 {
     ScpiCommand("OUTP:STAT " + Scpi.Format("{0}", outputState));
     if (outputState != EState.On)
     {
         return;
     }
     WaitUnlevelStateToClear();
 }
示例#7
0
 public override void Run()
 {
     QueryCurrentSPoint = MyInst.ScpiQuery <System.Int32>(Scpi.Format(":SOURce:SWEEp:POINt?"), true);
     MyInst.ScpiCommand(":SOURce:LIST:DIRection {0}", Direction);
     QueryDirection = MyInst.ScpiQuery <System.String>(Scpi.Format(":SOURce:LIST:DIRection?"), true);
     MyInst.ScpiCommand(":SOURce:SWEEp:FREQuency {0}", ListFrequency);
     QueryListDirection = MyInst.ScpiQuery <System.Double[]>(Scpi.Format(":SOURce:LIST:FREQuency?"), true);
     MyInst.ScpiCommand(":SOURce:SWEEp:POWer {0}", ListPower);
     MyInst.ScpiCommand(":SOURce:SWEEp:TYPE {0}", SweepType);
 }
示例#8
0
        public void ScpiArrayTest2()
        {
            string[] result = Scpi.Parse <string[]>(",\"\", , 3 ");
            Assert.AreEqual(4, result.Length);

            Assert.AreEqual("", result[0]);
            Assert.AreEqual("\"\"", result[1]);
            Assert.AreEqual("", result[2]);
            Assert.AreEqual("3", result[3]);
        }
示例#9
0
        public void ScpiArrayTest3()
        {
            string[] result = Scpi.Parse <string[]>("100,200,\"test.bin,1,2\",\"test2.bin,13,37\"");
            Assert.AreEqual(4, result.Length);

            Assert.AreEqual("100", result[0]);
            Assert.AreEqual("200", result[1]);
            Assert.AreEqual("\"test.bin,1,2\"", result[2]);
            Assert.AreEqual("\"test2.bin,13,37\"", result[3]);
        }
示例#10
0
        public void ScpiArrayTest1()
        {
            string[] result = Scpi.Parse <string[]>("1,33,\"test\",\"test,with,comma\",\"with,\"\"comma,and,inserted,quote\"\"\"");
            Assert.AreEqual(5, result.Length);

            Assert.AreEqual("1", result[0]);
            Assert.AreEqual("33", result[1]);
            Assert.AreEqual("\"test\"", result[2]);
            Assert.AreEqual("\"test,with,comma\"", result[3]);
            Assert.AreEqual("\"with,\"\"comma,and,inserted,quote\"\"\"", result[4]);
        }
示例#11
0
        public override void Run()
        {
            // ToDo: Add test case code.
            RunChildSteps();             //If the step supports child steps.

            AvailableMode = MyInst.ScpiQuery <System.String[]>(Scpi.Format(":INSTrument:CATalog?"), true);
            MyInst.ScpiCommand(":INSTrument:SELect {0}", ModeOfInstrument);
            MyInst.ScpiCommand("*OPC");
            // If no verdict is used, the verdict will default to NotSet.
            // You can change the verdict using UpgradeVerdict() as shown below.
            // UpgradeVerdict(Verdict.Pass);
        }
示例#12
0
        public override void Run()
        {
            // ToDo: Add test case code.
            // RunChildSteps(); //If the step supports child steps.

            MyInst.ScpiCommand(":TRACe{0}:TYPE {1}", TraceNo, TraceType);
            MyInst.ScpiCommand(":FORMat:DATA ASC,0");
            OutputTraceValue = MyInst.ScpiQuery <System.Double[]>(Scpi.Format(":TRACe{0}:DATA?", TraceNo), true);
            // If no verdict is used, the verdict will default to NotSet.
            // You can change the verdict using UpgradeVerdict() as shown below.
            // UpgradeVerdict(Verdict.Pass);
        }
 public override void Run()
 {
     QueriedFreq = MyInst.ScpiQuery <System.Double>(Scpi.Format(":SOURce:CORRection:FLATness:FREQuency? {0}", FreqPoint), true);
     MyInst.ScpiCommand(":SOURce:CORRection:FLATness:LOAD {0}", FlatnessCorrectionFilename);
     MyInst.ScpiCommand(":SOURce:CORRection:FLATness:PAIR {0},{1}", CorrFreq, CorrAmplitude);
     QueriedPointInFile = MyInst.ScpiQuery <System.Int32>(Scpi.Format(":SOURce:CORRection:FLATness:POINts?"), true);
     MyInst.ScpiCommand(":SOURce:CORRection:FLATness:PRESet");
     MyInst.ScpiCommand(":SOURce:CORRection:FLATness:STORe {0}", SaveCorrectionFile);
     MyInst.ScpiCommand(":SOURce:CORRection:FLATness:STEP:POINts {0}", CorrStepPoint);
     MyInst.ScpiCommand(":SOURce:CORRection:FLATness:STEP:STARt {0}", CorrStepStartFreq);
     MyInst.ScpiCommand(":SOURce:CORRection:FLATness:STEP:STOP {0}", CorrStepStopFreq);
 }
示例#14
0
        public override void Run()
        {
            MyInst.ScpiCommand("DISPlay:WINDow:STATE ON");
            MyInst.ScpiCommand("CALCulate:PARameter:DEFine:EXT 'MyMeas1',S11");
            MyInst.ScpiCommand("CALCulate:PARameter:DEFine:EXT 'MyMeas2',S12");
            MyInst.ScpiCommand("CALCulate:PARameter:DEFine:EXT 'MyMeas3',S21");
            MyInst.ScpiCommand("CALCulate:PARameter:DEFine:EXT 'MyMeas4',S22");
            MyInst.ScpiCommand("DISPlay:WINDow:TRACe1:FEED 'MyMeas1'");
            //MyInst.ScpiCommand("DISPlay:WINDow:TRACe2:FEED 'MyMeas2'");
            //MyInst.ScpiCommand("DISPlay:WINDow:TRACe3:FEED 'MyMeas3'");
            //MyInst.ScpiCommand("DISPlay:WINDow:TRACe4:FEED 'MyMeas4'");
            //MyInst.ScpiCommand("DISPlay:WINDow:Y:AUTO");
            MyInst.ScpiQuery <bool>("*OPC?");

            Log.Info("Selected Start Frequency : " + StartFrequency.ToString());
            Log.Info("Selected Stop Frequency : " + StopFrequency.ToString());
            Log.Info("Selected IF Bandwidth : " + IFBandwidth.ToString());
            Log.Info("Selected Power Level : " + SweepPoints.ToString());

            MyInst.IoTimeout = 5000;

            MyMeas measurement = MyMeas.MyMeas1;

            if (S_Parameters == S_Parameters.S11)
            {
                measurement = MyMeas.MyMeas1;
            }
            if (S_Parameters == S_Parameters.S12)
            {
                measurement = MyMeas.MyMeas2;
            }
            if (S_Parameters == S_Parameters.S21)
            {
                measurement = MyMeas.MyMeas3;
            }
            if (S_Parameters == S_Parameters.S22)
            {
                measurement = MyMeas.MyMeas4;
            }

            MyInst.ScpiCommand(":CALCulate1:PARameter:SELect '{0}'", measurement);
            MyInst.ScpiCommand(":SENSe:BANDwidth:RESolution {0}", IFBandwidth);
            MyInst.ScpiCommand(":SENSe:FREQuency:STARt {0}", StartFrequency);
            MyInst.ScpiCommand(":SENSe:FREQuency:STOP {0}", StopFrequency);
            MyInst.ScpiCommand(":SENSe:SWEep:POINts {0}", SweepPoints);
            MyInst.ScpiCommand(":SENSe:SWEep:GENeration {0}", SweepType);
            MyInst.ScpiCommand(":SENSe:SWEep:TIME:AUTO 1");


            StaticClass.Time = MyInst.ScpiQuery <System.Double>(Scpi.Format(":SENSe:SWEep:TIME?"), true);

            UpgradeVerdict(Verdict.Pass);
        }
示例#15
0
        /// <summary>
        /// Open procedure for the instrument.
        /// </summary>
        public override void Open()
        {
            base.Open();
            // TODO:  Open the connection to the instrument here

            modelNo = ScpiQuery <System.String>(Scpi.Format(":MODel?"), true);
            Log.Info("Instrument Detected: " + modelNo);
            //if (!IdnString.Contains("Instrument ID"))
            //{
            //    Log.Error("This instrument driver does not support the connected instrument.");
            //    throw new ArgumentException("Wrong instrument type.");
            // }
        }
示例#16
0
 public override void Run()
 {
     MyInst.ScpiCommand(":SOURce:CORRection:PMETer:CHANnel {0}", Channel);
     MyInst.ScpiCommand(":SOURce:CORRection:PMETer:COMMunicate:TYPE {0}", CommunicationType);
     MyInst.ScpiCommand(":SOURce:CORRection:PMETer:COMMunicate:LAN:DEVice {0}", DeviceName);
     QueryDeviceName = MyInst.ScpiQuery <System.String>(Scpi.Format(":SOURce:CORRection:PMETer:COMMunicate:LAN:DEVice?"), true);
     MyInst.ScpiCommand(":SOURce:CORRection:PMETer:COMMunicate:LAN:IP {0}", IpAddress);
     QueryIpAddress = MyInst.ScpiQuery <System.String>(Scpi.Format(":SOURce:CORRection:PMETer:COMMunicate:LAN:IP?"), true);
     MyInst.ScpiCommand(":SOURce:CORRection:PMETer:COMMunicate:LAN:PORT {0}", PortNumber);
     QueryPortNumber = MyInst.ScpiQuery <System.Int32>(Scpi.Format(":SOURce:CORRection:PMETer:COMMunicate:LAN:PORT?"), true);
     MyInst.ScpiCommand(":SOURce:CORRection:PMETer:COMMunicate:USB:DEVice {0}", UsbDevice);
     QueryUsbDevice = MyInst.ScpiQuery <System.String>(Scpi.Format(":SOURce:CORRection:PMETer:COMMunicate:USB:DEVice?"), true);
     ListDevices    = MyInst.ScpiQuery <System.String[]>(Scpi.Format(":SOURce:CORRection:PMETer:COMMunicate:USB:LIST?"), true);
 }
示例#17
0
        public override void Run()
        {
            // ToDo: Add test case code.
            RunChildSteps(); //If the step supports child steps.

            MyInst.ScpiCommand(":SENSe:FREQuency:CENTer {0}", FreqCenter);
            MyInst.ScpiCommand(":SENSe:FREQuency:SPAN {0}", FreqSpan);
            MyInst.ScpiCommand(":SENSe:FREQuency:STARt {0}", FreqStart);
            MyInst.ScpiCommand(":SENSe:FREQuency:STOP {0}", FreqStop);
            MyInst.ScpiCommand(":FORMat:DATA ASC,0");
            FreqData = MyInst.ScpiQuery <System.Double[]>(Scpi.Format(":SENSe:FREQuency:DATA?"), true);
            MyInst.ScpiCommand(":SENSe:SWEep:TIME {0}", SweepTime);
            MyInst.ScpiCommand(":SENSe:SWEep:POINts {0}", SweepPoints);

            // If no verdict is used, the verdict will default to NotSet.
            // You can change the verdict using UpgradeVerdict() as shown below.
            // UpgradeVerdict(Verdict.Pass);
        }
示例#18
0
        public override void Run()
        {
            // The SCPI class's format command takes the value of the enum (marked with the SCPI attribute),
            // and returns the associated SCPI command.
            Log.Info("The {0} property is set to {1}. Corresponding SCPI: {2}",
                     "LinkDirection", LinkDirection, Scpi.Format("{0}", LinkDirection));

            Log.Info("The {0} property is set to {1}. Corresponding SCPI: {2}",
                     "Trigger", Trigger, Scpi.Format("{0}", Trigger));

            // Like a C# string format, the SCPI class's format can take multiple parameters.
            string formattedScpi = Scpi.Format("Cmd1={0} Cmd2={1}", Trigger, LinkDirection);

            Log.Info("The combined SCPI commands are {0}", formattedScpi);

            // The SCPI class's Format command converts a boolean into the appropriate ON|Off values.
            // This could then be sent to an instrument.
            formattedScpi = Scpi.Format("DISPlay:STATe {0}", DisplayState);
            Log.Info("The formatted Display State SCPI is {0}", formattedScpi);

            // The SCPI parse command takes an "ON" return value and converts it into a boolean.
            string scpiOnOff = "ON";
            bool   csBoolean = Scpi.Parse <bool>(scpiOnOff);

            Log.Info("The SCPI {0} is converted to a C# boolean of {1}", scpiOnOff, csBoolean);

            // The SCPI Parse command takes a enumeration value and SCPI command, and returns the human readable string for the enumeration.
            string myScpi  = "IMM"; // Case sensitive
            var    myAlias = Scpi.Parse <TriggerType>(myScpi);

            Log.Info("The SCPI is {0} and the property value is {1}", myScpi, myAlias);

            // The SCPI parse command takes a SCPI array, and convert it into a C# array.
            // This simulates reading some information from a device, and loading it into C# for further processing.
            string commaSeparatedValues = "1.1,2.2,3.3,4,5";

            double [] myArray         = Scpi.Parse <double[]>(commaSeparatedValues);
            string    myArrayAsString = string.Join(",", myArray);

            Log.Info("The SCPI arrays is {0} and the property value is {1}", commaSeparatedValues, myArrayAsString);
        }
示例#19
0
        public void ScpiAttrTest2()
        {
            var testInstance = new ScpiPropCls {
                Val1 = A.C
            };
            var prop = testInstance.GetType().GetProperty("Val1");

            string str = Scpi.GetUnescapedScpi(testInstance, prop)[0];

            Assert.AreEqual("ASD:BDS Cee", str);
            var    prop2 = testInstance.GetType().GetProperty("Val2");
            string str2  = Scpi.GetUnescapedScpi(testInstance, prop2).OrderBy(s => s).First();

            Assert.AreEqual("ASD:BDS D", str2);
            testInstance.Val2 = true;
            str2 = Scpi.GetUnescapedScpi(testInstance, prop2).OrderBy(s => s).First();
            Assert.AreEqual("ASD:BDS C", str2);
            string str3 = Scpi.GetUnescapedScpi(testInstance, prop2).OrderBy(s => s).Skip(1).First();

            Assert.AreEqual("SCP:IST ON", str3);
        }
示例#20
0
        public override void Run()
        {
            // ToDo: Add test case code.
            RunChildSteps(); //If the step supports child steps.

            MyInst.ScpiCommand(":DISK:CDIRectory {0}", Directory);
            MyInst.ScpiCommand(":DISK:COPY {0},{1}", Cp_source_file, Cp_dest_file);
            MyInst.ScpiCommand(":DISK:DELete {0}", Delete_file);
            MyInst.ScpiCommand(":DISK:LOAD {0},{1}", Load_file_name, Load_destination);
            MyInst.ScpiCommand(":DISK:MDIRectory {0}", Create_directory);
            pwd = MyInst.ScpiQuery <System.String>(Scpi.Format(":DISK:PWD?"), true);
            MyInst.ScpiCommand(":DISK:SEGMented {0}", SagmentedName);
            MyInst.ScpiCommand(":DISK:SAVE:COMPosite {0}", CompositeName);
            MyInst.ScpiCommand(":DISK:SAVE:IMAGe {0},{1},{2},{3},{4},{5}", Image_name, ImageFormat, Scrn_or_grat, CompressionOnOff, Norm_or_inv, Setupinfo_on_Off);
            MyInst.ScpiCommand(":DISK:SAVE:JITTer {0}", Jitter_file_name);
            MyInst.ScpiCommand(":DISK:SAVE:MEASurements {0},{1}", Measurement_file, LegacyMode);
            MyInst.ScpiCommand(":DISK:SAVE:PRECprobe {0},{1}", PRECprobe_name, ProbeChannel);
            MyInst.ScpiCommand(":DISK:SAVE:SETup {0}", Setup_file);
            MyInst.ScpiCommand(":DISK:SAVE:WAVeform {0},{1},{2},{3}", WaveformSource, Wave_file, Wave_file_format, Wave_file_header);
            // UpgradeVerdict(Verdict.Pass);
        }
        public override void Run()
        {
            // ToDo: Add test case code.
            RunChildSteps(); //If the step supports child steps.

            MyInst.ScpiCommand(":MARKer:MODE {0}", MarkMode);
            MyInst.ScpiCommand(":MARKer:TSTArt {0}", Tstart);
            MyInst.ScpiCommand(":MARKer:TSTOp {0}", Tstop);
            MyInst.ScpiCommand(":MARKer:VSTArt {0}", Vstart);
            MyInst.ScpiCommand(":MARKer:VSTOp {0}", Vstop);
            MyInst.ScpiCommand(":MARKer:X1Position {0}", Tstart);
            MyInst.ScpiCommand(":MARKer:X2Position {0}", Tstop);
            MyInst.ScpiCommand(":MARKer:Y1Position {0}", Vstart);
            MyInst.ScpiCommand(":MARKer:Y2Position {0}", Vstop);
            MyInst.ScpiCommand(":MARKer:X1Y1source {0}", X1Y1source);
            MyInst.ScpiCommand(":MARKer:X2Y2source {0}", X2Y2source);
            Xdelta = MyInst.ScpiQuery <System.Double>(Scpi.Format(":MARKer:XDELta?"), true);
            Ydelta = MyInst.ScpiQuery <System.String>(Scpi.Format(":MARKer:YDELta?"), true);
            MyInst.ScpiCommand(":MARKer:DELTa {0}", DeltaStatus);
            measurement = MyInst.ScpiQuery <System.Double>(Scpi.Format(":MARKer:CURSor? {0}", Cursor), true);
            MyInst.ScpiCommand(":MARKer:MEASurement:MEASurement {0}", NameMeasurement);
            // UpgradeVerdict(Verdict.Pass);
        }
示例#22
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="LogOutput"></param>
        /// <param name="enableOutputACP"></param>
        /// <param name="enableOutputBPower"></param>
        /// <param name="enableOutputChPower"></param>
        /// <param name="ACPowerNo"></param>
        /// <param name="BPOWerNo"></param>
        /// <param name="CHPowerNo"></param>
        /// <param name="_OutputACP"></param>
        /// <param name="_OutputBPower"></param>
        /// <param name="_OutputChPower"></param>

        public void Measurements(OpenTap.TraceSource LogOutput, bool enableOutputACP, bool enableOutputBPower, bool enableOutputChPower, uint ACPowerNo, uint BPOWerNo, uint CHPowerNo, ref Single[] _OutputACP, ref Single[] _OutputBPower, ref Single[] _OutputChPower)
        {
            ScpiCommand(":FORMat:TRACe:DATA REAL,32");
            ScpiCommand(":FORMat:BORDer SWAP");
            if (enableOutputACP == true)
            {
                _OutputACP = ScpiQueryBlock <System.Single>(Scpi.Format(":MEASure:ACPower{0}?", ACPowerNo));
                LogOutput.Info("*********************** AC Power ******************");
                LogOutput.Info("************************* " + _OutputACP + " dB *************************");
            }
            if (enableOutputBPower == true)
            {
                _OutputBPower = ScpiQueryBlock <System.Single>(Scpi.Format(":MEASure:BPOWer{0}?", BPOWerNo));
                LogOutput.Info("*********************** Burst Power ******************");
                LogOutput.Info("************************* " + _OutputBPower + " dB *************************");
            }
            if (enableOutputChPower == true)
            {
                _OutputChPower = ScpiQueryBlock <System.Single>(Scpi.Format(":MEASure:CHPower{0}?", CHPowerNo));
                LogOutput.Info("*********************** Channel Power ******************");
                LogOutput.Info("************************* " + _OutputChPower + " dB *************************");
            }
        }
示例#23
0
 /// <inheritdoc />
 public void SetModulationState(EState modulationState)
 {
     ScpiCommand("OUTP:MOD:STAT " + Scpi.Format("{0}", modulationState));
 }
示例#24
0
 public void ScpiAttrTest3()
 {
     object[] args = new object[] { true };
     Scpi.Format("A {0}", args);
     Assert.AreEqual(typeof(bool), args[0].GetType());
 }
示例#25
0
 public void ScpiArrayTest5()
 {
     double[] values = new double[] { 1, 2, 3, 4, 5 };
     double[] result = Scpi.Parse <double[]>(string.Join(",", values));
     Assert.IsTrue(Enumerable.SequenceEqual(values, result));
 }
示例#26
0
        public override void Run()
        {
            // ToDo: Add test case code.
            RunChildSteps(); //If the step supports child steps.

            MyInst.ScpiCommand(":SOURce:ARB:FUNCtion:TYPE {0},{1}", ArbType, ChanList);
            MyInst.ScpiCommand(":SOURce:ARB:FUNCtion:SHAPe {0},{1}", ArbFunction, ChanList);

            // Dwell

            MyInst.ScpiCommand(":SOURce:ARB:CURRent:CDWell:DWELl {0},{1}", CDwellTime, ChanList);
            MyInst.ScpiCommand(":FORMat:DATA ASC");
            MyInst.ScpiCommand(":SOURce:ARB:CURRent:CDWell:LEVel {0},{1}", CDwellLevel, ChanList);
            CDwellPoints = MyInst.ScpiQuery <System.Int32[]>(Scpi.Format(":SOURce:ARB:CURRent:CDWell:POINts? {0}", ChanList), true);
            MyInst.ScpiCommand(":SOURce:ARB:CURRent:CONVert {0}", ChanList);

            // Exponential

            MyInst.ScpiCommand(":SOURce:ARB:CURRent:EXPonential:STARt:LEVel {0},{1}", CExpoStartLevel, ChanList);
            MyInst.ScpiCommand(":SOURce:ARB:CURRent:EXPonential:STARt:TIMe {0},{1}", CExpoStartTime, ChanList);
            MyInst.ScpiCommand(":SOURce:ARB:CURRent:EXPonential:END:LEVel {0},{1}", CExpoEndLevel, ChanList);
            MyInst.ScpiCommand(":SOURce:ARB:CURRent:EXPonential:TIMe {0},{1}", CExpoTime, ChanList);
            MyInst.ScpiCommand(":SOURce:ARB:CURRent:EXPonential:TCONstant {0},{1}", CExpoTimeConst, ChanList);

            // Pulse

            MyInst.ScpiCommand(":SOURce:ARB:CURRent:PULSe:STARt:LEVel {0},{1}", CPulseStartLevel, ChanList);
            MyInst.ScpiCommand(":SOURce:ARB:CURRent:PULSe:STARt:TIMe {0},{1}", CPulseStartTime, ChanList);
            MyInst.ScpiCommand(":SOURce:ARB:CURRent:PULSe:TOP:LEVel {0},{1}", CPulseTopLevel, ChanList);
            MyInst.ScpiCommand(":SOURce:ARB:CURRent:PULSe:TOP:TIMe {0},{1}", CPulseTopTime, ChanList);
            MyInst.ScpiCommand(":SOURce:ARB:CURRent:PULSe:END:TIMe {0},{1}", CPulseEndTime, ChanList);

            // Ramp

            MyInst.ScpiCommand(":SOURce:ARB:CURRent:RAMP:STARt:LEVel {0},{1}", CRampStartLevel, ChanList);
            MyInst.ScpiCommand(":SOURce:ARB:CURRent:RAMP:STARt:TIMe {0},{1}", CRampStartTime, ChanList);
            MyInst.ScpiCommand(":SOURce:ARB:CURRent:RAMP:RTIMe {0},{1}", CRampRtime, ChanList);
            MyInst.ScpiCommand(":SOURce:ARB:CURRent:RAMP:END:LEVel {0},{1}", CRampEndLevel, ChanList);
            MyInst.ScpiCommand(":SOURce:ARB:CURRent:RAMP:END:TIMe {0},{1}", CRampEndTime, ChanList);

            // Sin

            MyInst.ScpiCommand(":SOURce:ARB:CURRent:SINusoid:AMPLitude {0},{1}", CSinAmplitude, ChanList);
            MyInst.ScpiCommand(":SOURce:ARB:CURRent:SINusoid:FREQuency {0},{1}", CSinFreq, ChanList);
            MyInst.ScpiCommand(":SOURce:ARB:CURRent:SINusoid:OFFSet {0},{1}", CSinOffset, ChanList);

            // Stair

            MyInst.ScpiCommand(":SOURce:ARB:CURRent:STAircase:STARt:LEVel {0},{1}", CStairStartLevel, ChanList);
            MyInst.ScpiCommand(":SOURce:ARB:CURRent:STAircase:STARt:TIMe {0},{1}", CStairStartTime, ChanList);
            MyInst.ScpiCommand(":SOURce:ARB:CURRent:STAircase:END:LEVel {0},{1}", CStairEndLevel, ChanList);
            MyInst.ScpiCommand(":SOURce:ARB:CURRent:STAircase:END:TIMe {0},{1}", CStairEndTime, ChanList);
            MyInst.ScpiCommand(":SOURce:ARB:CURRent:STAircase:NSTeps {0},{1}", CStairSteps, ChanList);
            MyInst.ScpiCommand(":SOURce:ARB:CURRent:STAircase:TIMe {0},{1}", CStairTotalTime, ChanList);

            // Step

            MyInst.ScpiCommand(":SOURce:ARB:CURRent:STEP:STARt:LEVel {0},{1}", CStepStartLevel, ChanList);
            MyInst.ScpiCommand(":SOURce:ARB:CURRent:STEP:STARt:TIMe {0},{1}", CStepStartTime, ChanList);
            MyInst.ScpiCommand(":SOURce:ARB:CURRent:STEP:END:LEVel {0},{1}", CStepEndLevel, ChanList);

            // Trapezoidal

            MyInst.ScpiCommand(":SOURce:ARB:CURRent:TRAPezoid:STARt:LEVel {0},{1}", CTrapStartLevel, ChanList);
            MyInst.ScpiCommand(":SOURce:ARB:CURRent:TRAPezoid:STARt:TIMe {0},{1}", CTrapStartTime, ChanList);
            MyInst.ScpiCommand(":SOURce:ARB:CURRent:TRAPezoid:RTIMe {0},{1}", CTrapRiseTime, ChanList);
            MyInst.ScpiCommand(":SOURce:ARB:CURRent:TRAPezoid:TOP:LEVel {0},{1}", CTrapTopLevel, ChanList);
            MyInst.ScpiCommand(":SOURce:ARB:CURRent:TRAPezoid:TOP:TIMe {0},{1}", CTrapTopTime, ChanList);
            MyInst.ScpiCommand(":SOURce:ARB:CURRent:TRAPezoid:FTIMe {0},{1}", CTrapRallTime, ChanList);
            MyInst.ScpiCommand(":SOURce:ARB:CURRent:TRAPezoid:END:TIMe {0},{1}", CTrapEndTime, ChanList);


            MyInst.ScpiCommand(":SOURce:ARB:VOLTage:CDWell:DWELl {0},{1}", VDwellTime, ChanList);
            // UpgradeVerdict(Verdict.Pass);
        }
示例#27
0
 /// <inheritdoc />
 public void SetReferenceOscillatorAutoState(EState oscillatorState)
 {
     ScpiCommand("SOUR:ROSC:SOUR:AUTO " + Scpi.Format("{0}", oscillatorState));
 }
示例#28
0
 /// <inheritdoc />
 public void SetAlcState(EState state)
 {
     ScpiCommand("SOUR:POW:ALC:STAT " + Scpi.Format("{0}", state));
 }
示例#29
0
 public override void Run()
 {
     MyInst.ScpiCommand(":SOURce:CORRection:STATe {0}", FlatnessStatus);
     QueryFlatnessStatus = MyInst.ScpiQuery <System.Boolean>(Scpi.Format(":SOURce:CORRection:STATe?"), true);
 }
示例#30
0
 public void SetArbState(EState arbState)
 {
     Log.Info("Sg:Set Arb State " + arbState);
     ScpiCommand("SOUR:RAD:ARB:STAT " + Scpi.Format("{0}", arbState));
 }