Instructions

Table Of Contents
Chapter 3 Programming Examples RIGOL
RSA5000 Programming Guide 3-25
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 "DemoForRSA.h"
void menudisplay()
{
cout<<"\t\t Please operate the instrument:\n read write quit"<<endl;
}
int main()
{
DemoForRSA 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=temp;
if(demo.m_strCommand[0]='r' && demo.m_strCommand[1]='e'