Agilent Technologies N8201A Service Manual Page 60

  • Download
  • Add to my manuals
  • Print
  • Page
    / 332
  • Table of contents
  • TROUBLESHOOTING
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 59
60 Agilent N8211A/N8212A Performance Upconverter Synthetic Instrument Module, 250 kHz to 20 / 40 GHz
3 Programming Examples
printf(buffer); // Print the ID string
printf("\n"); // Print carriage return
// Flush the read buffer
// Set sig gen power to -5dbm
status = viWrite(instr, (ViBuf)"POW:AMPL -5dbm\n", 15, &retCount);
// Query the power level
status = viWrite(instr, (ViBuf)"POW?\n",5,&retCount);
// Read the power level
status = viRead(instr, (ViBuf)buffer, MAX_COUNT, &retCount);
buffer[retCount]= '\0'; // Indicate the end of the string
printf("Power level = "); // Print header to the screen
printf(buffer); // Print the queried power level
printf("\n");
status = viClose(instr); // Close down the system
status = viClose(defaultRM);
return 0;
}
Sockets LAN Programming and C
The program listing shown in “Queries for Lan Using Sockets" on page 63 consists of two
files; lanio.c and getopt.c. The lanio.c file has two main functions; int main() and an
int main1().
The int main() function allows communication with the N8211A/N8212A interactively
from the command line. The program reads the N8211A/N8212A's hostname from the
command line, followed by the SCPI command. It then opens a socket to the
N8211A/N8212A, using port 5025, and sends the command. If the command appears to be
a query, the program queries the N8211A/N8212A for a response, and prints the response.
The int main1(), after renaming to int main(), will output a sequence of commands
to the N8211A/N8212A. You can use the format as a template and then add your own code.
This program is available on the N8211A/N8212A Documentation CD-ROM as lanio.c.
Page view 59
1 2 ... 55 56 57 58 59 60 61 62 63 64 65 ... 331 332

Comments to this Manuals

No comments