Example #1
0
        public void SetMeasureVoltMode(EnumDACType voltType)
        {
            string strCmd = "";

            strCmd = string.Format(":CONFigure:VOLTage:{0}", voltType == EnumDACType.AC ? "AC" : "DC");
            K2000.GPIBwr(strCmd);
        }
Example #2
0
        //public EnumVoltUnit GetVoltUnit(EnumDACType voltType)
        //{
        //    string strCmd = "";
        //    strCmd = string.Format(":UNIT:VOLTage:{0}?", voltType == EnumDACType.AC ? "AC" : "DC");
        //    string strRet = Query(strCmd).ToString().Trim().Replace("\r","").Replace("\n","");
        //    if (strRet.ToUpper() == "V")
        //        return EnumVoltUnit.V;
        //    else if (strRet.ToUpper() == "DB")
        //        return EnumVoltUnit.DB;
        //    else if (strRet.ToUpper() == "DBM")
        //        return EnumVoltUnit.DBM;
        //    else
        //        throw new Exception(string.Format("Invalid volt unit while get {0} unit", voltType == EnumDACType.AC ? "AC" : "DC"));
        //}

        //public bool SetVoltAutoRange(EnumDACType voltType,bool bEnable)
        //{
        //    string strCmd = "";
        //    strCmd = string.Format("VOLTage:{0}:RANGe:AUTO {1}", voltType == EnumDACType.AC ? "AC" : "DC", bEnable ? "ON" : "OFF");
        //    return (bool)Excute(strCmd);
        //}

        public void SetCurrentAutoRange(EnumDACType voltType, bool bEnable)
        {
            string strCmd = "";

            strCmd = string.Format("CURRent:{0}:RANGe:AUTO {1}", voltType == EnumDACType.AC ? "AC" : "DC", bEnable ? "ON" : "OFF");
            K2000.GPIBwr(strCmd);
        }
Example #3
0
        public void SetVoltUnit(EnumDACType voltType, EnumVoltUnit unit)
        {
            string strCmd  = "";
            string strUnit = "";

            switch (unit)
            {
            case EnumVoltUnit.V:
                strUnit = "V";
                break;

            case EnumVoltUnit.DB:
                strUnit = "DB";
                break;

            default:
                strUnit = "DBM";
                break;
            }
            strCmd = string.Format(":UNIT:VOLTage:{0} {1}", voltType == EnumDACType.AC? "AC":"DC", strUnit);
            K2000.GPIBwr(strCmd);
        }