EasyManua.ls Logo

Keysight Technologies N5172B EXG - Page 102

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
Loading...
102 Keysight CXG, EXG, and MXG X-Series Signal Generators Programming Guide
Programming Examples
GPIB Programming Interface Examples
// will be instructed to place the signal generator in Local mode.
//
//*****************************************************************
#include <visa.h>
#include "StdAfx.h"
#include <iostream>
#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
long lngDone = 0; // Operation complete flag
viStatus=viOpenDefaultRM(&defaultRM); // Initialize VISA
session
// 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("\n");
viClear(vi); // Clears the signal
generator
viPrintf(vi, "*CLS\n"); // Resets the status byte
register
// Print user information
printf("Programming example using the *SAV,*RCL SCPI
commands\n");
printf("used to save and recall an instrument's state\n");

Table of Contents

Other manuals for Keysight Technologies N5172B EXG

Related product manuals