Example; Reading Trace Data Using Ascii Format (Rs-232) - HP ESA-E Series Programmer's Manual

Esa spectrum analyzers
Table of Contents

Advertisement

Reading Trace Data Using ASCII Format
(RS-232)
This C programming example does the following:
• Open a serial session at COM1/COM2.
• Clear the analyzer.
• Reset the analyzer.
• Set the input port to the 50 MHz amplitude reference.
• Set the analyzer center frequency and span to 50 MHz.
• Set the analyzer to single sweep mode.
• Trigger a sweep.
• Read the operation complete query.
• Specify units in dBm.
• Set the analyzer trace data format to ASCII format.
• Trigger a sweep.
• Read the operation complete query.
• Query the trace data using ASCII format.
• Remove the "," token from the ASCII trace data for analyzing data.
• Save trace data to an ASCII file by removing the "," token.
• Close the session.

Example:

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <conio.h>
#include <ctype.h>
#include <string.h>
#include "visa.h"
#define
hpESA_IDN_E4401B
#define
hpESA_IDN_E4411B
Visession defaultRM, viESA;
ViStatus
errStatus;
ViChar
cIdBuff[256]={0};
char
cEnter = 0;
int
iResult = 0;
Chapter 3

Reading Trace Data Using ASCII Format (RS-232)

"Hewlett-Packard, E4401B"
"Hewlett-Packard, E4411B"
Programming Examples
3-31

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents