Chapter 3 Programming Examples
RIGOL
Programming Guide for DSA1000A series
3-31
//Open the specific device
status = viOpen(defaultRM, SendAddr, VI_NULL, VI_NULL, &instr);
//Read the device
status = viRead(instr, RecBuf, MAX_REC_SIZE, &retCount);
//Close 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
and finish the flow control.
#include
"DemoForDSA.h"
void
menudisplay()
{
cout<<
"\t\t Please operate the instrument:\n
read write
quit"
<<endl;
Содержание DSA1000A Series
Страница 1: ...RIGOL Programming Guide DSA1000A Series Spectrum Analyzer May 2011 RIGOL Technologies Inc...
Страница 2: ......
Страница 14: ......
Страница 137: ...Chapter 3 Programming Examples RIGOL Programming Guide for DSA1000A series 3 3...
Страница 154: ...RIGOL Chapter 3 Programming Examples Programming Guide for DSA1000A series 3 20 6 Exit code...
Страница 155: ...Chapter 3 Programming Examples RIGOL Programming Guide for DSA1000A series 3 21 7 Execute results...
Страница 158: ...RIGOL Chapter 3 Programming Examples Programming Guide for DSA1000A series 3 24...