Chapter 7
7-59
Programming Examples
Measurement Data Transfer Examples
Example 3B: Data Transfer Using FORM 4 (ASCII Transfer)
This example shows you how to transfer a trace array from the analyzer using FORM 4, an
ASCII data transfer.
The next most common data transfer is to transfer a trace array from the analyzer.
shows the relationship of the two values-per-point that are transferred to the
analyzer. When FORM 4 is used, each number is sent as a 24-character string, each
character represented by a digit, sign, or decimal point. Each number is separated from
the previous number with a comma. Since there are two numbers-per-point, a 201-point
transfer in FORM 4 takes 10,050 bytes. This form is useful only when input-data
formatting is difficult with the instrument controller. Refer to
for a comparison
with the other formats.
An example of a simple data transfer using FORM 4 (ASCII data transfer) is shown in this
program. A fairly common requirement is to create frequency-amplitude data pairs from
the trace data. No frequency information is included with the trace data transfer, because
the frequency data must be calculated. Relating the data from a linear frequency sweep to
frequency can be done by querying the analyzer start frequency, the frequency span, and
the number of points in the sweep. Given that information, the frequency of point N in a
linear frequency sweep is:
Example 3B illustrates this technique. It is a straight-forward solution for linear uniform
sweeps. For other sweep types, frequency data is more difficult to construct and may best
be read directly from the analyzer's limit-test array. See
Using Frequency-Array Information” on page 7-64
The following is an outline of the program's processing sequence:
• An I/O path is assigned for the analyzer.
• The system is initialized.
Table 7-10 Analyzer Array-Data Formats
Format
type
Type of Data
Bytes per
Data Value
Bytes per
point 2 data
values
(201 pts)
Bytes per trace
Total Bytes
with header
FORM 1
Internal Binary
3
6
1206
1210
FORM 2
IEEE 32-bit
Floating-Point
4
8
1608
1612
FORM 3
IEEE 64-bit
Floating-Point
8
16
3216
3220
FORM 4
ASCII Numbers
24
(Typical)
50
(Typical)
10,050
(Typical)
10,050*
(Typical)
FORM 5
PC-DOS 32-bit
Floating-Point
4
8
1608
1612
*No header is used in FORM 4.
F
StartFrequency
N
1
–
(
)
Span
Points
1
–
(
)
------------------------------
×
+
=
Summary of Contents for 8719ES
Page 15: ...1 1 1 Alphabetical Command Reference ...
Page 293: ...2 1 2 Introduction to Instrument Control ...
Page 310: ...3 1 3 GPIB Programming ...
Page 334: ...4 1 4 Reading Analyzer Data ...
Page 343: ...5 1 5 Data Processing Chain ...
Page 350: ...6 1 6 Error Reporting ...
Page 364: ...7 1 7 Programming Examples ...
Page 502: ...A 1 A Preset Conditions ...
Page 517: ...B 1 B Command Listings ...