/******************************************************************************
 *                                                                         
 *               Copyright 2004-2006 Agilent Technologies
 *               All rights reserved.
 *
 *****************************************************************************/
 
#include "stdafx.h"
#include "CoAgilent34950A.h"




/// <summary>
/// Configures the specified channels as an output of the specified width.
/// </summary>
/// <remarks>
/// The level value may range from 1.66V to 5.0V in 20mV steps.
/// </remarks>
/// <returns>
///	
/// </returns>
/// <param name="ChannelList">
///	One or more channels in the form sccc.
/// </param>
/// <param name="Width">
///	Sets the width of the digital channel.
/// </param>
/// <param name="VoltageLevel">
///	Sets the voltage level.
/// </param>
HRESULT Agilent34950A::IAgilent34950AOutput_Configure(BSTR ChannelList, Agilent34950AChannelWidthEnum Width, double VoltageLevel)
{
	HRESULT hr = S_OK;

	hr = InstrPrintCommand();

	return hr;
}

/// <summary>
///	Sets or gets the output driver mode.
/// </summary>
/// <remarks>
///	Active means the digital lines will be driven by the module. Open Collector
/// means that the digital lines will be driven low, but will go to HiZ when in
/// the asserted state.  With external pull-ups on the line, open collector mode
/// allows multiple outputs to be connected together.  The query form returns ACT
/// or OCOL. Can be sent any time, but the setting applies only when the channel
/// is an output.
/// </remarks>
/// <param name="ChannelList">
///	One or more channels in the form sccc.
/// </param>
HRESULT Agilent34950A::IAgilent34950AOutput_get_Drive(BSTR ChannelList, Agilent34950AHandshakeLineTypeEnum* val)
{
	HRESULT hr = S_OK;

	hr = InstrQueryCommandEnum(val);

	return hr;
}

/// <summary>
///	Sets or gets the output driver mode.
/// </summary>
/// <remarks>
///	Active means the digital lines will be driven by the module. Open Collector
/// means that the digital lines will be driven low, but will go to HiZ when in
/// the asserted state.  With external pull-ups on the line, open collector mode
/// allows multiple outputs to be connected together.  The query form returns ACT
/// or OCOL. Can be sent any time, but the setting applies only when the channel
/// is an output.
/// </remarks>
/// <param name="ChannelList">
///	One or more channels in the form sccc.
/// </param>
HRESULT Agilent34950A::IAgilent34950AOutput_put_Drive(BSTR ChannelList, Agilent34950AHandshakeLineTypeEnum val)
{
	HRESULT hr = S_OK;

	hr = InstrPrintCommand();

	return hr;
}

/// <summary>
///	Sets or gets the voltage level output by the digital out when it is outputting
/// a logic 1.
/// </summary>
/// <remarks>
///	The level can range from 1.66V (default) to 5V in ~20mV steps.  This command
/// can be sent at any time, but the setting applies only when the channel is an
/// output. The query form returns the current setting.
/// </remarks>
/// <param name="ChannelList">
///	One or more channels in the form sccc.
/// </param>
HRESULT Agilent34950A::IAgilent34950AOutput_get_VoltLevel(BSTR ChannelList, double* val)
{
	HRESULT hr = S_OK;

	hr = InstrQueryCommand(val);

	return hr;
}

/// <summary>
///	Sets or gets the voltage level output by the digital out when it is outputting
/// a logic 1.
/// </summary>
/// <remarks>
///	The level can range from 1.66V (default) to 5V in ~20mV steps.  This command
/// can be sent at any time, but the setting applies only when the channel is an
/// output. The query form returns the current setting.
/// </remarks>
/// <param name="ChannelList">
///	One or more channels in the form sccc.
/// </param>
HRESULT Agilent34950A::IAgilent34950AOutput_put_VoltLevel(BSTR ChannelList, double val)
{
	HRESULT hr = S_OK;

	hr = InstrPrintCommand();

	return hr;
}

/// <summary>
///	Pointer to the IAgilent34950AOutputMemory interface.
/// </summary>
/// <remarks>
///	
/// </remarks>
HRESULT Agilent34950A::IAgilent34950AOutput_get_Memory(IAgilent34950AOutputMemory** val)
{
	HRESULT hr = S_OK;

	hr = InternalQueryInterface(this, _GetEntries(), __uuidof(*val), reinterpret_cast<void**>(val));

	return hr;
}
