4 Programming example
4.1 Basic operation example
104
status = viWrite(vi3986, (ViBuf)":CALC:MARK1:STAT ON", 25,
(ViPUInt32) &retCnt);
status = viWrite(vi3986, (ViBuf) ":CALC:MARK1:MAX?", 20, (ViPUInt32)&retCnt);
status = viRead(vi3986, (ViBuf)rd_Buf_Marker, 20, (ViPUInt32)&retCnt);
//Print debugging information
//sprint("Marker is %s", rd_Buf_Marker);
}
4.1.7
Synchronization of command
/******************************************************************************************************************
The methods for command synchronization are illustrated hereinafter by taking sweep as an example.
*******************************************************************************************************************/
void SweepSync()
{
ViStatus status;
long retCnt;
ViEventType etype;
ViEvent eevent;
int stat;
char OpcOk [2];
/**************************************************************************************************************
Command INITiate[:IMMediate] initiates a single sweep (INIT:CONT OFF when continuous sweep is
OFF)
Only when the single sweep is completed can the next command in the command buffer be
executed
***************************************************************************************************************/
status
= viWrite(vi3986, (ViBuf)":INIT:CONT OFF", 1
4
, (ViPUInt32) &retCnt);
//Method 1 of waiting for sweep completion: use *WAI
status = viWrite(vi3986, (ViBuf)":INIT", 18, (ViPUInt32)&retCnt);
status = viWrite(vi3986, (ViBuf)"*WAI", 18, (ViPUInt32)&retCnt);
//Method 2 of waiting for sweep completion: use *OPC
?
status = viWrite(vi3986, (ViBuf) ":INIT", 20, (ViPUInt32)&retCnt);
status = viWrite(vi3986, (ViBuf) "*OPC?", 18, (ViPUInt32)&retCnt);
status = viRead(vi3986, (ViBuf)OpcOk, 2, (ViPUInt32)&retCnt);
//wait for *OPC to return “1”
//Method 3 of waiting for sweep completion: use *OPC
//To use the GPIB service requeset, set "Disable Auto
Serial Poll” as "yes"
status = viWrite(vi3986, (ViBuf)"*SRE 32", 7, (ViPUInt32)&retCnt);
status = viWrite(vi3986, (ViBuf)"*ESE 1", 6, (ViPUInt32)&retCnt);
Содержание 3986 Series
Страница 1: ...3986 Series Noise Figure Analyzer Programming Manual...
Страница 4: ......
Страница 8: ...3986 Series noise figure analyzer Table of Contents 4...
Страница 107: ...3 SCPI 3 3 Instrument specific Commands 99...
Страница 119: ...4 Programming example 4 2 Advanced operation example 111...