Programmer’s Guide
6-5
Trace Data Transfers
Querying the Measurement Trace Using SICL
Querying the Measurement Trace Using
SICL
This section includes a complete SICL C program that shows how to read
the measurement trace from the analyzer.
/**************************************************************************
* This program takes a sweep, reads the trace, and prints it.
* It uses SICL (Standard Instrument Control Library) to talk
* to the analyzer over HP-IB.
*
* On HP-UX, compile using:
cc -Aa -o query_trace
query_trace.c -lsicl
**************************************************************************/
#include <sicl.h>
/* For iopen(), iprintf(), iscanf(), INST, ... */
#include <stdio.h>
/* For printf() */
int main(void) {
INST analyzer;
/* Handle used to talk to analyzer */
float data_buf[1601];
/* measurement trace.
32-bit floats */
int num_trace_bytes;
int pt;
num_trace_bytes = sizeof(data_buf);
/* Set to max allowable bytes */
/* Open the network analyzer at address 16 */
analyzer = iopen("hpib,16");
/* Clear the bus */
iclear(analyzer);
/* Abort current sweep and put analyzer sweep in hold */
iprintf(analyzer, "ABORT\n");
iprintf(analyzer, "INIT:CONT OFF\n");
/* Take one sweep, wait until done */
iprintf(analyzer, "INIT1\n");
iprintf(analyzer, "*OPC?\n");
iscanf(analyzer, "%*s");
/* Request the trace data in 32-bit floating point format */
iprintf(analyzer, "FORM:BORD NORM\n");
iprintf(analyzer, "FORM:DATA REAL,32\n");
/* Query the trace, read into data_buf[]. */
iprintf(analyzer, "TRAC? CH1FDATA\n");
iscanf(analyzer, "%#b%*c", &num_trace_bytes, &data_buf[0]);
/* Print the trace values. */
for (pt = 0; pt < num_trace_bytes/sizeof(float); pt++) {
printf("%4d
%g\n", pt, data_buf[pt]);
}
/* Close analyzer and exit. */
iclose(analyzer);
return 0;
}
Summary of Contents for 8712ES
Page 11: ...1 1 1 Introduction to GPIB Programming ...
Page 27: ...2 1 2 Synchronizing the Analyzer and a Controller ...
Page 36: ...3 1 3 Passing Control ...
Page 39: ...4 1 4 Data Types and Encoding ...
Page 46: ...5 1 5 Using Status Registers ...
Page 71: ...6 1 6 Trace Data Transfers ...
Page 98: ...6 28 Programmer sGuide Trace Data Transfers Internal Measurement Arrays ...
Page 99: ...7 1 7 Using Graphics ...
Page 105: ...8 1 8 Front Panel Keycodes ...
Page 111: ...9 1 9 Introduction to SCPI ...
Page 129: ...10 1 10 Menu Map with SCPI Commands ...
Page 268: ...12 1 12 SCPI Conformance Information ...
Page 290: ...13 1 13 SCPI Error Messages ...