EasyManuals Logo

Rigol DSA832E Programming Guide

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
Page #223 background imageLoading...
Page #223 background image
Chapter 3 Programming Demos RIGOL
DSA800E Programming Guide 3-9
{
//If the time exceed the limit value, resend the command after a delay of 1s
if (VI_ERROR_TMO == status)
{
Sleep(1000);
status = viWrite(m_SessInstr, (unsigned char *)SendBuf, strlen(SendBuf),
&retCount);
}
else
{
//If another error occurs, reopen the connection after the connection is closed and
resend the command
status = CloseVisaDevice();
Sleep(1000);
status = OpenVisaDevice(m_strInstrAddr);
if (status == 0)
{
status = viWrite(m_SessInstr, (unsigned char *)SendBuf, strlen(SendBuf),
&retCount);
}
}
}
} while (status < 0);
return bWriteOK;
}
bool CDemoForDSADlg::InstrReadEx(CString strAddr, CString *pstrResult) //Read operation with
exception handling
{
ViStatus status;
ViUInt32 retCount;
char * SendAddr = NULL;
unsigned char RecBuf[MAX_REC_SIZE];
bool bReadOK = true;
// Change the address's data style from CString to char*
SendAddr = strAddr.GetBuffer(strAddr.GetLength());
strcpy(SendAddr,strAddr);
strAddr.ReleaseBuffer();
memset(RecBuf,0,MAX_REC_SIZE);
do
{
//Read from the instrument
status = viRead(m_SessInstr, RecBuf, MAX_REC_SIZE, &retCount);
if (status < 0)
{
//If the time exceed the limit value, read from the instrument after a delay of 1s
if (VI_ERROR_TMO == status)
{
Sleep(1000);
status = viRead(m_SessInstr, RecBuf, MAX_REC_SIZE, &retCount);
}
else
{

Table of Contents

Other manuals for Rigol DSA832E

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Rigol DSA832E and is the answer not in the manual?

Rigol DSA832E Specifications

General IconGeneral
BrandRigol
ModelDSA832E
CategoryMeasuring Instruments
LanguageEnglish

Related product manuals