Sockets Lan Programming And C - Keysight Technologies X-Series Programming Manual

Signal generators
Hide thumbs Also See for X-Series:
Table of Contents

Advertisement

Programming Examples
LAN Programming Interface Examples
string
response
the string
-5dbm
&retCount);
the string
screen
level
}

Sockets LAN Programming and C

The program listing shown in
consists of two files; lanio.c and getopt.c. The lanio.c file has two main
functions; int main() and an int main1().
120
status = viWrite(instr, (ViBuf)"*IDN?\n", 6, &retCount);
status = viRead(instr, (ViBuf)buffer, MAX_COUNT, &retCount);
buffer[retCount]= '\0';
printf("Signal Generator ID = ");
printf(buffer);
printf("\n");
status = viWrite(instr, (ViBuf)"POW:AMPL -5dbm\n", 15,
status = viWrite(instr, (ViBuf)"POW?\n",5,&retCount);
status = viRead(instr, (ViBuf)buffer, MAX_COUNT, &retCount);
buffer[retCount]= '\0';
printf("Power level = ");
printf(buffer);
printf("\n");
status = viClose(instr);
status = viClose(defaultRM);
return 0;
Keysight CXG, EXG, and MXG X-Series Signal Generators Programming Guide
// Print carriage return
// Flush the read buffer
// Set sig gen power to
// Query the power level
// Print the queried power
// Close down the system
"Queries for Lan Using Sockets" on page 124
// Ask for sig gen ID
// Read the sig gen
// Indicate the end of
// Print header for ID
// Print the ID string
// Read the power level
// Indicate the end of
// Print header to the

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents