Subsystem Command Reference 6
N9310A User’s Guide 159
status = viWrite (inst_N9310A, “RFO:STAT ON\n”,
StringLength(“RFO:STAT:ON”\n, &rcount);
/* Close session. */
staus = viClose (inst_N9310A);
status = viClose (defaultRM)
return 1;
}
Programming Comments
Thread Relevant code
Open a session on the
default resource manager
first, and then for the
device you will be using.
viOpenDefaultRM (&defaultRM)
viOpen (defaultRM,
“USB0::2391::8216::0115000001::0::INSTR”,
VI_NULL, VI_NULL, &inst_N9310A)
Preset the signal
generator
viWrite (inst_N9310A, “*RST\n”,
StringLength(“*RST\n”), &rcount)
Set the frequency and
amplitude
of the CW signa
l
viWrite (inst_N9310A, “FREQ:CW 1 GHz\n”,
StringLength(“FREQ:CW 1 GHz\n”), &rcount)
viWrite (inst_N9310A, “AMPL:CW –10 dBm\n”,
StringLength(“AMPL:CW –10 dBm\n”), &rcount)
Set AM depth and AM
rate
viWrite (inst_N9310A, “AM:DEPT 80\n”,
StringLength(“AM:DEPT 80\n”), &rcount)
viWrite (inst_N9310A, “AM:RATE 10 kHz\n”,
StringLength(“AM:RATE 10 kHz”\n), &rcount)
Enable AM viWrite (inst_N9310A, “AM:STAT ON\n”,
StringLength(“AM:STAT:ON”\n), &rcount)
Enable the RF output viWrite (inst_N9310A, “RFO:STAT ON\n”,
StringLength(“RFO:STAT:ON\n”), &rcount)
Close device session viClose (inst_N9310A)
viClose (defaultRM)
NOTE
After presetting the signal generator, the AM source is set to internal
source and the modulation state is set to On by default. The commands to
set the AM source and the Modulation state are omitted in this example.