Technical data

Programming Example 4
N9320A Programmer’s Guide 47
ViSession defaultRM, viN9320A;
ViStatus errStatus;
ViChar cIdBuff[256]= {0};
char cEnter = 0;
int iResult = 0;
/*Set the input port to 50 MHz amplitude reference*/
void Route50MHzSignal()
{
viQueryf(viN9320A, "*IDN?\n", "%t", &cIdBuff);
/* prompt the user*/
/* to connect the amplitude reference output to the input*/
printf ("Connect CAL OUT to the RF IN \n");
printf ("......Press Return to continue \n");
scanf( "%c",&cEnter);
/*Externally route the 50 MHz Signal*/
viPrintf(viN9320A,"CAL:SOUR:STAT ON \n");
}
void main()
{
/*Program Variables*/
ViStatus viStatus = 0;
double dMarkAmp =0.0;
/*Open a USB session*/
viStatus=viOpenDefaultRM(&defaultRM);
viStatus=viO-
pen(defaultRM,"USB0::2391::8472::0000000000::0::INSTR",VI_NULL,VI_N
ULL,&viN9320A);
if(viStatus)
{
printf("Could not open a session to USB device!\n");
exit(0);
}
/*Clear the Instrument*/
viClear(viN9320A);