Keysight Technologies X-Series Programming Manual page 89

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

Advertisement

Programming Examples
GPIB Programming Interface Examples
#include "StdAfx.h"
#include <visa.h>
#include <iostream>
#include <stdlib.h>
#include <conio.h>
void main ()
{
ViSession
ViStatus
string data
data
system
address 19
&vi);
for 500 kHz
Keysight CXG, EXG, and MXG X-Series Signal Generators Programming Guide
ViSession
defaultRM, vi;
ViStatus viStatus = 0;
char rdBuffer [256];
int num;
viStatus=viOpenDefaultRM(&defaultRM);
viStatus=viOpen(defaultRM, "GPIB::19::INSTR", VI_NULL, VI_NULL,
if(viStatus){
printf("Could not open ViSession!\n");
printf("Check instruments and connections\n");
printf("\n");
exit(0);}
viPrintf(vi, "*RST\n");
viPrintf(vi, "FREQ 500 kHz\n"); // Set the source CW frequency
viPrintf(vi, "FREQ:CW?\n");
viScanf(vi, "%t", rdBuffer);
// Declares variables of type
// for instrument communication
// Declares a variable of type
// for GPIB verifications
// Declare variable to hold
// Declare variable to hold integer
// Initialize VISA
// Open session to GPIB device at
// If problems then prompt user
// Reset the signal generator
// Query the CW frequency
// Read signal generator response
89

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the X-Series and is the answer not in the manual?

Table of Contents