Subsystem Command Reference 6
N9310A User’s Guide 161
status = viWrite (inst_N9310A, “SWE:RF:STAT ON\n”,
StringLength(“SWE:RF:STAT ON\n”), &rcount);
/* Close session. */
status = 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 start frequency
and the stop frequency
viWrite (inst_N9310A, “SWE:RF:STAR 1 GHz\n”,
StringLength(“SWE:RF:STAR 1 GHz\n”), &rcount)
viWrite (inst_N9310A, “SWE:RF:STOP 2 GHz\n”,
StringLength(“SWE:RF:STOP 2 GHz\n”), &rcount)
Set the number of points
and dwell time for each
point
viWrite (inst_N9310A, “SWE:STEP:POIN 90\n”,
StringLength(“SWE:STEP:POIN 90\n”), &rcount)
viWrite (inst_N9310A, “SWE:STEP:DWEL 20 ms\n”,
StringLength(“SWE:STEP:DWEL 20 ms\n”), &rcount)
Enable RF output viWrite (inst_N9310A, “RFO:STAT ON\n”,
StringLength(“RFO:STAT ON\n”), &rcount)
Enable RF sweep viWrite (inst_N9310A, “SWE:RF:STAT ON\n”,
StringLength(“SWE:RF:STAT ON\n”), &rcount)
Close device session viClose (inst_N9310A)
viClose (defaultRM)
NOTE
After presetting the signal generator, the Sweep Repeat is set to CONT,
Sweep Direction is set to UP and Sweep trigger and Point trigger is set to
IMMediate by default. The commands to set the Sweep Repeat, Sweep
Direction, Sweep trigger and Point trigger are omitted in this example.