EasyManua.ls Logo

Rigol DSA832E - Page 239

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...
Chapter 3 Programming Demos RIGOL
DSA800E Programming Guide 3-25
string strInstr = "";
ViChar instrDesc[1000];
unsigned long i = 0;
bool bFindDSA = false;
memset(instrDesc,0,1000);
//Turn on the VISA device
status = viOpenDefaultRM(&defaultRM);
if (status < VI_SUCCESS)
{
cout<<"No VISA equipment!"<<endl;
return false;
}
//Search for resource
status = viFindRsrc(defaultRM,expr,findList, retcnt, instrDesc);
for (i = 0;i < (*retcnt);i++)
{
//Acquire the instrument name
strSrc=
InstrWrite(strSrc,"*IDN?");
usleep(200);
InstrRead(strSrc,strInstr);
//If the instrument is DSA series, the desired instrument is found and exit
makeupper(strInstr);
if (strInstr.find("DSA",0) > 0)
{
bFindDSA = true;
m_strInstrAddr = strSrc;
break;
}
//Acquire the next device
status = viFindNext(*findList,instrDesc);
}
if (bFindDSA == false)
{
printf("DSA device not found!\n");
return false;
}
return true;
}
bool DemoForDSA::InstrWrite(string strAddr, string strContent) //Write operation
{
ViSession defaultRM,instr;
ViStatus status;
ViUInt32 retCount;
char * SendBuf = NULL;
char * SendAddr = NULL;
bool bWriteOK = false;

Table of Contents

Other manuals for Rigol DSA832E

Related product manuals