EasyManua.ls Logo

Keysight Technologies N5173B EXG - Page 92

Keysight Technologies N5173B 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
Loading...
92 Keysight CXG, EXG, and MXG X-Series Signal Generators Programming Guide
Programming Examples
GPIB Programming Interface Examples
#include <iostream>
#include <stdlib.h>
#include <conio.h>
void main ()
{
ViSession defaultRM, vi; // Declares variables of type
ViSession
// for instrument
communication
ViStatus viStatus = 0; // Declares a variable of
type ViStatus
// for GPIB verifications
// Initialize VISA session
viStatus=viOpenDefaultRM(&defaultRM);
// open session to gpib device at
address 19
viStatus=viOpen(defaultRM, "GPIB::19::INSTR", VI_NULL, VI_NULL,
&vi);
if(viStatus){ // If problems, then prompt
user
printf("Could not open ViSession!\n");
printf("Check instruments and connections\n");
printf("\n");
exit(0);}
printf("Example program to set up the signal generator\n");
printf("for an AC-coupled FM signal\n");
printf("Press any key to continue\n");
printf("\n");
getch();
printf("\n");
viPrintf(vi, "*RST\n"); // Resets the signal
generator
viPrintf(vi, "FM:SOUR EXT2\n"); // Sets EXT 2 source for FM

Table of Contents

Other manuals for Keysight Technologies N5173B EXG

Related product manuals