/******************************************************************************
 *                                                                         
 *               Nimbus auto-generated file
 *               !!! WARNING !!! -- DO NOT DIRECTLY EDIT THE CONTENTS OF THIS FILE.
 *				 Changes will be OVERWRITTEN by NIMBUS.
 *
 *****************************************************************************/
#include "StdAfx.h"
#include "CoAgilent34959A.h"


HRESULT IAgilent34959A_get_Digital(Agilent34959A* pT, IAgilent34959ADigital** val)
{
	Agilent34959A::ObjectLock lock(pT);
	CCallContext context(pT, _T("Agilent34959A"), _T("IAgilent34959A"), _T("get_Digital"));
	NTL_METHOD_START(IAgilent34959A, get_Digital);
	if (val == NULL) return pT->ReportError(IDS_E_IVI_NULL_POINTER, _T("get_Digital"), _T("val"));
		*val = NULL;
	CMethodTrace mt(pT, _T("IAgilent34959A"), _T("get_Digital"), OUT_PARAM(val), NULL);

	CString strCmd;
	CString strModel = pT->GetModel();

	HRESULT hr = S_OK;
	pT->PushInstrCommand(strCmd);
	hr = pT->IAgilent34959A_get_Digital(val);
	pT->PopInstrCommand();

	return hr;
}
HRESULT IAgilent34959A_get_Route(Agilent34959A* pT, IAgilent34959ARoute** val)
{
	Agilent34959A::ObjectLock lock(pT);
	CCallContext context(pT, _T("Agilent34959A"), _T("IAgilent34959A"), _T("get_Route"));
	NTL_METHOD_START(IAgilent34959A, get_Route);
	if (val == NULL) return pT->ReportError(IDS_E_IVI_NULL_POINTER, _T("get_Route"), _T("val"));
		*val = NULL;
	CMethodTrace mt(pT, _T("IAgilent34959A"), _T("get_Route"), OUT_PARAM(val), NULL);

	CString strCmd;
	CString strModel = pT->GetModel();

	HRESULT hr = S_OK;
	pT->PushInstrCommand(strCmd);
	hr = pT->IAgilent34959A_get_Route(val);
	pT->PopInstrCommand();

	return hr;
}
HRESULT IAgilent34959ARoute_Close(Agilent34959A* pT, BSTR ChannelList)
{
	Agilent34959A::ObjectLock lock(pT);
	CCallContext context(pT, _T("Agilent34959A"), _T("IAgilent34959ARoute"), _T("Close"));
	NTL_METHOD_START(IAgilent34959ARoute, Close);
	CMethodTrace mt(pT, _T("IAgilent34959ARoute"), _T("Close"), IN_PARAM(ChannelList), NULL);

	CString strCmd;
	CString strModel = pT->GetModel();

	strCmd.Format(_T(":ROUT:CLOS (@%s)"), LPCTSTR(COLE2T(ChannelList)));
	HRESULT hr = S_OK;
	pT->PushInstrCommand(strCmd);
	hr = pT->IAgilent34959ARoute_Close(ChannelList);
	pT->PopInstrCommand();

	return hr;
}
HRESULT IAgilent34959ARoute_Open(Agilent34959A* pT, BSTR ChannelList)
{
	Agilent34959A::ObjectLock lock(pT);
	CCallContext context(pT, _T("Agilent34959A"), _T("IAgilent34959ARoute"), _T("Open"));
	NTL_METHOD_START(IAgilent34959ARoute, Open);
	CMethodTrace mt(pT, _T("IAgilent34959ARoute"), _T("Open"), IN_PARAM(ChannelList), NULL);

	CString strCmd;
	CString strModel = pT->GetModel();

	strCmd.Format(_T(":ROUT:OPEN (@%s)"), LPCTSTR(COLE2T(ChannelList)));
	HRESULT hr = S_OK;
	pT->PushInstrCommand(strCmd);
	hr = pT->IAgilent34959ARoute_Open(ChannelList);
	pT->PopInstrCommand();

	return hr;
}
HRESULT IAgilent34959ARoute_OpenAll(Agilent34959A* pT, long Slot)
{
	Agilent34959A::ObjectLock lock(pT);
	CCallContext context(pT, _T("Agilent34959A"), _T("IAgilent34959ARoute"), _T("OpenAll"));
	NTL_METHOD_START(IAgilent34959ARoute, OpenAll);
	CMethodTrace mt(pT, _T("IAgilent34959ARoute"), _T("OpenAll"), IN_PARAM(Slot), NULL);

	CString strCmd;
	CString strModel = pT->GetModel();

	strCmd.Format(_T(":ROUT:OPEN:ALL %d"), Slot);
	HRESULT hr = S_OK;
	pT->PushInstrCommand(strCmd);
	hr = pT->IAgilent34959ARoute_OpenAll(Slot);
	pT->PopInstrCommand();

	return hr;
}
HRESULT IAgilent34959ARoute_get_IsClosed(Agilent34959A* pT, BSTR Channel, VARIANT_BOOL* val)
{
	Agilent34959A::ObjectLock lock(pT);
	CCallContext context(pT, _T("Agilent34959A"), _T("IAgilent34959ARoute"), _T("get_IsClosed"));
	NTL_METHOD_START(IAgilent34959ARoute, get_IsClosed);
	if (val == NULL) return pT->ReportError(IDS_E_IVI_NULL_POINTER, _T("get_IsClosed"), _T("val"));
		*val = VARIANT_TRUE;
	CMethodTrace mt(pT, _T("IAgilent34959ARoute"), _T("get_IsClosed"), IN_PARAM(Channel), OUT_PARAM(val), NULL);

	CString strCmd;
	CString strModel = pT->GetModel();

	strCmd.Format(_T(":ROUT:CLOSE? (@%s)"), LPCTSTR(COLE2T(Channel)));
	HRESULT hr = S_OK;
	pT->PushInstrCommand(strCmd);
	hr = pT->IAgilent34959ARoute_get_IsClosed(Channel, val);
	pT->PopInstrCommand();

	return hr;
}
HRESULT IAgilent34959ADigital_Configure(Agilent34959A* pT, BSTR ChannelList, Agilent34959AWidthEnum Width, Agilent34959ADirectionEnum Direction)
{
	Agilent34959A::ObjectLock lock(pT);
	CCallContext context(pT, _T("Agilent34959A"), _T("IAgilent34959ADigital"), _T("Configure"));
	NTL_METHOD_START(IAgilent34959ADigital, Configure);
	CMethodTrace mt(pT, _T("IAgilent34959ADigital"), _T("Configure"), IN_PARAM(ChannelList), IN_PARAM(Width), IN_PARAM(Direction), NULL);

	CString strCmd;
	CString strModel = pT->GetModel();

	strCmd.Format(_T("CONF:DIG:WIDT %s, (@%s); :CONF:DIG:DIR %s, (@%s)"), pT->EnumToString<Agilent34959AWidthEnum>(Width), LPCTSTR(COLE2T(ChannelList)), pT->EnumToString<Agilent34959ADirectionEnum>(Direction), LPCTSTR(COLE2T(ChannelList)));
	HRESULT hr = S_OK;
	pT->PushInstrCommand(strCmd);
	hr = pT->IAgilent34959ADigital_Configure(ChannelList, Width, Direction);
	pT->PopInstrCommand();

	return hr;
}
HRESULT IAgilent34959ADigital_QueryLastBit(Agilent34959A* pT, BSTR ChannelList, long BitNumber, VARIANT_BOOL* val)
{
	Agilent34959A::ObjectLock lock(pT);
	CCallContext context(pT, _T("Agilent34959A"), _T("IAgilent34959ADigital"), _T("QueryLastBit"));
	NTL_METHOD_START(IAgilent34959ADigital, QueryLastBit);
	if (val == NULL) return pT->ReportError(IDS_E_IVI_NULL_POINTER, _T("QueryLastBit"), _T("val"));
		*val = VARIANT_TRUE;
	CMethodTrace mt(pT, _T("IAgilent34959ADigital"), _T("QueryLastBit"), IN_PARAM(ChannelList), IN_PARAM(BitNumber), OUT_PARAM(val), NULL);

	CString strCmd;
	CString strModel = pT->GetModel();

	strCmd.Format(_T(":SOUR:DIG:DATA:BIT? %d, (@%s)"), BitNumber, LPCTSTR(COLE2T(ChannelList)));
	HRESULT hr = S_OK;
	pT->PushInstrCommand(strCmd);
	hr = pT->IAgilent34959ADigital_QueryLastBit(ChannelList, BitNumber, val);
	pT->PopInstrCommand();

	return hr;
}
HRESULT IAgilent34959ADigital_QueryLastByte(Agilent34959A* pT, BSTR ChannelList, BYTE* val)
{
	Agilent34959A::ObjectLock lock(pT);
	CCallContext context(pT, _T("Agilent34959A"), _T("IAgilent34959ADigital"), _T("QueryLastByte"));
	NTL_METHOD_START(IAgilent34959ADigital, QueryLastByte);
	if (val == NULL) return pT->ReportError(IDS_E_IVI_NULL_POINTER, _T("QueryLastByte"), _T("val"));
		*val = 0;
	CMethodTrace mt(pT, _T("IAgilent34959ADigital"), _T("QueryLastByte"), IN_PARAM(ChannelList), OUT_PARAM(val), NULL);

	CString strCmd;
	CString strModel = pT->GetModel();

	strCmd.Format(_T(":SOUR:DIG:DATA? (@%s)"), LPCTSTR(COLE2T(ChannelList)));
	HRESULT hr = S_OK;
	pT->PushInstrCommand(strCmd);
	hr = pT->IAgilent34959ADigital_QueryLastByte(ChannelList, val);
	pT->PopInstrCommand();

	return hr;
}
HRESULT IAgilent34959ADigital_QueryLastWord(Agilent34959A* pT, BSTR ChannelList, short* val)
{
	Agilent34959A::ObjectLock lock(pT);
	CCallContext context(pT, _T("Agilent34959A"), _T("IAgilent34959ADigital"), _T("QueryLastWord"));
	NTL_METHOD_START(IAgilent34959ADigital, QueryLastWord);
	if (val == NULL) return pT->ReportError(IDS_E_IVI_NULL_POINTER, _T("QueryLastWord"), _T("val"));
		*val = 0;
	CMethodTrace mt(pT, _T("IAgilent34959ADigital"), _T("QueryLastWord"), IN_PARAM(ChannelList), OUT_PARAM(val), NULL);

	CString strCmd;
	CString strModel = pT->GetModel();

	strCmd.Format(_T(":SOUR:DIG:DATA:WORD? (@%s)"), LPCTSTR(COLE2T(ChannelList)));
	HRESULT hr = S_OK;
	pT->PushInstrCommand(strCmd);
	hr = pT->IAgilent34959ADigital_QueryLastWord(ChannelList, val);
	pT->PopInstrCommand();

	return hr;
}
HRESULT IAgilent34959ADigital_ReadBit(Agilent34959A* pT, BSTR Channel, long BitNumber, VARIANT_BOOL* val)
{
	Agilent34959A::ObjectLock lock(pT);
	CCallContext context(pT, _T("Agilent34959A"), _T("IAgilent34959ADigital"), _T("ReadBit"));
	NTL_METHOD_START(IAgilent34959ADigital, ReadBit);
	if (val == NULL) return pT->ReportError(IDS_E_IVI_NULL_POINTER, _T("ReadBit"), _T("val"));
		*val = VARIANT_TRUE;
	CMethodTrace mt(pT, _T("IAgilent34959ADigital"), _T("ReadBit"), IN_PARAM(Channel), IN_PARAM(BitNumber), OUT_PARAM(val), NULL);

	CString strCmd;
	CString strModel = pT->GetModel();

	strCmd.Format(_T(":DIG:DATA:BIT? %d, (@%s)"), BitNumber, LPCTSTR(COLE2T(Channel)));
	HRESULT hr = S_OK;
	pT->PushInstrCommand(strCmd);
	hr = pT->IAgilent34959ADigital_ReadBit(Channel, BitNumber, val);
	pT->PopInstrCommand();

	return hr;
}
HRESULT IAgilent34959ADigital_ReadByte(Agilent34959A* pT, BSTR ChannelList, BYTE* val)
{
	Agilent34959A::ObjectLock lock(pT);
	CCallContext context(pT, _T("Agilent34959A"), _T("IAgilent34959ADigital"), _T("ReadByte"));
	NTL_METHOD_START(IAgilent34959ADigital, ReadByte);
	if (val == NULL) return pT->ReportError(IDS_E_IVI_NULL_POINTER, _T("ReadByte"), _T("val"));
		*val = 0;
	CMethodTrace mt(pT, _T("IAgilent34959ADigital"), _T("ReadByte"), IN_PARAM(ChannelList), OUT_PARAM(val), NULL);

	CString strCmd;
	CString strModel = pT->GetModel();

	strCmd.Format(_T(" :DIG:DATA:BYTE? (@%s)"), LPCTSTR(COLE2T(ChannelList)));
	HRESULT hr = S_OK;
	pT->PushInstrCommand(strCmd);
	hr = pT->IAgilent34959ADigital_ReadByte(ChannelList, val);
	pT->PopInstrCommand();

	return hr;
}
HRESULT IAgilent34959ADigital_ReadWord(Agilent34959A* pT, BSTR ChannelList, short* val)
{
	Agilent34959A::ObjectLock lock(pT);
	CCallContext context(pT, _T("Agilent34959A"), _T("IAgilent34959ADigital"), _T("ReadWord"));
	NTL_METHOD_START(IAgilent34959ADigital, ReadWord);
	if (val == NULL) return pT->ReportError(IDS_E_IVI_NULL_POINTER, _T("ReadWord"), _T("val"));
		*val = 0;
	CMethodTrace mt(pT, _T("IAgilent34959ADigital"), _T("ReadWord"), IN_PARAM(ChannelList), OUT_PARAM(val), NULL);

	CString strCmd;
	CString strModel = pT->GetModel();

	strCmd.Format(_T(" :DIG:DATA:WORD? (@%s)"), LPCTSTR(COLE2T(ChannelList)));
	HRESULT hr = S_OK;
	pT->PushInstrCommand(strCmd);
	hr = pT->IAgilent34959ADigital_ReadWord(ChannelList, val);
	pT->PopInstrCommand();

	return hr;
}
HRESULT IAgilent34959ADigital_WriteBit(Agilent34959A* pT, BSTR ChannelList, long BitNumber, VARIANT_BOOL Data)
{
	Agilent34959A::ObjectLock lock(pT);
	CCallContext context(pT, _T("Agilent34959A"), _T("IAgilent34959ADigital"), _T("WriteBit"));
	NTL_METHOD_START(IAgilent34959ADigital, WriteBit);
	CMethodTrace mt(pT, _T("IAgilent34959ADigital"), _T("WriteBit"), IN_PARAM(ChannelList), IN_PARAM(BitNumber), IN_PARAM(Data), NULL);

	CString strCmd;
	CString strModel = pT->GetModel();

	strCmd.Format(_T(":SOUR:DIG:DATA:BIT %s, %d, (@%s)"), Data == VARIANT_FALSE ? "0" : "1", BitNumber, LPCTSTR(COLE2T(ChannelList)));
	HRESULT hr = S_OK;
	pT->PushInstrCommand(strCmd);
	hr = pT->IAgilent34959ADigital_WriteBit(ChannelList, BitNumber, Data);
	pT->PopInstrCommand();

	return hr;
}
HRESULT IAgilent34959ADigital_WriteByte(Agilent34959A* pT, BSTR ChannelList, BYTE Data)
{
	Agilent34959A::ObjectLock lock(pT);
	CCallContext context(pT, _T("Agilent34959A"), _T("IAgilent34959ADigital"), _T("WriteByte"));
	NTL_METHOD_START(IAgilent34959ADigital, WriteByte);
	CMethodTrace mt(pT, _T("IAgilent34959ADigital"), _T("WriteByte"), IN_PARAM(ChannelList), IN_PARAM(Data), NULL);

	CString strCmd;
	CString strModel = pT->GetModel();

	strCmd.Format(_T(":SOUR:DIG:DATA %d, (@%s)"), Data, LPCTSTR(COLE2T(ChannelList)));
	HRESULT hr = S_OK;
	pT->PushInstrCommand(strCmd);
	hr = pT->IAgilent34959ADigital_WriteByte(ChannelList, Data);
	pT->PopInstrCommand();

	return hr;
}
HRESULT IAgilent34959ADigital_WriteWord(Agilent34959A* pT, BSTR ChannelList, short Data)
{
	Agilent34959A::ObjectLock lock(pT);
	CCallContext context(pT, _T("Agilent34959A"), _T("IAgilent34959ADigital"), _T("WriteWord"));
	NTL_METHOD_START(IAgilent34959ADigital, WriteWord);
	CMethodTrace mt(pT, _T("IAgilent34959ADigital"), _T("WriteWord"), IN_PARAM(ChannelList), IN_PARAM(Data), NULL);

	CString strCmd;
	CString strModel = pT->GetModel();

	strCmd.Format(_T(":SOUR:DIG:DATA:WORD %d,(@%s)"), Data, LPCTSTR(COLE2T(ChannelList)));
	HRESULT hr = S_OK;
	pT->PushInstrCommand(strCmd);
	hr = pT->IAgilent34959ADigital_WriteWord(ChannelList, Data);
	pT->PopInstrCommand();

	return hr;
}
HRESULT IAgilent34959ADigital_get_Direction(Agilent34959A* pT, BSTR ChannelList, Agilent34959ADirectionEnum* val)
{
	Agilent34959A::ObjectLock lock(pT);
	CCallContext context(pT, _T("Agilent34959A"), _T("IAgilent34959ADigital"), _T("get_Direction"));
	NTL_METHOD_START(IAgilent34959ADigital, get_Direction);
	if (val == NULL) return pT->ReportError(IDS_E_IVI_NULL_POINTER, _T("get_Direction"), _T("val"));
		*val = Agilent34959ADirectionInput;
	CMethodTrace mt(pT, _T("IAgilent34959ADigital"), _T("get_Direction"), IN_PARAM(ChannelList), OUT_PARAM(val), NULL);

	CString strCmd;
	CString strModel = pT->GetModel();

	strCmd.Format(_T(":CONF:DIG:DIR? (@%s)"), LPCTSTR(COLE2T(ChannelList)));
	HRESULT hr = S_OK;
	pT->PushInstrCommand(strCmd);
	hr = pT->IAgilent34959ADigital_get_Direction(ChannelList, val);
	pT->PopInstrCommand();

	return hr;
}
HRESULT IAgilent34959ADigital_put_Direction(Agilent34959A* pT, BSTR ChannelList, Agilent34959ADirectionEnum val)
{
	Agilent34959A::ObjectLock lock(pT);
	CCallContext context(pT, _T("Agilent34959A"), _T("IAgilent34959ADigital"), _T("put_Direction"));
	NTL_METHOD_START(IAgilent34959ADigital, put_Direction);
	CMethodTrace mt(pT, _T("IAgilent34959ADigital"), _T("put_Direction"), IN_PARAM(ChannelList), IN_PARAM(val), NULL);

	CString strCmd;
	CString strModel = pT->GetModel();

	strCmd.Format(_T(":CONF:DIG:DIR %s, (@%s)"), pT->EnumToString<Agilent34959ADirectionEnum>(val), LPCTSTR(COLE2T(ChannelList)));
	HRESULT hr = S_OK;
	pT->PushInstrCommand(strCmd);
	hr = pT->IAgilent34959ADigital_put_Direction(ChannelList, val);
	pT->PopInstrCommand();

	return hr;
}
HRESULT IAgilent34959ADigital_get_Width(Agilent34959A* pT, BSTR ChannelList, Agilent34959AWidthEnum* val)
{
	Agilent34959A::ObjectLock lock(pT);
	CCallContext context(pT, _T("Agilent34959A"), _T("IAgilent34959ADigital"), _T("get_Width"));
	NTL_METHOD_START(IAgilent34959ADigital, get_Width);
	if (val == NULL) return pT->ReportError(IDS_E_IVI_NULL_POINTER, _T("get_Width"), _T("val"));
		*val = Agilent34959AWidthByte;
	CMethodTrace mt(pT, _T("IAgilent34959ADigital"), _T("get_Width"), IN_PARAM(ChannelList), OUT_PARAM(val), NULL);

	CString strCmd;
	CString strModel = pT->GetModel();

	strCmd.Format(_T(":CONF:DIG:WIDT? (@%s)"), LPCTSTR(COLE2T(ChannelList)));
	HRESULT hr = S_OK;
	pT->PushInstrCommand(strCmd);
	hr = pT->IAgilent34959ADigital_get_Width(ChannelList, val);
	pT->PopInstrCommand();

	return hr;
}
HRESULT IAgilent34959ADigital_put_Width(Agilent34959A* pT, BSTR ChannelList, Agilent34959AWidthEnum val)
{
	Agilent34959A::ObjectLock lock(pT);
	CCallContext context(pT, _T("Agilent34959A"), _T("IAgilent34959ADigital"), _T("put_Width"));
	NTL_METHOD_START(IAgilent34959ADigital, put_Width);
	CMethodTrace mt(pT, _T("IAgilent34959ADigital"), _T("put_Width"), IN_PARAM(ChannelList), IN_PARAM(val), NULL);

	CString strCmd;
	CString strModel = pT->GetModel();

	strCmd.Format(_T(":CONF:DIG:WIDT %s, (@%s)"), pT->EnumToString<Agilent34959AWidthEnum>(val), LPCTSTR(COLE2T(ChannelList)));
	HRESULT hr = S_OK;
	pT->PushInstrCommand(strCmd);
	hr = pT->IAgilent34959ADigital_put_Width(ChannelList, val);
	pT->PopInstrCommand();

	return hr;
}

