EasyManuals Logo

Keysight Technologies N5172B EXG Programming Guide

Keysight Technologies N5172B EXG
398 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #120 background imageLoading...
Page #120 background image
120 Keysight CXG, EXG, and MXG X-Series Signal Generators Programming Guide
Programming Examples
LAN Programming Interface Examples
// Ask for sig gen ID
string
status = viWrite(instr, (ViBuf)"*IDN?\n", 6, &retCount);
// Read the sig gen
response
status = viRead(instr, (ViBuf)buffer, MAX_COUNT, &retCount);
buffer[retCount]= '\0'; // Indicate the end of
the string
printf("Signal Generator ID = "); // Print header for ID
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 124
consists of two files; lanio.c and getopt.c. The lanio.c file has two main
functions; int main() and an int main1().

Table of Contents

Other manuals for Keysight Technologies N5172B EXG

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Keysight Technologies N5172B EXG and is the answer not in the manual?

Keysight Technologies N5172B EXG Specifications

General IconGeneral
BrandKeysight Technologies
ModelN5172B EXG
CategoryPortable Generator
LanguageEnglish

Related product manuals