EasyManua.ls Logo

Rigol DSA832E - Page 241

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-27
status = viRead(instr, RecBuf, MAX_REC_SIZE, &retCount);
//Turn off the device
status = viClose(instr);
status = viClose(defaultRM);
sprintf(result,"%s",RecBuf);
pstrResult = result;
free(result);
return bReadOK;
}
void makeupper( string &instr)
{
string outstr = "";
if(instr == "")
{
exit(0);
}
for(int i = 0;i < instr.length();i++)
{
instr[i] = toupper(instr[i]);
}
}
3. Edit the function file mainloop.cpp to complete the flow control.
#include "DemoForDSA.h"
void menudisplay()
{
cout<<"\t\t Please operate the instrument:\n read write quit"<<endl;
}
int main()
{
DemoForDSA demo;
char temp[50];
if(!demo.ConnectInstr())
{
cout<<"can not connect the equipment!"<<endl;
return 0;
}
else
{
cout<<"\n connect equipment success!"<<endl;
cout<<" the equipment address is :"<<demo.m_strInstrAddr<<endl;
}
while(1)
{
menudisplay();
//cin>>demo.m_strCommand;
cin.getline(temp,50);
demo.m_strCommand=
if(demo.m_strCommand[0]='r' && demo.m_strCommand[1]='e'

Table of Contents

Other manuals for Rigol DSA832E

Related product manuals