public VIConfig( )
 {
     //Default constructor. Use some default values
     this._type    = DEFAULT_TYPE;
     this._acdc    = DEFAULT_ACDC;
     this._average = DEFAULT_AVERAGE;
 }
        /// <summary>
        /// Sets the function of the source to voltage or current
        /// </summary>
        /// <param name="type">Voltage or current selection</param>
        protected virtual void setSourceFunction(VIType type)
        {
            string wrt = string.Empty;

            try {
                wrt = String.Format("SOUR:FUNC:MODE {0}", type.ToString( ).ToUpper( ).Substring(0, 4));
                this.gpib.Write(wrt);
            }
            catch (Exception ex) {
                throw new Exception(ex.Message + this.gpib.Device.PrimaryAddress + wrt);
            }
        }
        /// <summary>
        /// Sets the output level of the source according to voltage / current selection
        /// </summary>
        /// <param name="level">The voltage or current level in absolute units (V or A)</param>
        /// <param name="type">Voltage or current selection</param>
        private void setOutputLevel(float level, VIType type)
        {
            string wrt = string.Empty;

            try {
                wrt = "*CLS";
                this.gpib.Device.Write(wrt);
                wrt = ":ABOR";
                this.gpib.Device.Write(wrt);
                wrt = string.Format(":SOUR:{0}:LEV:IMM:AMPL {1}", type.ToString( ).Substring(0, 4), level.ToString( ));
                //wrt = string.Format( ":SOUR:{0}:LEV {1}", type.ToString( ).Substring( 0, 4 ), level.ToString( ) );
                this.gpib.Device.Write(wrt);
                this.Init( );
            }
            catch (Exception ex) {
                throw new Exception(ex.Message + this.gpib.Device.PrimaryAddress.ToString( ) + wrt);
            }
        }
        /// <summary>
        /// Sets measurement function to V/I AC/DC values
        /// </summary>
        /// <param name="type">V/I</param>
        /// <param name="acdcType">AC/DC</param>
        public virtual void setMeasureFunction(VIType type, ACDCType acdcType)
        {
            string wrt = string.Empty;

            try {
                if (this.settings.SourceOrMeasurement == SourceMeasurement.Measurement || this.settings.SourceOrMeasurement == SourceMeasurement.SourceMeasurement)
                {
                    wrt = string.Format("SENS:FUNC '{0}:{1}'", type.ToString( ).ToUpper( ).Substring(0, 4), acdcType.ToString( ).ToUpper( ));
                }
                else
                {
                    wrt = string.Format("INCORRECT CONFIGURATION FOR {0}. Must be configured as measurement if inside SetMeasureFunction( ).", this.Name);
                }
                this.gpib.Write(wrt);
                this.measurementVI   = ( VIType )type;
                this.measurementACDC = ( ACDCType )acdcType;
            }
            catch (Exception ex) {
                throw new Exception(ex.Message + this.gpib.Device.PrimaryAddress.ToString());
            }
        }
 protected override void setSourceFunction(VIType type)
 {
 }
 public override void setMeasureFunction(VIType type, ACDCType acdcType)
 {
 }
 /// <summary>
 /// Private method to return measurement based on input argument
 /// </summary>
 /// <param name="type">VIType argument selects voltage or current</param>
 /// <returns>Double level of voltage or current</returns>
 private double measureByType(VIType type)
 {
     //return type == VIType.Voltage ? this.measureVoltage( ) : this.measureCurrent( );
     return(this.measureInvariant( ));
 }
 public VIConfig(VIType type, ACDCType acdc)
 {
     this._type    = type;
     this._acdc    = acdc;
     this._average = DEFAULT_AVERAGE;
 }
 public VIConfig(VIType type, ACDCType acdc, int average)
 {
     this._type    = type;
     this._acdc    = acdc;
     this._average = average;
 }
 public static VIType Opposite(this VIType type)
 {
     return(type == VIType.Current ? VIType.Voltage : VIType.Current);  //order changed
 }