EasyManua.ls Logo

Rigol DSA832E

Rigol DSA832E
243 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
RIGOL Chapter 3 Programming Demos
3-8 DSA800E Programming Guide
strAddr.ReleaseBuffer();
//Open a VISA resource
status = viOpenDefaultRM(&m_SessRM);
if (status == 0)
{
//Open the device
status = viOpen(m_SessRM, SendAddr, VI_NULL, VI_NULL, &m_SessInstr);
//If you fails to open the connection, close the resource
if (status != 0)
{
viClose(m_SessRM);
}
}
return status;
}
ViStatus CDemoForDSADlg::CloseVisaDevice() //Close a VISA device
{
ViStatus status;
//Close the device
status = viClose(m_SessInstr);
if (status == 0)
{
//close the resource
status = viClose(m_SessRM);
}
return status;
}
bool CDemoForDSADlg::InstrWriteEx(CString strAddr, CString strContent) //Write operation with
exception handling
{
ViStatus status;
ViUInt32 retCount;
char * SendBuf = NULL;
bool bWriteOK = true;
// Change the address's data style from CString to char*
SendBuf = strContent.GetBuffer(strContent.GetLength());
strcpy(SendBuf,strContent);
strContent.ReleaseBuffer();
do
{
//Write command to the instrument
status = viWrite(m_SessInstr, (unsigned char *)SendBuf, strlen(SendBuf), &retCount);
//If an error occurs, perform error handing
if (status < 0)

Table of Contents

Other manuals for Rigol DSA832E

Related product manuals