112 Keysight CXG, EXG, and MXG X-Series Signal Generators Programming Guide
Programming Examples
GPIB Programming Interface Examples
viStatus=viOpen(defaultRM, "GPIB::19::INSTR", VI_NULL, VI_NULL,
&vi);
if(viStatus){ // If problems then prompt user
printf("ERROR: Could not open communication with
instrument\n");
printf("\n");
return -1;}
viClear(vi); // Clears the signal generator
viPrintf(vi, "*RST\n"); // Resets signal generator
// Print program header and
information
printf("** End of Sweep Service Request **\n");
printf("\n");
printf("The signal generator will be set up for a step sweep mode
operation.\n");
printf("An ’*’ will be printed while the instrument is sweeping.
The end of \n");
printf("sweep will be indicated by an SRQ on the GPIB and the
program will end.\n");
printf("\n");
printf("Press Enter to continue\n");
printf("\n");
getch();
viPrintf(vi, "*CLS\n");// Clears signal generator status byte
viPrintf(vi, "STAT:OPER:NTR 8\n");// Sets the Operation Status
Group // Negative Transition Filter to indicate a // negative
transition in Bit 3 (Sweeping)
// which will set a corresponding event in // the Operation
Event Register. This occurs // at the end of a sweep.
viPrintf(vi, "STAT:OPER:PTR 0\n");// Sets the Operation Status
Group // Positive Transition Filter so that no
// positive transition on Bit 3 affects the // Operation Event
Register. The positive // transition occurs at the start of a
sweep.
viPrintf(vi, "STAT:OPER:ENAB 8\n");// Enables Operation Status
Event Bit 3 // to report the event to Status Byte // Register
Summary Bit 7.
Содержание X-Series
Страница 4: ...4 ...
Страница 10: ...10 Contents ...