106 Keysight CXG, EXG, and MXG X-Series Signal Generators Programming Guide
Programming Examples
GPIB Programming Interface Examples
{
ViSession defaultRM, vi;// Declares a variables of type
ViSession
// for instrument communication
ViStatus viStatus = 0;// Declares a variable of type ViStatus
// for GPIB verifications
int num=0;// Declares a variable for switch statements
char rdBuffer[256]={0}; // Declare a variable for
response data
viStatus=viOpenDefaultRM(&defaultRM); // Initialize VISA
session
// Open session to GPIB device at
address 19
viStatus=viOpen(defaultRM, "GPIB::19::INSTR", VI_NULL, VI_NULL,
&vi);
if(viStatus){ // If problems, then prompt user
printf("Could not open ViSession!\n");
printf("Check instruments and connections\n");
printf("\n");
exit(0);}
printf("\n");
viClear(vi);// Clears the signal generator
// Prints user information
printf("Programming example to demonstrate reading the signal
generator's Status Byte\n");
printf("\n");
printf("Manually set up the sig gen for an unleveled output
condition:\n");
printf("* Set signal generator output amplitude to +20 dBm\n");
printf("* Set frequency to maximum value\n");
printf("* Turn On signal generator's RF Output\n");
printf("* Check signal generator's display for the UNLEVEL
annunciator\n");
printf("\n");
Содержание X-Series
Страница 4: ...4 ...
Страница 10: ...10 Contents ...