EasyManuals Logo
Home>Agilent Technologies>Inverter>E4428C

Agilent Technologies E4428C Programming Guide

Agilent Technologies E4428C
366 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 #143 background imageLoading...
Page #143 background image
Agilent N518xA, E8663B, E44x8C, and E82x7D Signal Generators Programming Guide 133
Programming Examples
RS-232 Programming Interface Examples (ESG/PSG/E8663B Only)
#include "StdAfx.h"
#include <stdlib.h>
#include <conio.h>
void main ()
{
int baud=9600;// Set baud rate to 9600
printf("Manually set the signal generator power level to 0 dBm\n");
printf("\n");
printf("Press any key to continue\n");
getch();
printf("\n");
ViSession defaultRM, vi;// Declares a variable of type ViSession
// for instrument communication on COM 2 port
ViStatus viStatus = 0;
// Opens session to RS-232 device at serial port 2
viStatus=viOpenDefaultRM(&defaultRM);
viStatus=viOpen(defaultRM, "ASRL2::INSTR", VI_NULL, VI_NULL, &vi);
if(viStatus){// If operation fails, prompt user
printf("Could not open ViSession!\n");
printf("Check instruments and connections\n");
printf("\n");
exit(0);}
// initialize device
viStatus=viEnableEvent(vi, VI_EVENT_IO_COMPLETION, VI_QUEUE,VI_NULL);
viClear(vi);// Sends device clear command
// Set attributes for the session
viSetAttribute(vi,VI_ATTR_ASRL_BAUD,baud);
viSetAttribute(vi,VI_ATTR_ASRL_DATA_BITS,8);
viPrintf(vi, "*RST\n");// Resets the signal generator
printf("The signal generator has been reset\n");
printf("Power level should be -135 dBm\n");
printf("\n");// Prints new line character to the display
viClose(vi);// Closes session
viClose(defaultRM);// Closes default session
}

Table of Contents

Other manuals for Agilent Technologies E4428C

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Agilent Technologies E4428C and is the answer not in the manual?

Agilent Technologies E4428C Specifications

General IconGeneral
BrandAgilent Technologies
ModelE4428C
CategoryInverter
LanguageEnglish

Related product manuals