Programmer’s Guide
6-17
Trace Data Transfers
Applying Gain Correction Using the Memory Trace
The following example BASIC code segment shows how to download a
complex array from your program to the analyzer's Memory trace. The
program's "Mem" array is initialized with the proper values such that
when the analyzer computes Data divided by Memory, the desired
increasing gain will be applied.
100
REAL Mem(1:201,1:2)
110
ASSIGN @Hp8711 TO 716
120
! Fill memory array (denominator in Data/Mem)
130
! with values that will result in an
140
! upward sloping gain factor vs. frequency.
150
! Used to compensate for cable loss vs. frequency
160
! Adds 0 dB of gain at start freq; 3 dB at stop freq
170
FOR Pt=1 TO 201
180
Gain_factor_db=3.0*(Pt
−
1)/200
! 0..3 dB Power
190
Gain_factor_lin=10^(Gain_factor_db/20)
200
Mem(Pt,1)=1.0/Gain_factor_lin
! real
210
Mem(Pt,2)=0.0
! imag
220
NEXT Pt
230
! Download to the memory trace
240
OUTPUT @Hp8711;"FORM:DATA ASCII"
250
OUTPUT @Hp8711;"TRACE:DATA CH1SMEM";
! Note the ";"
260
FOR Pt=1 TO 201
270
FOR I=1 TO 2
280
OUTPUT @Hp8711;",";Mem(Pt,I);
! Note the ";"
290
NEXT I
300
NEXT Pt
310
OUTPUT @Hp8711;""
! Send linefeed
320
OUTPUT @Hp8711;"CALC1:MATH (IMPL/CH1SMEM)"
! Data/Mem
The example above downloads data to the corrected memory array. The
data is sent by the program to the analyzer using ASCII encoding. The
data is sent as ASCII characters, separated by commas. The analyzer
accepts the comma separated list of numbers until it receives a linefeed
to terminate the command. The program uses semicolons at the end of
some OUTPUT statements to avoid sending a linefeed until all of the
data has been sent. After the last number is sent, the program sends a
linefeed, and the analyzer accepts the data.
Remember, for faster transfers, use binary data encoding instead of
ASCII.
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 ...