Keysight E4428C ESG RF Programming Manual page 119

Signal generators
Table of Contents

Advertisement

int sweep=1;
// End of sweep flag
/* Prototypes */
ViStatus _VI_FUNCH interupt(ViSession vi, ViEventType eventType, ViEvent event, ViAddr addr);
int main ()
{
ViSession defaultRM, vi;// Declares variables of type ViSession
// for instrument communication
ViStatus viStatus = 0;// Declares a variable of type ViStatus
char rdBuffer[MAX_CNT];// Declare a block of memory data
viStatus=viOpenDefaultRM(&defaultRM);// Initialize VISA session
if(viStatus < VI_SUCCESS){// If problems, then prompt user
printf("ERROR initializing VISA... exiting\n");
printf("\n");
return -1;}
viStatus=viOpen(defaultRM, "GPIB::19::INSTR", VI_NULL, VI_NULL, &vi);
if(viStatus){
printf("ERROR: Could not open communication with
printf("\n");
return -1;}
viClear(vi);
viPrintf(vi, "*RST\n");
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
printf("\n");
printf("Press Enter to continue\n");
printf("\n");
getch();
Keysight Signal Generators Programming Guide
// for GPIB verifications
// Open session to gpib device at address 19
// If problems then prompt user
instrument\n");
// Clears the signal generator
// Resets signal generator
// Print program header and information
end.\n"?;
Programming Examples
GPIB Programming Interface Examples
111

Advertisement

Table of Contents
loading

Table of Contents