158 N9310A User’s Guide
6 Subsystem Command Reference
Example 3 - Generating an AM Signal
Assume you wish to generate an AM signal, with the
following characters:
• AM depth = 80 %
•AM rate = 10 kHz
• AM source = internal source
•CW. frequency = 1 GHz
• CW. amplitude = –10 dBm
***************************************************
/* Setup N9310A to generate an AM wave. */
int main(void)
{
status = viOpenDefaultRM (&defaultRM);
if (status != VI_SUCCESS) return –1;
status = viOpen (defaultRM,
“USB0::2391::8216::0115000001::0::INSTR”, VI_NULL,
VI_NULL, &INST_N9310A);
if (status != VI_SUCCESS) return –1;
/* Configure the carrier. */
status = viWrite (inst_N9310A, “*RST\n”,
StringLength(“*RST\n”), &rcount);
status = viWrite (inst_N9310A, “FREQ:CW 1 GHz\n”,
StringLength(“FREQ:CW 1 GHz\n”), &rcount);
status = viWrite (inst_N9310A, “AMPL:CW –10 dBm\n”,
StringLength(“AMPL:CW –10 dBm\n”), &rcount);
/* Configure the AM. */
status = viWrite (inst_N9310A, “AM:DEPT 80\n”,
StringLength(“AM:DEPT 80\n”), &rcount);
status = viWrite (inst_N9310A, “AM:RATE 10 kHz\n”,
StringLength(“AM:RATE 10 kHz\n”), &rcount);
/* Enable AM and RF output. */
status = viWrite (inst_N9310A, “AM:STAT ON\n”,
StringLength(“AM:STAT ON\n”), &rcount);