RIGOL
Chapter 3
Programming Examples
Programming Guide for DSA1000A series
3-30
status = viOpen(defaultRM, SendAddr, VI_NULL, VI_NULL, &instr);
//Write command to the device
status = viWrite(instr, (
unsigned
char
*)SendBuf, strlen(SendBuf), &retCount);
//Close the device
status = viClose(instr);
status = viClose(defaultRM);
return
bWriteOK;
}
bool
DemoForDSA::InstrRead(string strAddr, string & pstrResult)
//Instrument
Reads
{
ViSession defaultRM,instr;
ViStatus status;
ViUInt32 retCount;
char
* SendAddr = NULL;
char
* result = NULL;
bool
bReadOK =
false
;
unsigned
char
RecBuf[MAX_REC_SIZE];
string str;
memset(RecBuf,0,MAX_REC_SIZE);
result=(
char
*)malloc(MAX_REC_SIZE*
sizeof
(
char
));
memset(result,0,MAX_REC_SIZE);
//Address conversion, convert strig address to char* address
SendAddr=
const_cast
<
char
*>(strAddr.c_str());
//Open the VISA device
status = viOpenDefaultRM(&defaultRM);
if
(status < VI_SUCCESS)
{
// Error Initializing VISA...exiting
cout<<
"No VISA equipment!"
<<endl;
return
false
;
}
Содержание 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...