The ANRITSU product(s) listed on the title page is (are) warranted against defects in materials and
workmanship for one year from the date of shipment.
ANRITSU's obligation covers repairing or replacing products which prove to be defective during the
warranty period. Buyers shall prepay transportation charges for equipment returned to ANRITSU
for warranty repairs. Obligation is limited to the original purchaser. ANRITSU is not liable for con
sequential damages.
LIMITATION OF WARRANTY
The foregoing warrantydoes not apply to ANRITSU connectors that have failed due to normal wear.
Also,the warranty does not apply to defects resulting from improper or inadequate maintenance by
the Buyer,unauthorized modification or misuse,oroperation outside of the environmental specifications of the product. No other warranty is expressed or implied, and the remedies provided herein
are the Buyer's sole and exclusive remedies.
TRADEMARK ACKNOWLEDGEMENTS
V Connector and K Connector are registered trademarks of ANRITSU Company.
Windows,Excel,QuickBASIC,C,andQuick C are registered trademarks of Microsoft Corporation.
NOTICE
-
ANRITSU Company has prepared this manual for use by ANRITSU Company personnel and cus
tomers as a guide for the proper installation, operation and maintenance of ANRITSU Company
equipment and computer programs.The drawings, specifications, and information contained herein
are the property of ANRITSU Company,and any unauthorized use or disclosure of these drawings,
specifications, and information is prohibited; they shall not be reproduced, copied, or used in whole
or in part as the basis for manufacture or sale of the equipment or software programs without the
prior written consent of ANRITSU Company.
UPDATES
Updates to this manual, if any, may be downloaded from the Anritsu Internet site at:
http://www.anritsu.com
-
Table Of Contents
Part 1 — GPIB Interface
Chapter 1 — Series 37XXXC GPIB Programmer Interface
This chapter provides an introduction to the 37XXXC GPIB programmer interface and GPIB commu
nications.
Chapter 2 — GPIB Programming Basics
This chapter provides programming information, including equipment and controller setup and ele
mental GPIB programming techniques.
Chapter 3 — Series 37XXXC Programming Examples
This chapter provides sample program elements that demonstrate common 37XXXC operations.
These sample elements are useful as an aid in developing 37XXXC programs.
Part 2 — GPIB Function Groups
Chapter 4 — Measurement Functions
This chapter provides a detailed description of the 37XXXC specific GPIB commands that control the
various data display and measurement control functions of the 37XXXC.
Chapter 5 — Calibration Functions
This chapter describes the 37XXXC error correction (calibration) functions and the commands used
to implement a measurement calibration. It also describes the AutoCal function and provides a listing of applicable commands.
-
-
Chapter 6 — Markers and Limits Functions
This chapter describes commands used for data analysis, which consists of markers and limits function commands.
Chapter 7 — Remote-Only Functions
This chapter describes 37XXXC functions that support operations typically required when in the
remote-only (GPIB) mode. The commands described consist of data transfer, error reporting,
SRQ/status reporting, 488.2 common commands, and synchronization.
Chapter 8 — System Functions
This chapter describes the commands used to implement certain system functions. They consist of
hard copy, system state, save/recall, disk function, and diagnostics commands.
Chapter 9 — Special Applications Functions
This chapter describes the commands used to implement special measurement functions. They con
sist of time domain, multiple source, sweep control, rear panel output, CW sweep, gain compression,
Millimeter Wave System commands.
-
37XXXC PMi
Part 3 — Programming Reference
Chapter 10 — Command Dictionary
This chapter provides an alphabetically-ordered, dictionary-type listing and description of all
37XXXC GPIB programming commands. The listing for each command includes relevant details
about the command.
Chapter 11 — Instrument Data
This chapter provides general (non-command specific) tabular information for the 37XXXC. Much of
this information is presented in Chapters 4 through 10, but is provided in this chapter for easy ac
cess.
Chapter 12 — Error Messages
This chapter provides a list of all Error Messages including those related to remote-only (GPIB) op
eration of the 37XXXC.
Part 4 — Supplemental Data
Appendix A — Introduction to the IEEE 488 Bus
This appendix contains an introduction to the IEEE 488 Bus (GPIB). This material is intended to as
sist new users in understanding GPIB basics.
Appendix B — GPIB Quick Reference Guide
This appendix provides a quick reference to all 37XXXC GPIB commands. Each reference lists the
command name, a brief description of the command function, and a reference to the pertinent Chapter in this manual.
-
-
-
ii37XXXC PM
Part1
TheGPIB
Interface
This part consists of three chapters that describe how the
IEEE- 488 (GPIB) interface is implemented within the 37XXXC
Vector Network Analyzer and how to perform basic GPIB communications operations.
Chapter 1 – briefly describes the 37XXXC GPIB programmer in-
terface and describes the communication to and from the interface during remote-only (GPIB) operation of the 37XXXC.
Chapter 2 – provides a tutorial for performing basic GPIB op
erations such as sending and receiving messages, synchronizing
instrument operations, setting timeouts, and status checking.
Chapter 3 – provides sample program elements to familiarize
the user with 37XXXC programming techniques.They are also
useful as an aid in developing 37XXXC programs.
-
Chapter 1
Series 37XXXC GPIB
Programmer Interface
Table of Contents
1-1MANUAL SCOPE ...................1-3
1-2INTRODUCTION ...................1-3
1-3RELATED MANUALS ................1-3
1-4REMOTE OPERATION................1-3
GPIB Setup Menu ......................1-4
Interface Connection.....................1-5
Local Operation Key .....................1-5
Remote Operation LED Indicators .............1-7
1-5GPIB COMMUNICATION ..............1-8
Bus Interface Function Messages..............1-8
37XXXC Specific Messages .................1-8
Separator
Characters ..........................1-9
Terminator
Character...........................1-9
GPIB Error
Conditions ..........................1-9
Testing the 37XXXC GPIB Operation ...........1-10
1-6IEEE 488.2 SUMMARY ...............1-11
Chapter 1
Series 37XXXC GPIB
Programmer Interface
1-1MANUAL SCOPEThis manual provides IEEE 488 bus (GPIB) programming information
and data for all models of the Series 37000C Vector Network Analyzer.
It contains the entire command set for programming all features. Con
sequently,not all of the codes documented in this manual apply to all
models within the series (371XXC, 372XXC,373XXC). The reader
needs to be aware of the feature set available within the model for
which programming is being written. Feature set information is docu
mented in the applicable operation manual (OM) for any particular
model.
1-2INTRODUCTIONThis chapter contains a brief introduction to the 37XXXC GPIB inter-
face and programming environment.
1-3RELATED MANUALSThe series contains an operation manual, a maintenance manual, and
a GPIB Quick Reference Guide (Appendix B). ANRITSU Part numbers
and manual titles are given below:
1-4REMOTE OPERATIONThe following paragraphs describe the 37XXXC facilities for remote
operation.
The 37XXXC fully supports the IEEE 488.2–1992 GPIB standard. All
37XXXC front panel functions (except Power on/off and GPIB Test)
can be controlled remotely using the GPIB commands listed in this
manual and an external computer equipped with an IEEE 488 GPIB
controller. When in the GPIB operating mode,the 37XXX VNA func
tions as both a listener and a talker.
-
37XXXC PM1-3
REMOTE OPERATIONGENERAL INFORMATION
GPIB Setup MenuThe 37XXXC VNA GPIB address defaults to 6. This value may be
changed via the Utility Menu key's GPIB ADDRESSES menu (below).
System State
Default
Program
Utility
Menu
Figure 1-1. GPIB Address Menu
SELECT UTILITY
FUNCTION OPTIONS
GPIB ADDRESSES
DISPLAY
INSTRU MENT
STATE PARAM S
GENERAL
DISK UTILITIES
CALIBRATIO N
COMPONENT
UTILITIES
COLOR
CONF IGU RAT ION
DATAON(OFF)
DRAWING
BLANKING
FREQUENCY
INFORM ATIO N
PRESS <ENTER>
TO SELECT
OR TURN ON/OFF
GPIB ADDRESSES
IEEE 488.2
GPIB INTERFACE
ADDRESS
6
DEDICATED
GPIB INTERFACE
EXTERNAL SOURCE
4
PLOTTER
8
POWER METER
13
FREQUENCY COUNTER
7
1-437XXXC PM
GENERAL INFORMATIONREMOTE OPERATION
y
Interface ConnectionConnect your external controller to the IEEE 488.2 GPIB interface
connector on the rear panel (left). A pinout listing of this connector is
contained in Figure 1-2.
PrinterOut
CRTDegaussCRTBrt
10MHzRef
Display
VGAOUT
ExternalI/O
BiasFuses
ReferenceExtension
Port1 Port2
RAInRBIn RBOut
RAOut
Do not connect your external GPIB controller to the “Dedi
cated GPIB Interface” connector (located below the “IEEE
488.2 GPIB interface” connector (left). This dedicated
GPIB port is used by the 37XXXC to control external GPIB
devices, such as a plotter,second frequency source, fre
NOTE
-
-
quency counter,or a power meter.
IEEE 488.2 Interface
Dedicated GPIB Interface
Displa
The GPIB system can accommodate up to 15 devices at any one time.
To achieve maximum performance on the bus,proper timing and volt
age level relationships must be maintained. If either the cable length
between separate instruments or the accumulated cable length be
tween all instruments is too long, the data and control lines cannot be
driven properly and the system may fail to perform. The following
guidelines should be observed:
No more than 15 instruments may be installed on the bus (in-
q
cluding the controller).
Total accumulative cable length (in meters) may not exceed two
q
times the number of bus instruments or 20 meters—whichever is
less.
q
Individual cable length should not exceed 4 meters.
q
2/3 of the devices must be powered on.
q
Devices should not be powered on while bus is in operation (that
is; actively sending or receiving messages, data, etc.).
q
Minimize cable lengths to achieve maximum data transfer rates.
Local Operation KeyPress the Ret Loc key (below) to quickly restore the 37XXXC to local
operation. Local operation will be restored unless the 37XXXC is pro
grammed for local lockout; the Local Lockout LED indicator will be lit.
789
3
6
45
Enter
123
10-3Clear
.
-
0
Channel
Setup
Auto
Scale
Trace
Memory
Clear
Ret Loc
Data
Menu
Points
Device
Domain
Hold
ID
Video
Option
Menu
IFBW
Avg/
Average
Smooth
Trac e
Smooth
Menu
Limits
Ch1 Ch2
Menu
Marker
Readout
Ch3 Ch4
Menu
Marker
Graph
Set
Menu
Type
Default
Utility
Program
Menu
Save/
Begin
Apply
Recall
Cal
Menu
Cal
Scale
Start
Stop
Ref
S
Plane
Params
Print
Print
-
37XXXC PM1-5
REMOTE OPERATIONGENERAL INFORMATION
12
11
10
9
8
7
6
5
4
3
2
1
24
23
22
21
20
19
18
17
16
15
14
13
Pinout Diagram
PINNAMEDESCRIPTION
1-4DIO 1 thru DIO 4Data Input/Output.Bitsare HIGH with the data is logical0andLOW when the data is
logical 1.
5EOIEnd Or Identify. A low-true state indicates that the last byte of a multibyte message
has been placed on the line.
6DAVData Valid. A low-true state indicates that the talker has (1) sensed that NRFD is
LOW, (2) placed a byte of data on the bus, and (3) waited an appropriate length of
time for the data to settle.
7NRFDNot Ready For Data. A high-true state indicates that valid data has not yet been ac
-
cepted by a listener.
8NDACNotData Accepted. Alow-truestate indicates that the current databytehas been ac
-
cepted for internal processing by a listener.
9IFCInterface Clear. A low-true state places all bus instruments in a known state—such
as, unaddressed to talk, unaddressed to listen, and service request idle.
10SRQService Request. Alow-true state indicates that abusinstrumentneeds service from
the controller.
11ATNAttention. A low-true state enables the controller to respond to both it's own lis
ten/talk address andtoappropriateinterfacemessages—such as, device clear and
serial poll.
12ShieldGround Point.
13-16DIO 5 thru DIO 8Data Input/Output. Bits are high with the data is logical 0 and LOW when the data is
logical 1.
17RENRemote Enable. A low-true state enables bus instruments to be operated remotely,
GPIB Remote Indicators (above) signal operational status of the GPIB,
as described below:
Remote:
Lights when the 37XXXC switches to remote (GPIB) control. It remains lit until the unit returns to local control.
Talk:
Lights when you address the 37XXXC to talk and remains lit until unaddressed to talk.
Listen:
Lights when you address the 37XXXC to listen and remains lit until
unaddressed to talk.
SRQ:
Lights when the 37XXXC sends a Service Request (SRQ) to the exter
nal controller. The LED remains lit until the 37XXXC receives a serial
poll or until the controller resets the SRQ function.
Local Lockout:
Lights when a local lockout message is received. The LED remains lit
until the message is rescinded. When lit, you cannot return the
37XXXC to local control via the front panel.
Audible IndicatorsA single beep is issued as follows:
(1) on a GPIB error,
(2) when a user warning is issued (see Chapter 12, Operational Error
Messages)
(3) when a test limit line has been exceeded, if the limits testing beep
function has been set (see Chapter 6)
(4) on system reset.
(5) any time the user's attention is required, such as at the end of a
calibration step.
-
37XXXC PM1-7
GPIB COMMUNICATIONGENERAL INFORMATION
1-5GPIB COMMUNICATIONThe following paragraphs present a short summary of 37XXXC GPIB
communication. Subjects covered are program messages, sepa
rator/termination characters,status reporting, and GPIB error condi
tions and corresponding 37XXXC responses. Refer to Chapter 7,
Remote-Only Operation, for detailed description of these topics.
The primary GPIB messages that effect 37XXXC operation consist of
two major groups; Bus Interface Function messages, and Instrument
Specific messages.
-
-
Bus Interface
Function Messages
These are low level bus messages defined by IEEE 488.1. A discussion
of these messages is beyond the scope of this programming manual.
For further information, please refer to your GPIB controller documen
tation and/or to IEEE 488.1 Standards documents.Also refer to Ap
pendix A at the end of this Programming Manual for a brief primer on
the GPIB Interface.Table 1-1 summarizes some of the key Interface
Function Messages and the 37XXXC response to them.
Table 1-1. IEEE-488 Interface Function Messages
Interface Function
Message
DCL
SDC
GTLGo To LocalYesReturns the 37XXXC to local (front panel) control.
GETGroup Execute Trig-
IFCInterface ClearNoStops the 37XXXC GPIB from talking/listening.
LLOLocal LockoutNoDisables the front panel RETURN TO LOCAL key.
RENRemote EnableNoPlaces the 37XXXC in remote when addressed to listen.
Message Function
Device Clear
Selected Device
Clear
ger
Addressed
Command
No
Yes
YesExecutes a string of commands defined by the IEEE 488.2
Resets the 37XXXC GPIB communication functions.
Resets the 37XXXC GPIB communication functions.
common command *DDT. A GET is also done by using the
*TRG command (see Chapter 10, Command Dictionary).
37XXXC VNA Response
-
-
37XXXC Specific
Messages
The 37XXXC specific GPIB messages (also known as commands, que
ries, and mnemonics) are used to control 37XXXC front panel func
-
tions. They also provide for remote only operations such as data
transfers, status reporting and service request generation, error re
porting, and instrument-to-application program timing synchroniza
ence Guide; and Chapters 4-9 for information on all 37XXXC com
-
mands. The commands are organized both alphabetically and by
command function groups.There are many examples throughout this
manual to assist you in learning and using a desired command.
Most 37XXXC commands are three character contractions of their
functional descriptions.Examples include: OM1 (Output Marker 1),
1-837XXXC PM
GENERAL INFORMATIONGPIB COMMUNICATION
IFV (input Frequency List), TRS (Trigger Sweep), WFS (Wait for a
Full Sweep), OFD (Output Final [display format] Data), and PFS
(Print Full Screen).
Numeric parameter entry commands must be followed by a numeric
value. These commands can optionally accept a units or suffix termi
nator mnemonic. For example, SRT 2 GHZ (set start frequency to 2
GHz.)
Query commands,typically ending in a question mark (?), are used to
inquire about the state of a particular instrument function. Many
37XXXC setup commands have corresponding query commands listed
in the same section as the basic setup command. An example is the
MK1? query. It outputs the setting of Marker 1 Frequency, where the
MK1 command sets Marker 1 frequency.
IEEE 488.2 Common commands, which always start with the asterisk
character (*), are defined by the IEEE 488.2 Standard. They are used
to implement many standard instrument GPIB operations such as
querying when an operation completes, status reporting,self test, and
querying the instrument identification string. These commands are described throughout the Programming Manual in the specific funtional
group where they are used. A consolidated listing of these commands
can be found in Table 1-2, item 12 below and in Chapter 7. An example
IEEE 488.2 Common command is the *IDN? query (Output Instrument ID String.)
-
Separator
Characters
Terminator
Character
GPIB Error
Conditions
Separator characters are used to delimit program message elements
sent to or received from the 37XXXC. The permitted characters: semicolon (;), comma (,), and space ( ) and their usage is shown below.
CharacterUsed to separate
;
,
SpaceA command, its numerical entry value, and suffix mnemonic.
Multiple commands and multiple output response messages.
Multiple ASCII data elements for a single command.
The only allowed terminator character for 37XXXC GPIB messages is
the linefeed character (0A, decimal 10).
The 37XXXC responds to GPIB errors in the following manner:
q
A beep is issued.
q
An error message is displayed on the screen.
q
A bit is set in the Standard Event Status Register, and, if en
-
abled, an SRQ is generated.
37XXXC PM1-9
GPIB COMMUNICATIONGENERAL INFORMATION
An entry is written into the non-volatile Service Log describing
q
the error condition, along with time and date and, often, details
helpful in handling the error.When full, error entries at the bot
tom of the log are removed to make room for new entries.
If the error is GPIB related, the error message and the offending
q
program message, if applicable, can be output over the GPIB via
a query command. The previous error, if any, is also available via
another query.
The bits set in the Standard Event Status Register for GPIB errors are
as follows:
Bit 5 - Command Error (CME)
Invalid syntax, unrecognized command or command arguments, sepa
raters or terminators that do not conform to correct IEEEE 488.2 for
mats. The 37XXXC will ignore the remainder of commands in that
program message.
Bit 4 - Execution Error (EXE)
This bit is set if:
(1) A data entry parameter is out of range or not applicable.
(2) Action is impossible.
(3) Action is not possible in the current context or instrument state, or
if a required option is not fitted.
-
-
-
Testing the 37XXXC
GPIB Operation
Bit 3 - Device Dependent Error (DDE)
This bit is set if a valid requested action failed due to an instrument
specific error condition, such as attempting to access a bad floppy disk.
Bit 2 - Query Error (QYE)
This bit is set if the 37XXXC cannot provide the requested data. For
example, if an output is attempted when no data has been requested
or available,or if the output buffer is cleared due to sending more com
mands when data from a previous request has not yet been output.
Refer to Chapter 12, Error messages, for a listing of all 37XXXC error
messages (including GPIB errors).
The following test can be used to check your GPIB cable and 37XXXC
GPIB connectors.
1. Disconnect all GPIB cables from the 37XXXC.
2. Connect your GPIB cable between the two GPIB connectors on the
37XXXC rear panel.
3. Invoke the test from the front panel as follows: Option Menu key,
DIAGNOSTICS,PERIPHERAL TESTS,GPIB TEST. The test will
run for a few seconds, then report the result on the front panel dis
play.
-
-
1-1037XXXC PM
GENERAL INFORMATIONIEEE 488.2 SUMMARY
1-6IEEE 488.2 SUMMARYTable 1-2 provides answers to the “Device Documentation Require
ments” listed in the IEEE Standard 488.2-1992. It is also a good sum
mary of the GPIB operational characteristics of the 37XXXC.
Table 1-2. 37XXXC IEEE 488.2 Standard Documentation Summary (1 of 3)
NumberRequirement ItemImplementation in VNA
1Interface Function Subsets ImplementedSH1, AH1, T6, L4, SR1, RL1, PP1, DC1, DT1, C0, E2.
2Device behavior when the user (unit) GPIB address
is set outside of the 0–30 range
3When is a user address change recognized?New address is accepted and entry color remains
4Description of settings at power-onThe front panel setup that was in effect prior to power
VNA returns an Out-of-Range error,issues an audible
beep, and the entry color on front panel menu display
is changed to red. Entered address is not accepted.
green.
down will be restored, except: the 37XXXC will be
taken out of hold if it was previously set. Periodic IF Cal
will be returned to timed operation.
Memories saved:
1. GPIB address
2. Internal hardware calibration data
3. Information reported via the *IDN? and *OPT?
queries.
4. Calibration coefficients
5. Normalized trace data
6. Stored front panel setups
Memories Cleared:
1. Service Request message.
2. Standard event status register (except the Power-On
bit is set)
3. Extended event status register
4. Limit pass/fail status register
5. Enable registers for items 2 thru 4, above.
6. GPIB input and output queues.
7. Trigger action for *TRG and GET reset to null.
Data Transfer:
1. Data transfer is reset to MSB first for
numerical array data transfers.
2. Data transfer format is reset to default, ASCII
mode (FMA) for numerical array transfers.
3. Data pair format for OFD/IFD/OM1-OM6 commands
is set to default (off) mode. (See command DPR0.)
Menu Displayed:
Setup Menu
-
-
37XXXC PM1-11
IEEE 488.2 SUMMARYGENERAL INFORMATION
Table 1-2. 37XXXC IEEE 488.2 Standard Documentation Summary (2 of 3)
NumberRequirement ItemImplementation in VNA
5Message exchange options
a. Size and behavior of input buffera. Default size = 3 KByte. Size increases to required
amount, as needed, for <Arbitrary Block> transfers.
b. Queries that return more than one <RESPONSE MESSAGE UNIT>
c. Queries that generate a response when parsedc. All
d. Queries that generate a response when readd. None
e. Commands that are couplede. None
6Functional elements used in construction of device-
specific commands.
For the <Indefinite Length Arbitrary Block> data ele
ments, the input buffer size for that element is
64 Kbyte. Attempting to program more data than
64 KByte will cause a loss of all data for that ele
ment. A DDE error message will be issued to indi
cate this condition. For <Definite Length Arbitrary
Block> data elements, an attempt is made to set the
buffer size for that element to the size indicated in
the header. If there is insufficient system memory
available at the time, all data for that element is lost.
A DDE error message will be issued to indicate this
condition.
b. None
See command descriptions.
-
-
-
7Buffer size limitations37XXXC Attempts to allocate amount required; sets
DDE error if not possible. (See 5a., above)
8<PROGRAM DATA> elements that may appear
within an <expression>
9Response syntax for queriesSee command descriptions.
10Description of device-to-device message transfer
traffic that does not follow the rules for <RESPONSE
MESSAGES>
11Size of block data responsesVariable,See command descriptions for details.
12IEEE.488.2 Common commands and queries that
are implemented
13State of VNA following the successful completion of
the Calibration query
14Maximum length of the block used to define the trig
2. On execution, the 37XXXC returns a command error
and ignores the rest of the string.
1-1237XXXC PM
GENERAL INFORMATIONIEEE 488.2 SUMMARY
Table 1-2. 37XXXC IEEE 488.2 Standard Documentation Summary (3 of 3)
NumberRequirement ItemImplementation in VNA
15Maximum length and complexity of macro labels;
maximum length of block used to define a macro;
and how recursion is handled during macro expan
sion, if macro commands are implemented.
16Response to common query *IDN?.ANRITSU, <Model>, <SN>, <SW revision>
17Size of the protected user data storage area, if the
*PUD command or *PUD? query are implemented.
18Size of resource description, if the *RDT command
or *RDT? query are implemented.
19States affected by *RST, *LRN?, *RCL, and *SAV.*RST = default state (see Chapter 11),
20Scope of the self test performed by *TST? command.Fully automated internal hardware testing/reporting.
21Additional status data structures used in status re-
porting.
22Statement describing whether each command is
overlapped or sequential.
23Functional criteria that is met when an operation
complete message is generated in response to that
command.
N/A
-
N/A
N/A
*LRN, *RCL, *SAV not implemented
Failure results, if any, are written to the internal nonvolatile service log for user access.
Limits Event Status and Extended Event Status registers; refer to Chapter 7 for details.
All commands are sequential.
N/A – No overlapped commands.
24Descriptions used for infinity and not-a-number.N/A
37XXXC PM1-13/1-14
Chapter 2
GPIB Programming
Basics
Table of Contents
2-1INTRODUCTION ...................2-3
2-2EQUIPMENT AND CONFIGURATION.......2-3
Required Equipment ...............2-3
Configuration ...................2-4
2-3GPIB PROGRAM ELEMENTS............2-5
National Instruments GPIB Interface .....2-5
Definitions ....................2-5
2-4INITIALIZING THE GPIB ..............2-6
2-5SHUTTING DOWN THE GPIB SYSTEM ......2-6
2-6DETECTING GPIB ERRORS.............2-7
Full Error Detection ...............2-7
Limited Handling Error Detection........2-7
NI488 Global Variables..............2-7
Example.....................2-7
2-7OPERATION TIME OUT...............2-8
Example......................2-8
2-8SENDING COMMANDS ...............2-9
Example: .....................2-9
37XXXC Commands Used ............2-9
2-9RECEIVING DATA .................2-10
Example:.....................2-10
Error Handling: .................2-10
37XXXC Commands Used ...........2-11
2-10SRQ HANDLING ..................2-11
Calculating the Binary Weighted Bit Value . . 2-11
Enabling Service Request............2-11
Example .....................2-11
Commands Used................2-12
NI488
RQ Functions ..................2-12
2-11COMPLETE OPERATIONS............2-13
Example 1 ....................2-13
Example 2 ....................2-13
37XXXC Commands Used ...........2-14
Chapter 2
GPIB Programming
Basics
2-1INTRODUCTIONThis chapter contains a brief introduction to GPIB programming tech
niques and describes procedures to be used when preparing GPIB pro
grams for the 37XXXC VNA. It includes information about equipment
requirements and configuration for GPIB control of the 37XXXC VNA,
and many programming tips.
Familiarity with manual (front panel) operation of the 37XXXC is as
sumed. (Throughout this section, the 37XXXC VNA is referred to sim
ply as “37XXXC”.) A complete description of front panel operation is
contained in the appropriate 371XXC, 372XXC, or 373XXC Vector
Network Analyzer System Operation Manual.
2-2EQUIPMENT AND
CONFIGURATION
Required EquipmentThe following equipment represents a minimum GPIB controllable
The programming examples contained in this chapter assume the
equipment listed below is present and configured as described.
37XXXC VNA system:
q
A 37XXXC Vector Network Analyzer.
q
A computer/controller that supports the IEEE 488 GPIB stan
dard. The examples in this chapter address the IBM compatible
computers.
q
An IEEE-488 GPIB interface (built in, or add-in peripheral card)
with appropriate driver software. The National Instruments
GPIB IEEE-488.2 interface is assumed for all examples in this
chapter.
-
-
-
-
-
q
Appropriate software (any of the following):
·
Microsoft QuickBASIC, version 4.0 (or later)
·
Microsoft “C”, version 5.1 or later, or Quick C, version 2.5.
·
Any other programming language, or application software,
that supports the IEEE 488 GPIB interface (Pascal, Fortran,
etc.).
q
A GPIB cable (preferably 2 meters long).
37XXXC PM2-3
EQUIPMENT AND CONFIGURATIONGPIB PROGRAMMING BASICS
y
To:
IEEE 488.2 Interface
From:
IEEE 488 Interface
card connector
Figure 2-1. Model 37XXXC Shown Connected to an IEEE 488.2 Controller
NOTE
The IBM PC and National Instruments GPIB interface
were chosen for demonstrating the 37XXXC GPIB operation in this manual. Any other GPIB controller that conforms to the IEEE 488 standard can be used to interface to
the 37XXXC.
connector
Prin te rOut
CRTDegaussCRTBrt
ConfigurationConfigure the 37XXXC as shown in Figure 2-1. Apply power to the
37XXXC and allow the system software to load from disk. Once the
10MHzRef
Dis pla y
VGAOUT
Exte rnalI/O
ReferenceExte nsio n
BiasFuses
Port1 Port2
RAInRBIn RBOut
RAOut
Connect here
Do not connect here
Displa
software has finished loading and start-up testing is complete, the
37XXXC is ready to be remotely controlled via the GPIB. It is impor
-
tant to note that the 37XXXC will not respond to GPIB commands un
til the 37XXXC system software has been loaded.
Connect a GPIB cable from the computer/controller to the rear panel
IEEE 488.2 GPIB connector (left).
Apply power to the computer/controller and load the appropriate pro
gramming language software (QuickBASIC, “C”, etc.).
The default GPIB address for the 37XXXC (6) is assumed for all exam
-
-
-
ples in this chapter.
2-437XXXC PM
GPIB PROGRAMMING BASICSGPIB PROGRAM ELEMENTS
2-3GPIB PROGRAM
ELEMENTS
Instruments GPIB
National
Interface
The discussions in this chapter demonstrate basic GPIB programming
concepts that are typical elements of most GPIB application programs.
The controller used to demonstrate these concepts is the National In
struments 488.2 GPIB Interface which will be referred to as NI488
throughout this chapter.
NOTE
Regardless of the controller used, consult its documenta
tion and software distribution disks for complete details
and examples on setup and use of the controller's hard
ware and interface software functions.
Throughout this chapter references will be made to variables, con
stants, and controller function calls declared in the NI488 file that
your application uses to interface to the GPIB controller. This file is
decl.h for C and qbdecl.bas for QuickBASIC,and it must be in
cluded in your GPIB program. Consult your documentation for the
files used for other environments.
Including and compiling the appropriate NI488 file when preparing
your application is what allows use of the NI488 GPIB interface procedures and function calls in your program. Also, the file named
gpib.com must be installed in memory upon bootup of your computer. Typically, access to this file is through your system configuration
file (that is,config.sys for DOS based computers).
-
-
-
-
-
The gpib.com is what allows your GPIB program to physically interface to the installed GPIB controller and to execute GPIB function
calls during operation.
NOTE
Consult your controller's documentation for complete de
tails on software and hardware setup, test, and use prior to
proceeding with the following discussion. Knowledge of
your controller and its operation will be assumed from this
point forward.
DefinitionsThe following definitions apply for the remainder of this chapter:
q
board = 0, Active controller board number
q
address = 6, GPIB address of the instrument.
q
Address List = addresList, list of GPIB addresses terminated
with the NI488 constant NOADDR. For our examples the list con
sists of two elements (6, NOADDR).
-
-
37XXXC PM2-5
INITIALIZING THE GPIBGPIB PROGRAMMING BASICS
2-4INITIALIZING THE GPIBInitializing is the process of directing your controller to take control of
the bus (become CIC — Controller In Charge) and setting the GPIB
software to initial default settings.
NOTE
Default initial installation configuration is assumed for
the NI488 hardware and software.
2-5SHUTTING DOWN THE
GPIB SYSTEM
NI488 does this by sending an interface clear to the desired board us
ing:
SendIFC(board)
The board will become CACS (Active controller). NI488 software al
lows use of up to 4 controllers. The board specified by the SendIFC()
function must be designated CIC – Controller In Charge in its setup
and configuration. See NI488 config utility in NI488 documentation.
SendIFC() is also useful anytime you want to insure that your GPIB
controller has control over the bus, the GPIB software is in its default
parameters, and GPIB of all instruments on the bus is cleared and in
idle state.
The following NI488 functions are also useful when initializing your
application.
q
To place all instruments in remote state,use:
EnableRemote(board, addressList)
q
To clear GPIB operation of all instruments use:
DevClearList(board, addressList)
An important step in quitting a GPIB application is to shut down the
GPIB interface. For the NI488 this is done by
q
Insuring that you have control over the bus.
-
-
q
Clearing all instruments' GPIB and placing them in an idle state.
q
Releasing the controller GPIB software and hardware.
Implement the above by sending:
SendIFC(board)
ibonl(board, 0)
2-637XXXC PM
GPIB PROGRAMMING BASICSDETECTING GPIB ERRORS
2-6DETECTING GPIB
ERRORS
Full Error DetectionFull error detection and handling is an invaluable debugging tool that
Limited Handling
Error Detection
NI488 Global
Variables
It is important to use error checking code throughout your application
program. Error checking usually does not significantly impact the
speed of a GPIB application. This is because the GPIB bus operations
are I/O operations whose execution time depends on a handshake pro
cess. This process is typically much slower than executing (error
checking) code in your computer's memory.
should be used to its fullest during development of your application.
Error detection with at least a limited amount of handling should be
used after each GPIB I/O operation in your final program. This will in
sure predictable operation of your application, proper system control,
and accurate data processing.
The NI488 interface maintains three global variables useful in deter
mining correct GPIB operations. These variables are updated after,
and reflect the condition of, the last GPIB call to the interface. The
variables are:
IBSTA
q
This variable provides the latest bus activity status; that is,errors, completions, time outs, etc.
q IBERR
This variable provides information on the type of error, if an error
was reported in IBSTA.
-
-
-
q
IBCNT/IBCNTL
The number of data bytes transferred on the bus in the last operation. IBCNTL is the “long integer” version of IBCNT.
ExampleError checking for the NI488 interface is as follows. After each GPIB
call, the IBSTA is checked for errors using the NI488 declared con
stant EERR - in BASIC, or ERR in C. If true, the gpiberr() function is
called to decode and display the global variables IBSTA, IBERR, and
IBCNT. For example,for QuickBASIC,the following code is inserted af
ter a GPIB call:
IF IBSTA% AND EERR THEN
CALL gpiberr (error during GPIB operation)
END IF
NOTE
The NI488 disks and documentation contain the source
listing of the gpiberr() function. This function should be
copied into your code and used after each GPIB function
call. Use the example programs provided on the NI488 dis
tribution disks.Note that gpiberr() can also be modified
to fit a particular application's requirements.
-
-
-
37XXXC PM2-7
OPERATION TIME OUTGPIB PROGRAMMING BASICS
2-7OPERATION TIME OUTSetting GPIB time out is necessary to allow for lengthy instrument op
erations to complete before the application program continues with its
processing. (Refer to paragraph 2-1, Waiting for Instrument Opera
tions to Complete.)
ExampleThe NI488 time out is set using the ibtmo() interface call, as follows:
ibtmo(instrument_handle, timeout_setting)
Where:
instrument_handle = The value returned by the ibfind() or
q
ibdev() interface call for the instrument.
timeout_setting = A value that disables or sets the time out
q
setting. NI488 uses declared constants to represent the allowable
time out settings,for example, the T100s constant is 100 seconds,
T30ms is 30 milliseconds, TNone is 0, etc. The complete list is in
the NI488 include file for your language (qbdecl.bas, decl.h).
NOTE
Consult NI488 documentation and distribution disks for
information and an example on using ibtmo(),
ifbind(), and ibdev().
-
-
2-837XXXC PM
GPIB PROGRAMMING BASICSSENDING COMMANDS
2-8SENDING COMMANDSGPIB controllers provide for sending GPIB commands to an instru
ment (or the controller itself if its address is used). The NI488 uses
several commands,the most common is:
Send (board, address, buffer, numBytes, eot_mode)
Where:
board, address = see section 2-3 for definitions.
q
buffer = String of one or more instrument specific GPIB com
q
mands from the defined list in the instrument's GPIB documenta
tion.
buffer = String of one or more instrument specific GPIB com
q
mands from the defined list in the instrument's GPIB documenta
tion.
numBytes = The number of bytes contained in the buffer.
q
eot_mode = The method used to signal end of transmission. This
q
is typically done using ASCII linefeed character 0A hex (10 decimal) and then setting EOI state (end of transmission) on the bus.
The NI488 defines the following constants for use to setup end of
transmission methods:
n NLend - Linefeed with EOI
n
DABend - EOI only
n
NULLend -Do nothing to mark end of transmission
-
-
-
-
-
Example:Send the 37XXXC at address 6, the commands “CH2;DSP;MAG”, from
37XXXC Commands
Used
controller number 0, using the linefeed with EOI to mark the end of
transmission:
Send (0, 6, “CH2;DSP;MAG”,11,NLend)
The above example uses the following commands defined in the
37XXXC command set:
CH2 - sets active channel to 2,
DSP - displays only the active channel on the
whole screen,
MAG - displays the active channel's data in log
magnitude format (dB).
NOTE
The semicolon (;) is used to separate the different com
-
mands.
37XXXC PM2-9
RECEIVING DATAGPIB PROGRAMMING BASICS
2-9RECEIVING DATAIn order to receive data from an instrument over the GPIB, you must
first instruct the instrument to output the desired data. You do this by
using one of the instrument's defined data output commands and the
controller Send() function (see paragraph 2-8, “Sending commands”).
The instrument must then be given permission to start sending data
(talk). The NI488 call to do this is:
Receive(board, address, buffer, numBytes,
eod_mode)
Where:
board, address = see section 2-3 for definitions.
q
buffer = The name of the memory address of the buffer where
q
the received data is to be placed. Typically this is an array of type
characters (a string). Although, for binary data transfers, the
NI488 software will accept an array of almost any type; that is.
integer, floating point, etc.
numBytes = The maximum number of bytes to read from the in-
q
strument. Insure that “buffer” above is of at least this size.
eod_mode = The method used to signal the controller to stop re-
q
ceiving data. Typically the NI488 constant STOPend is used (EOI
state – end of transmission – set with the last byte). If you want
to stop receiving when a certain transmission terminator character is received, then use the hex value of that character instead of
the STOPend.
Example:Use the NI488 controller number 0, to send the 37XXXC at address 6,
the command “ONP” using the line feed with EOI to mark end of
transmission:
Send(0, 6, “ONP”, 3, NLend)
Upon receiving a data output command, the 37XXXC will prepare the
data requested and wait for the controller to put it in the talk state so
it can put the data out on the bus. This is done by:
numBytes = 20
Receive(0, 6, buffer, numBytes, STOPend)
Error Handling:The number of bytes actually sent on the bus can now be retrieved
from the NI488 interface software by immediately storing the value of
the IBCNT global variable in a program variable as follows:
actualReceivedBytes = IBCNT
2-1037XXXC PM
GPIB PROGRAMMING BASICSSRQ HANDLING
37XXXC Commands
Used
If we expected an exact number of bytes to be received, we can com
pare the requested number of bytes “numBytes” with the actual re
ceived “actualReceievedBytes” and take some corrective action if they
do not match. You should do this before continuing to the data process
ing section of the program:
If numBytes ISNOTEQUALTO actualReceivedBytes then
Call gpiberr(”incorrect number of bytes
received”)
END IF
NOTE
Consult your programming language syntax for the opera
tor used to check in-equality, to use in place of ISNOTE
QUALTO.
The above example uses the following commands defined in the
37XXXC command set:
ONP – Outputs the number of data points in the current sweep. It
q
will output the number represented in ASCII format.
-
-
-
-
2-10SRQ HANDLINGControllers use a dedicated line on the GPIB to detect if an instrument
has requested service.An instrument sets this line when a predetermined set of conditions inside it have been met. These conditions are
selected and programmed into the instrument by setting the Service
Request Enable Register to a decimal value that corresponds to the bit
values which, when true, will generate an SRQ. This is a binary
weighted decimal value in the range 0 – 255.
-
Value
-
The decimal value of a bit in a register is equal to the number 2 raised
to a power equal to the bit number. For example, the decimal value of
bit 4 in the Service Request Enable Register is 2 raised to the power 4
which is: 2
To enable service request in the 37XXXC,use the command *SRE Service Request Enable,with the desired value.
when it has data to send, then output the number of points in the cur
rent sweep. We need to enable bit 4 (MAV), Message Available, in the
Service Request Enable Register,so a service request will be gener
ated when the data is ready. The decimal value of bit 4 is 16 (2
The NI488 Send() function is used to send the 37XXXC at address 6,
the commands “*SRE 16;ONP” (12 ASCII bytes), from controller num
ber 0, using the linefeed with EOI to mark end of transmission:
4
= 16. Similarly, the decimal value of bit 0 is: 20=1.
Send(0, 6, “*SRE 16;ONP”, 12, NLend)”
4
= 16).
-
Calculating the Bi
nary Weighted Bit
Enabling Service
Request
ExampleCommand the 37XXXC to request service; that is,generate an SRQ,
37XXXC PM2-11
-
-
SRQ HANDLINGGPIB PROGRAMMING BASICS
Commands UsedThe above example uses the following commands defined in the
37XXXC command set:
*SRE –Sends a Status Request Enable mask.
ONP –Outputs the number of sweep points.
NI488
RQ Functions
The following NI488 functions are useful in handling SRQ operations.
Consult your NI488 documentation for full details.
To test for occurrence of SRQ:
q
TestSRQ(board, SRQset)
Where:
SRQset contains 1 if SRQ is set, or 0 if it is not.
·
To wait for occurrence of SRQ and report if it was set:
q
WaitSRQ(board, SRQset)
Where:
· SRQset contains 1 if SRQ was set within the time out allowed, or 0 if it was not. (See paragraph 2-8, Setting GPIB
Operation Time Out.)
q To find out which instrument is requesting service (set SRQ), in-
struct the controller to perform a serial poll and return the
results as follows:
FindRQS(board, addressList, statusByte)
Where:
·
statusByte = The status byte of the first requester found
is returned in this variable.
·
The index in addressList that contains the address of the
instrument requesting service is returned in the IBCNT
global variable.
q
To read out the SRQ byte from an instrument:
ReadStatusByte(board, address, statusByte)
q
To parallel poll, see the following functions in the NI488 docu
-
mentation.
PPoll()
PPollConfig()
PPollUnconfig()
2-1237XXXC PM
GPIB PROGRAMMING BASICSCOMPLETE OPERATIONS
2-11COMPLETE
OPERATIONS
Instruments often require a period of time to complete certain opera
tions such as disk I/O, measurement sweep, data preparation, etc..
Your application program must allow the instrument time to complete
these operations and be able to detect when operations are completed.
The simplest mechanism for synchronizing operations over the GPIB
involve using the *OPC? -Operation Complete query and the *OPC Operation Complete command.
Example 1Command the 37XXXC to perform a sweep and hold then place an
ASCII “1" in its output buffer (*OPC?) when done.
The NI488 Send() function is used to send the 37XXXC at address 6,
the commands,”HLD;TRS;WFS;*OPC?”, from controller number 0,
using the linefeed with EOI to mark end of transmission. The Receive() function is then used to hold the program from continuing
processing until it receives the output of the *OPC command (or
times out):
buffer = “HLD;TRS;WFS;*OPC?”
Send(0, 6, buffer, 17, NLend)
oneByte = 1
Receive(0, 6, buffer, oneByte, STOPend)
-
-
NOTE
The time out must be set high enough to allow the sweep
to complete (see “Setting time outs” in paragraph 2-8).
Example 2Now we will modify the above example to request service when bit 4
(MAV) in the Status Byte Register is set (*SRE 16) to let the program
know when the *OPC? data is ready to be output. This overcomes the
time out problem but it does increase program complexity.
buffer = “*SRE 16;HLD;TRS;WFS;*OPC?”
Send(0, 6, buffer, 25, NLend)
SRQset = 0
WHILE (SRQset = 0)
WaitSRQ(board, SRQset)
ReadStatusByte(board, address, statusByte)
oneByte = 1
Receive(0, 6, buffer, oneByte, STOPend)
NOTE
TestSRQ() can be used instead of WaitSRQ() to check
for the occurrence of SRQ in the WHILE loop. This would
allow your program to perform other tasks while waiting
for SRQ inside the WHILE loop.
37XXXC PM2-13
COMPLETE OPERATIONSGPIB PROGRAMMING BASICS
37XXXC Commands
Used
Examples 1 and 2 above used the following commands defined in the
37XXXC command set:
*SRE - sends a Status Request Enable value.
HLD - places VNA into hold mode
TRS - triggers a sweep. Since the VNA is already
in hold mode, the hold mode is changed to
single sweep and hold.
WFS - waits one full sweep and stops
*OPC? - outputs an ASCII “1” when operation is
complete
NOTE
Refer to Chapter 7, Remote Only Operations for more in
formation and examples on status reporting and service
request generation.
-
2-1437XXXC PM
Chapter 3
Series 37XXXC
Programming Examples
Table of Contents
3-1INTRODUCTION ...................3-3
3-237XXXC PROGRAMMING EXAMPLES.......3-3
3-3EXAMPLE 1 ......................3-4
3-4EXAMPLE 2 ......................3-6
3-5EXAMPLE 3 ......................3-8
3-6EXAMPLE 4 .....................3-10
3-7EXAMPLE 5 .....................3-11
3-8EXAMPLE PROCEDURE 1 .............3-12
3-9EXAMPLE FUNCTION 1 ..............3-13
3-10EXAMPLE PROCEDURE 2 .............3-14
Chapter 3
Series 37XXXC
Programming Examples
3-1INTRODUCTIONThis chapter contains example programs to familiarize the user with
37XXXC programming.Familiarity with manual (front panel) opera
tion of the 37XXXC is assumed. Throughout this section, the 37XXXC
VNA is referred to simply as “37XXXC.”A complete description of
front panel operation is contained in the 37XXXC Vector Network
Analyzer System Operation Manual.
-
3-237XXXC PROGRAMMING
EXAMPLES
Also, it is assumed that you have read Chapters 1 and 2 and are famil
iar with the information they contain. This information describes the
various syntax and functions used in the example sequences presented
throughout the chapter. This includes: Send, Receive,IBCNT, IBERR,
ISNOTEQUALTO,and others.
The main sequences for five example 37XXXC programs are listed and
explained in the following pages. In these examples, the NI488 function calls are abbreviated; refer to Chapter 2 and the NI488 documentation for full details. Refer to the 37XXXC Command Function groups
and the Command listings in this manual for complete details on
37XXXC command operations.
NOTE
The functions and procedures called from the example se
quences in paragraphs 3-3 through 3-7 are provided at the
end of this chapter in paragraphs 3-8 through 3-10.
The intent of these example program sequences is to provide algo
rithms useful when programming various features of the 37XXXC. You
are encouraged to study these algorithms, copy them into your pro
gramming environment, and tailor them for your language and appli
cation.
-
-
-
-
-
37XXXC PM3-3
EXAMPLE 1PROGRAMMING EXAMPLES
3-3EXAMPLE 1This example sequence lists and explains some common 37XXXC op
Program variables instrSetup and sizeInstrSetup will
be used later with the IFP command to input the
saved setup string.
n
Read sweep frequencies
-
q
Trigger and wait for full sweep then hold
Send (0,6,“HLD;TRS;WFS”,NLend)
q
Wait for operations to complete (See “Wait for Instr()” example,
page 3-12.)
WaitForInstr()
q
Request sweep frequencies (OFV):
Use floating point (64 bit) binary format (FMB), Least Signifi
cant Byte first ordering (LSB for IBM/compatible PCs only).
Send (0,6,“LSB;FMB;OFV”,NLend)
q
Get number of bytes to read:
See Chapter 7, “Data Transfer” section for details on <Arbi
trary Block> data transfers and structure of the header used to
precede and give number of bytes in data block. (See “Get
NumBytes( )” example, page 3-13.)
numBytes = GetNumBytes(address, headerString)
q
Read frequencies
freqArray is a floating point double precision array of up to
1601 elements.
Receive(freqArray, numBytes, STOPend)
-
-
-
3-437XXXC PM
PROGRAMMING EXAMPLESEXAMPLE 1
Check for complete transfer
q
if (numBytes ISNOTEQUALTO IBCNT then
gpiberr(“Could not read freq list correctly”)
Reset instrument
n
Send reset command
q
Send (0,6,“*RST”,NLend)
Wait for operations to complete (page 3-12)
q
WaitForInstr()
Download and restore a previously saved setup
n
Command instrument to receive a setup string. Use “NUL
q
Lend” (see Chapter 2, paragraph 2-9.)
Send (0,6,“IFP ”,NLend)
NOTE
The space after the IFP command is needed to separate it from the setup string, which follows.
-
Send the setup string. Use “NLend” (see Chapter 2, paragraph
q
2-9.)
Send (0,6,(instrSetup, sizeInstrSetup),NLend)
q
Check if all data was sent correctly
if (sizeInstrSetup ISNOTEQUALTO IBCNT then
gpiberr(“Error sending setup string”)
n
Select instrument Marker 1 active
Send (0,6,“MR1”,NLend)
n
Read measurement trace
q
Trigger and wait for full sweep then hold
Send (0,6,“TRS;WFS;HLD”,NLend)
q
Wait for operations to complete (page 3-12)
WaitForInstr()
q
Request trace data:
in final trace graph type values (OFD), in floating point (32
bit) binary format (FMC). Use Least significant Byte first or
dering (LSB, for IBM/compatible PCs only)
Send (0,6,“LSB;FMC;OFD”,NLend)
-
37XXXC PM3-5
EXAMPLE 2PROGRAMMING EXAMPLES
Get number of bytes to read (page 3-13)
q
numBytes = GetNumBytes
Read out the trace data values.
q
Receive(traceData, numBytes, STOPend)
Check if all data was transferred
q
if (numBytes ISNOTEQUALTO IBCNT then
gpiberr(“Could not receive data.”)
Calculate number of sweep points in data string
q
POINTSIZE is 8 bytes for data transfers using the FMB for
mat and 4 bytes if using the FMC format. See Chapter 7,
“Data Transfer Commands.”
numFreqs = numBytes / POINTSIZE
Put instrument(s) in local to allow use of front panel
n
EnableLocal(board, addressList)
-
3-4EXAMPLE 2This example sequence lists and explains 37XXXC commands used for
automated 12 Term Calibration.
Display instructions to operator on computer screen
To connect THRU LINE between Ports 1 and 2 and wait for him.
PRINT “Connect THRU LINE between
PRINT “Press ENTER when ready”
Ports 1 and 2"
Measure thruline (page 3-12).
q
TakeCalData()
q
Read Calibration Coefficient Data from instrument and store
the 488.2 data transfer header which is useful for sending the
same size data array back to the 37XXXC later. Also calculate
and store the number of frequency points read in.
q
Request the error term/coefficient array (OC1) in 64 bit Float
ing Point format (FMB), Least Significant Byte order (LSB, for
PCs only). See Chapter 7, “Data Transfer Commands” for the
error terms returned by the OCx series commands.
Send (0,6,“LSB;FMB;OC1”,NLend)
q
Get number of bytes contained in the data string and store the
header read from the 37XXXC into calHeader (string of charac
ters). See GetNumBytes(), page 3-13.
numBytes = GetNumBytes(address, calHeader)
q
Read calibration data values
calData is an 82 element double precision floating point array.
Receive(calData, numBytes, STOPend)
-
-
3-837XXXC PM
PROGRAMMING EXAMPLESEXAMPLE 3
Check if all data was transferred
q
if (numBytes ISNOTEQUALTO IBCNT) then
gpiberr(“Could not receive data.”)
Store number of calibration data bytes transferred
q
calDataSize = IBCNT
Calculate number of frequency points in the data trace if de
q
sired. POINTSIZE is 8 bytes for data transfer using the FMB
format. See Chapter 7, “Data Transfer Commands.” The divi
sion by two is because each data point represents a complex
data pair (real, imaginary).
numFreqs = (CalDataSize / 2) / POINTSIZE
Send Calibration Coefficient Data to instrument
n
Simulate a Transmission Calibration
q
Command the 37XXXC to apply transmission calibration coef
ficients to data (AFT), then input the calibration coefficient ar
ray for transmission error term (IC1), in 64 bit Floating Point
format (FMB), Least Significant Byte order (LSB, for use with
PCs only). Use “NULLend” (see Chapter 2, paragraph 2-9.)
Send (0,6,“AFT;LSB;FMB;IC1”,NLend)
-
-
-
-
NOTE
Note the space after the IC1 command; it is needed to
separate it from the calibration coefficient data array,
which follows.
q
Send cal coefficient #1 data transfer header (same one that was
received from the OC1 transfer). Use “NULLend” (see Chapter
2, paragraph 2-9.)
Consult your compiler documentation for a function
that returns length of a string.
q
Check for proper transfer
if (CalHeaderSize ISNOTEQUALTO IBCNT) then
gpiberr(“Data not sent properly”
q
Send cal coefficient #1 data. Use “NLend” (see Chapter 2, para
)
graph 2-9.)
Send (0,6,(calData, calDataSize),NLend)
-
37XXXC PM3-9
EXAMPLE 4PROGRAMMING EXAMPLES
Check for proper transfer
q
if (calDataSize ISNOTEQUALTO IBCNTl then
gpiberr(“Data not sent properly”)
Wait for operation to complete (page 3-12)
q
WaitForInstr()
Turn on/apply error correction
q
Send “CON”
3-6EXAMPLE 4This is an example sequence showing data string input to the
37XXXC.The string sent below is used to set hardcopy data output la
bels.
-
The 37XXXC requires the double quote characters (“ ”) to delimit AS
CII strings being sent to it. That is, to send a string called mystring
you would actually send
“
mystring”.This presents a problem since
programming languages also delimit a character string with double
quotes. In order to send the 37XXXC a quote(“)asaregular character, you must precede it with the backslash (\) character in the C language and with a quote character (”) in BASIC.
NOTE
A 37XXXC ASCII string may also be delimited using
a single quote character(')atthebeginning and end
of the string.In which case,the backslash (\) for C
and the double quote (“) in BASIC are not required.
n
Define DUT Model in the data label.
The following command sequence needs to be sent to the
37XXXC:
LMS “4_8_FILTER”
q
If using C use this syntax
Send (0,6,“LMS \”4_8_FILTER\”“,NLend)
q
If using BASIC use this syntax
Send (0,6,“LMS ““4_8_FILTER”””,NLend)
-
q
Here the same command sequence can be sent with the single
quotes (' ') without the need for additional character as above.
Send (0,6,“LMS '4_8_FILTER'”,NLend)
n
If shutting down the GPIB immediately after this series of com
mands, then you must also make the controller wait for the
37XXXC to completely receive this data before shut down.
WaitForInstr()
3-1037XXXC PM
PROGRAMMING EXAMPLESEXAMPLE 5
3-7EXAMPLE 5This example sequence lists and explains 37XXXC commands for
37XXXC internal disk operations.
Sweep, and store channel 1 trace data to memory
n
Send (0,6,“CH1;S11;CH3;S21;WFS;CH1;STD”,NLend)
Store trace memory data to hard disk
n
The following command sequence needs to be sent to the
37XXXC:
Send (0,6,“SAVE 'C:\CH1_S21.NRM'”,NLend)
Wait for operations to complete (page 3-12)
n
WaitForInstr()
Output channels 1 Tabular Data to instrument floppy disk
n
Send (0,6,“SAVE 'A:\CH1_S21.DAT'”,NLend)
Wait for operations to complete
n
WaitForInstr()
Save Front Panel and Calibration setup to hard disk
n
Send (0,6,“SAVE 'C:\SETUP1.CAL'”,NLend)
Wait for operations to complete
n
WaitForInstr()
n
Reset system to default state
Send (0,6,“*RST”,NLend)
n
Recal Front Panel and Calibration setup from hard disk
Send (0,6,“RECALL 'C:\SETUP1.CAL'”,NLend)
n
Wait for operations to complete
WaitForInstr()
n
Recall channel trace/noramlization data from hard disk to CH3
Delete channel 1 trace/normalization data file from hard disk
Send (0,6,“DEL 'C:\CH1_S21.NRM'”,NLend)
n
Wait for operations to complete
WaitForInstr()
37XXXC PM3-11
EXAMPLE PROCEDURE 1PROGRAMMING EXAMPLES
3-8EXAMPLE PROCEDURE 1This example sequence provides coding for the Wait for Instr () proce
dure used earlier in this chapter's example sequences.
NOTE
Do not use this procedure if the instrument was com
manded to output data that has yet to be read by the
program since the *OPC? query will, in itself,output
data (the character “1” )when done with previous op
eration.
Set GPIB time out limit to insure enough time is allowed for in
n
strument operations to complete. See ibtmo() in the NI488
documentation for details.
ibtmo(instrument_handle, T1000s)
Send the Operation Complete query
n
Send (0,6,“*OPC?“,NLend)
Wait for instrument to output the ASCII character “1”
n
numBytes=1
Receive(buffer, numBytes, STOPend)
Restore default time out limit
n
ibtmo(instrument_handle, T10s)
-
-
-
-
3-1237XXXC PM
PROGRAMMING EXAMPLESEXAMPLE FUNCTION 1
3-9EXAMPLE FUNCTION 1This example sequence provides coding for the GetNumBytes() func
tion used earlier in this chapter's example sequences.
GetNumBytes() reads the 37XXXC output buffer and returns the
number of data bytes to be transfered in the ensuing <Arbitrary
Block> data string (see Chapter 7, “Data Transfers”). It does this by
reading out and decoding the string data header. It will copy the
header read out of the 37XXXC into headerString so the calling pro
gram can use it in cases where the same data block will be sent back
to the 37XXXC,i.e., OC1/IC1.
NOTE
Consult your programming language documentation for
string functions to copy,concatenate,and return value of
string.
Read the first byte in the instrument output buffer. Buffer is a
n
temporary array of characters of size 10.
numBytes = 1
Receive(buffer, numBytes, STOPend)
Check to be sure it is the “#” character then copy it to header-
n
String
if (buffer[0] ISNOTEQUALTO '#') then
gpiberr(“Invalid data string”)
else COPY(buffer, headerString)
-
-
n
Read second header byte from the instrument output buffer and
append it (concatenate) to headerString
This number is the next set of bytes to read. Those
bytes when taken as a number will yield the number
of actual data bytes contained in the binary string.
n
Read the number of bytes indicated by numBytes and append
them (concatenate) to headerString
Save the buffer value as a number
numBytes = VALUEOF(buffer)
NOTE
numBytes is the number of bytes, of actual data re
quested, waiting in the output buffer of the 37XXXC.
-
37XXXC PM3-13
EXAMPLE PROCEDURE 2PROGRAMMING EXAMPLES
Return number of bytes to calling program
n
Return numBytes
NOTE
At this point headerString is exactly the same as the
data transfer header output by the 37XXXC. Recall
that this is useful to the calling program in cases
where the same data read out is to be sent back to
the instrument.
3-10EXAMPLE
PROCEDURE 2
This example sequence provides coding for the TakeCalData() proce
-
dure used earlier in this chapter's example sequences.
The TakeCalData() procedure will wait for the operator to press a key
on the computer then measure the cal standard installed.
Wait for operator to press a key on computer when he is ready
n
WAITUNTIL (key is pressed)
NOTE
Consult your compiler documentation for a function
that waits for a key to be pressed.
n
Take cal data then go on to next calibration step
Send (0,6,“TCD;NCS”,NLend)
n
Wait for operation to complete (page 3-12)
WaitForInstr()
3-1437XXXC PM
Part2
GPIBFunction
Groups
This part consists of six chapters that relate the 37XXXC GPIB
commands to functional groups. Tables within each group provide command descriptions and relationships to front panel keys
and their associated menu functions.
Chapter 4 – describes the commands and suffix mnemonics that
relate to Measurement Functions.
Chapter 5 – describes the commands that relate to Calibration
Functions.
Chapter 6 – describes the commands that relate to Markers and
Limits Functions.
Chapter 7 – describes the commands that relate to Remote-Only
Functions.
Chapter 8 – describes the commands that relate to System Func
tions.
Chapter 9 – describes the commands that relate to Special Ap
plications Functions.
-
-
Chapter 4
Measurement Functions
Table of Contents
4-1INTRODUCTION .........................4-3
4-2SUFFIX CODES ..........................4-3
4-3CHANNELS GROUP .......................4-5
4-4DISPLAY GROUP .........................4-6
Display Mode Function: ......................4-6
Trace Memory Function:......................4-6
Limits Function: ..........................4-6
Scale Functions: ..........................4-6
Graph Type Functions: ......................4-7
4-5MEASUREMENT GROUP ....................4-9
4-6ENHANCEMENT GROUP ...................4-12
Chapter 4
Measurement Functions
4-1INTRODUCTIONThis chapter describes the measurement function commands (and suf
fix mnemonics) that control the channel control, measurement control,
display control, and enhancement group functions.
NOTE
See Chapter 9, Special Applications Functions for meas
urement applications.
-
4-2SUFFIX CODESMany 37XXXC GPIB commands require a following numeric value (or
values) that quantify the 37XXXC operational parameters being con
trolled (i.e., frequency, power, etc). These numeric values are scaled to
the following units as appropriate:
DECIBELSMETERSSECONDS
DEGREESOHMSVOLTS
HERTZ
All numeric data entries can be followed by an optional suffix mnemonic (see example). The suffix mnemonics for the 37XXXC are listed
in Table 4-1. These mnemonics define a weighting factor that is applied
to the associated numeric data value. (They perform the same function
as the data entry termination keys on the 37XXXC front panel.) Fur
thermore, suffix mnemonics imply unit type, thus enhancing the read
ability of application programs.
4-3CHANNELS GROUPThe commands listed in Table 4-2 perform two separate sets of
functions:
Select the currently active channel (CH1–CH4). The active chan
q
Table 4-2. Channel Command Group
nel is that channel to which any subsequent channel-based com
mands are applied.
Select single or multi-channel display mode (commands D13,
q
D14, D24, DSP, T13, and T24). Commands T13 and T24 each pro
duce a single display frame containing overlaid traces for the two
channels specified.
-
-
-
Front Panel
Key/Function
Ch1 keyCH1Selects channel 1 as active channel.
Ch2 keyCH2Selects channel 2 as active channel.
Ch3 keyCH3Selects channel 3 as active channel.
Ch4 keyCH4
CHX?
D13Selects dual channel display, channels1&3.
D14Selects quad display, all four channels.
D24Selects dual channel display, channels2&4.
DSPSelects single channel display, using the currently active channel.
DSP?Channel display mode query.
T13Selects overlaid dual channel (1 & 3) display (one display frame).
T24Selects overlaid dual channel (2 & 4) display (one display frame).
Active channel query.
37XXXC PM4-5
DISPLAY GROUPMEASUREMENT FUNCTIONS
4-4DISPLAY GROUPThe Display key offers menu selections that provide Display Mode,
Trace Memory, Limits,Scale, and Graph Type functions, all of which
are described below.
Display Mode
Function:
Trace Memory
Function:
Limits Function:This function is closely related to the Marker key functions; therefore,
Scale Functions:This function provides for resolving measurement values. There are se
This function provides selections for the display mode: Single, Dual
1&3, Dual 2&4, Overlay 1&3, Overlay 2&4, or Four Channel.
This function provides a sequence of menus that provide memory and
math functions.Memory functions allow viewing of Data, Memory,
Data & Memory, Data times Memory, Store Memory, and Disk Opera
tions. Math functions provide Add, Substract, Multiply, and Divide op
erations.
it is described in Chapter 7, along with markers.
lections for Log or Linear Magnitude, Phase,Smith Chart, Group De
lay, Real or Imaginary. The operation of these commands are obvious,
except for SCL, REF, and OFF.
SCL Command
This command sets the scaling-per-division characteristics of the graph
on the active channel. The associated data value determines the resultant scaling factor. The SCL command can also be used to set the scaling on Smith chart type display as follows:
VALUESCALING
–3Setsa3dBcompressed scale
0Sets the normal Smith chart scale
10Sets a 10 dB expanded scale
20Sets a 20 dB expanded scale
30Sets a 30 dB expanded scale
-
-
-
-
REF Command
This command selects the graticule line of the active channel data dis
play on which to place the "REFERENCE LINE." The Reference Line
is the graticule line to which the caret points on the 37XXXC display,
or graph. (Lines 0, 4, and 8 are the bottom, middle, and top of the graph
respectively.)
NOTE
There is no reference line defined for Smith charts, in
verted Smith charts,and linear polar or log polar displays.
OFF Command
This command sets the value of the offset associated with the "REFER
ENCE LINE" in the data graph display.
-
-
4-637XXXC PM
-
MEASUREMENT FUNCTIONSDISPLAY GROUP
Changing the scaling-per-division (SCL), the Reference Line position
(REF), or the offset value (OFF) in the bottom (secondary) graph of a
two graph display is accomplished by using the appropriate suffix
mnemonic for that graph, as shown in the table below. For example: to
set the scaling value for the phase display of a log/phase type graph,
use:
"SCL 20 DEG".
Graph Type
Functions:
Command
Log Mag / PhaseLin Mag / PhaseReal / Imaginary
SCL / OFFDEG / RADDEG / RADIMU
REFDEGDEGIMU
This function provides for selecting any of the various type of display
graphs: Log or Linear Magnitude, Phase, Real, Imaginary, Log or Lin
ear Polar, Smith Chart (Impedance), Smith Chart (Admittance), Group
Delay, Power Out, SWR, Log Magnitude and Phase, Linear Magnitude
and Phase, Real and Imaginary.
The usage of most of these commands is obvious, except SME, ISE,
SMC and ISC.
All the commands in the Display Group act on the currently selected active channel (see paragraph 4-3, Channels Group).
Both the SME and ISE commands require an associated data value to
be included with the command (Table 4-3). The allowable data values
for these commands are: 0, 10, 20, and 30. The example below selects a
20 dB expanded Smith chart on the active channel.
Graph Type
-
NOTE
Example: "SME 20 DBL"
Commands SMC and ISC also require an associated data value to be
included with the command. The allowable data values for these com
mands are 0 and 3. The example below selectsa3dBcompressed
Smith chart on the active channel.
Example: "SMC 3 DBL"
The Display key commands are listed in Table 4-3.
-
37XXXC PM4-7
DISPLAY GROUPMEASUREMENT FUNCTIONS
Table 4-3. Display Group Commands (1 of 2)
CommandDescription
ADDSelect addition as trace math for active channel
APREnter group delay aperture setting on active channel
APR?Output group delay aperture setting on active channel
ASCAutoscale the active channel display
ASPEnter polar stop sweep position angle
ASP?Output polar stop sweep position angle
ASTEnter polar start sweep position angle
AST?Outputpolar start sweep position angle
DATDisplay data only on active channel
DAT?Output trace memory display mode
DIASelect air as active dielectric
DIEEnter a dielectric value
DIMSelect microporous teflon as active dielectric
DIPSelect polyethylene as active dielectric
DITSelect Teflon as active dielectric
DIVSelect division as trace math for active channel
DIX?Output dielectric constant
DLASelect group delay display for active channel
DNMDisplay data normalized to trace memory on active channel
DTMDisplay measurement data and trace memory on active channel
GRF?Output graph type for active channel
IMGSelect imaginary display for active channel
ISCEnter scale and select inverted compressed Smith Chart display
ISEEnter scale and select inverted expanded Smith Chart display
ISMSelect normal inverted Smith Chart for active channel
LINSelect linear magnitude display for active channel
LPHSelect linear magnitude and phase display for active channel
MAGSelect log magnitude display for active channel
MEMDisplay trace memory on active channel
MINSelect subtraction as trace math for active channel
MOSETEnter constant offset log magnitude for active channel
MOSET?Output constant offset log magnitude for active channel
MPHSelect log magnitude and phase display for active channel
MTH?Output trace math math type
MULSelect multiplication as trace math for active channel
OFFEnter offset value for top graph of active channel
OFF2Enter offset value for bottom graph of active channel
OFF2?Output offset value for bottom graph of active channel
OFF?Output offset value for top graph of active channel
PCPSelect measurement phase polar chart mode
PCSSelect sweep position polar chart mode
PCX?Output polar chart mode
PHASelect phase display for active channel
PHOEnter phase offset for display channel
PHO?Output phase offset for display channel
PLGSelect log polar display for active channel
PLRSelect linear polar display for active channel
POSETEnter constant offset phase for active channel
POSET?Output constant offset phase for active channel
POWSelect power out display for active channel
4-837XXXC PM
MEASUREMENT FUNCTIONSMEASUREMENT GROUP
Table 4-3. Display Group Commands (2 of 2)
CommandDescription
RDASelect automatic reference delay calculation
RDDEnter reference delay in distance for active channel
RDD?Output reference delay in distance for active channel
RDTEnter reference delay in time for active channel
RDT?Output reference delay in time for active channel
REFEnter reference line for top graph of active channel
REF2Enter reference line for bottom graph of active channel
REF2?Output reference line for bottom graph of active channel
REF?Output reference line for top graph of active channel
RELSelect real display for active channel
RIMSelect real and imaginary display for active channel
SCLEnter Scale Resolution for top graph of active channel
SCL2EnterScale Resolution for bottom graph of active channel
SCL2?Output Scale Resolution for bottom graph of active channel
SCL?OutputScale Resolution for top graph of active channel
SETUPDisplay setup menu
SMCEnter scale and select compressed Smith Chart display
SMEEnter scale and select expanded Smith Chart display
SMISelect normal Smith Chart for active channel
STDStore trace to memory on active channel
SWRSelect SWR display for active channel
4-5MEASUREMENT GROUPThe commands listed in Table 4-4 control sweep and test signal
funcions. This inicludes frequency, power, attenuation, Hold functions,
and Trigger/IF calibration.
Table 4-4. Measurement Group Commands (1 of 3)
CommandDescription
AH0Turn automatic DUT protection off
AH1Turn automatic DUT protection on
AHX?Output automatic DUT protection on/off status
BH0Turn bias off while in hold
BH1Turn bias on while in hold
BHX?Output bias on/off during hold status
CNTREnter center frequency
CNTR?Output center frequency
CTNContinue sweeping from current point
CWDECSubtract 1 from the current CW index
CWFEnter CW frequency and turn CW on
CWF?Output CW frequency
CWIEnter index for CW frequency and turn CW on
CWI2F?Output frequency for index given
CWI?Output current index number
CWINCAdd 1 to the current CW index
CWN2IAdd N to the current CW index
37XXXC PM4-9
MEASUREMENT GROUPMEASUREMENT FUNCTIONS
Table 4-4. Measurement Group Commands (2 of 3)
CommandDescription
CWONTurn CW on at current CW frequency
CWON?Output CW on/off status
CWPEnter number of points drawn in CW
CWP?Output number of points drawn in CW
CWSRTSet CW frequency to the start frequency
CWSTPSet CW frequency to the stop frequency
EANAINMeasure External Analog In on active channel
FHISet data points to 1601
FILFill defined discrete frequency range
FLOSet data points to 101
FMESet data points to 401
FP0Turn flat power correction off
FP1Turn flat power correction on
FRCClear all defined discrete frequency ranges
FRIEnter Discrete Fill increment frequency
FRPEnter Discrete Fill number of points
FRSEnter Discrete Fill start frequency
HC0Disable internal IF calibration
HC1Enable internal IF calibration and trigger an IF calibration
HCTTrigger an IF calibration
HCX?Output internal IF calibration enable/disable status
HLDPut sweep into hold mode
HLD?Output the sweep hold status
HLDX?Output hold mode (continue, restart, or single sweep)
IFPEnter current front panel setup
IFVEnter frequency values
IS1Enter front panel setup 1
IS10Enter front panel setup 10
IS2Enter front panel setup 2
IS3Enter front panel setup 3
IS4Enter front panel setup 4
IS5Enter front panel setup 5
IS6Enter front panel setup 6
IS7Enter front panel setup 7
IS8Enter front panel setup 8
IS9Enter front panel setup 9
LA1Select a1 = Ra as phase lock for parameter being defined
LA2Select a2 = Rb as phase lock for parameter being defined
LAX?Output phase lock selection for parameter being defined
NP101Set data points to 101
NP1601Set data points to 1601
NP201Set data points to 201
NP401Set data points to 401
NP51Setdata points to 51
NP801Set data points to 801
ONDFOutput number of discrete frequencies
PTPEnter the target power for flat power correction
PTP?Outputthe target power for flat power correction
PW1Enter external source 1 power level
PW1?Output external source 1 power level
PW2Enter external source power level
PW2?Output external source power level
4-1037XXXC PM
MEASUREMENT FUNCTIONSMEASUREMENT GROUP
Table 4-4. Measurement Group Commands (3 of 3)
CommandDescription
PWREnter internal source power level
PWR?Output internal source power level
RH0Select RF off in hold mode
RH1Select RF on in hold
RHX?Output RF on/off during hold status
RT0Turn retrace rf off
RT1Turn retrace rf on
RTX?Output retrace rf on/off status
S11Measure S11 on active channel
S12Measure S12 on active channel
S21Measure S21 on active channel
S22Measure S22 on active channel
SA1Enter port 1 source attenuator value
SA1?Output port 1 source attenuator value
SA1MAX?Output port 1 source attenuator max value
SAMP2Use 2 samplers for measurements
SAMP3Use 3 samplers for measurements
SAMP?Output the number of samplers used for measurements
SELSPSelect S-Parameter test set operation
SPANEnter frequency span
SPAN?Output frequency span
SRC2?Output external source 2 existence information
SRTEnter start frequency
SRT?Output start frequency
STPEnter stop frequency
STP?Outputstop frequency
SWPReturn to normal sweep mode
SWP?Output sweep mode
SWPDIR?Output instantaneous sweep direction forward/reverse
SXX?Output s parameter or user defined parameter of active channel
TA2Enter port 2 test attenuator value
TA2?Output port 2 test attenuator value
TA2MAX?Output port 2 test attenuator max value
TEXSelect external measurement triggering
TINSelect internal measurement triggering
TRSTrigger/restart sweep
TXX?Outputtrigger source
WFSWait full sweep until all display data is valid
37XXXC PM4-11
ENHANCEMENT GROUPMEASUREMENT FUNCTIONS
4-6ENHANCEMENT GROUPThe commands listed in Table 4-5 control the data enhancement func
tions of the 37XXXC, which include IF bandwidth, averaging,and
smoothing. These functions are the same as those controlled by the
37XXXC front panel Enhancement key group.
NOTE
Most of the commands associated with the Options Menu
key are contained in Chapter 9, Special Applications Func
tions. However, the Triggers and I.F. Cal commands are
contained in Table 4-4 in paragraph 4-5, Measurement
Control.
Table 4-5. Enhancement Group Commands
CommandDescription
AOFTurn averaging off
AOF?Output averaging on/off status
AONTurn averaging on
AVGEnter averaging count and turn on
AVG?Output averaging count
AVGCNT?Output the current sweep-by-sweep average sweep count
IF1Select 10 Hz IF bandwidth
IF2Select 100 Hz IF bandwidth
IF3Select 1 KHz IF bandwidth
IF4Select 10 KHz IF bandwidth
IFASelect 30 KHz IF bandwidth
IFMSelect 10 Hz IF bandwidth
IFNSelect 1 KHz IF bandwidth
IFRSelect 100 Hz IF bandwidth
IFX?Output IF bandwidth
MEASDLYSet Measurement Delay time
MEASDLY0DisableMeasurement Delay
MEASDLY1EnableMeasurement Delay
MEASDLY?OutputMeasurement Delay time
MEASDLYX?Output Measurement Delay on/off status
PTAVGSet averaging type to point-by-point averaging
RSTAVGReset the sweep-by-sweep averaging sweep count
SOFTurn off smoothing
SOF?Output smoothing on/off status
SONEnter smoothing value and turn on
SON?Output smoothing value
SPLNSelect normal source lock polarity
SPLRSelect reverse source lock polarity
SPLX?Output source lock polarity normal/reverse status
SPR0Turn spur reduction off
SPR1Turn spur reduction on
SPRX?Output spur reduction on/off status
SWAVGSet averaging type to sweep-by-sweep averaging
SWAVG?Output averaging type (sweep-by-sweep or point-by-point)
-
-
4-1237XXXC PM
Chapter 5
Calibration Functions
Table of Contents
5-1INTRODUCTION .........................5-3
5-2RELATED COMMANDS .....................5-3
5-3REQUIRED COMMAND SEQUENCE .............5-4
5-4FUNCTIONAL COMMANDS..................5-6
5-5EXAMPLE PROGRAM ......................5-8
5-6FLAT TEST PORT.........................5-9
Flat Test Port Power Calibration Coefficients ..........5-9
5-7CALIBRATION COMMANDS ..................5-11
5-8AUTOCAL FUNCTIONS.....................5-15
Chapter 5
Calibration Functions
5-1INTRODUCTIONThis chapter describes the 37XXXC S-Paremter error correction (cali
bration) functions.It describes the commands used to perform the fol
lowing:
Specify the calibration method, type, standards, and parameters.
q
Control the calibration data-taking process.
q
NOTES
See Measurement/Test Signals Group for a description
·
of the flat test port power calibration commands.
· The 37XXXC calibration functions require operator intervention. However,it is possible to use the external
controller to guide the operator through the calibration
process using a suitable program containing the calibration commands described in this chapter.
5-2RELATED COMMANDSRelated, non-calibration commands used during the calibration pro-
cess are described in Table 5-1. The use of these commands, in relation
to calibration activities,is described throughout this chapter,where
appropriate. These command sets are fully described in their respective chapters as indicated in Table 5-1.
NOTE
See ICx and OCx series commands in the Data Transfer
group (Chapter 7) for information on inputting and output
ting calibration terms coefficients (error terms).
AllMeasurement, Test Signals (Ch 5)
AllDisplay, Graph Type (Ch 5)
AllDisplay, Scaling (Ch 5)
AVG, AOF.
AON
IFA, IFN, IFR,
IFM, IF1–IF4
CH1–CH4Channels Group (Ch 5)
Measurement Group, Data Points
(Ch 5)
Measurement Group, Frequency
(Ch 5)
(Ch 8)
Enhancement, Averaging (Ch 5)
Enhancement, Video IF Bandwidth
(Ch 5)
A program used to control the calibration process must follow a specific order for the GPIB calibration commands that are used. Table 5-2
lists this acceptable order.
* Refer to Chapter 5, "Measurement Group" for details on these commands.
** See Chapter 8, Measurement Points Data Transfer Commands) CWF
37XXXC PM5-5
FUNCTIONAL COMMANDSCALIBRATION FUNCTIONS
5-4FUNCTIONAL
COMMANDS
Commands used for special types of calibrations are described in Table
5-3. The commands are used to invoke options and non-standard cali
bration procedures,and to simulate a calibration process.
Table 5-3. Functional Commands Listing (1 of 2)
CommandFunctionDescription
NOCSpecify Normal Sweep
Calibration
DFCSpecify Discrete Fre
quency Calibration
CWCSpecify CW CalibrationThis command sets up a continuous wave (CW) calibration. Use CWF to
P1C, P2CSet up to Specify Port 1
(PIC) or Port 2 (P2C) Standards
CNDOther Connector Specifica-
tion
SLD, BBLSpecify Sliding Load or
Broad Band Load for Cali
bration
LM2, LM3These commands are used to select a match for the second or the third
A12, A8T,
A8R, ARF,
AFT, ARB,
ARR, ABT,
ART
Calibration simulationThese commands simulate the completion of a calibration. The Axx series
-
This command sets up a normal frequency range calibration.
This command sets up a calibration at discrete frequencies only. Use dis
crete fill commands to input frequency list for calibration. Refer to Chapter
5, Measurement Functions, paragraph 5-4.
Alternatively,the IFV command allows for a frequency list input of calibra
tion frequencies. Refer to “Data Transfer Commands Group (Chapter 8),”
for more details.
input CW frequency.
This command specifies Port 1 or Port 2 as the port to which subsequent
connector-related commands will apply.
Example:
“P1C;CFK;P2C;CMK”
This sequence of commands sets up a female K connector for port 1 (P1C
CFK) and a male K connector for port 2 (P2C CMK).
This command allows a non-standard connector to be specified. This is
the same as selecting OTHER from the front panel menu. When specifying the CND command, the connector offset for the open and/or short device and the capacitance coefficients for the open device also need to be
entered to characterize the connector.
Thie SLD command specifies a sliding load. The data-taking process for
-
the load includes six slide positions. If any frequencies are below 2 GHz,
you must also use a broadband load.
device respectively during a LRM type calibration.
commands must be followed with the corresponding calibration error term
coefficients using the ICx commands (see Chapter 8).
The Axx series commands match up with corresponding calibration type
commands. For example, A12 simulates C12, A8T simulates C8T, etc.
-
-
-
NOTE
If you attempt to apply a calibration without first having entered
calibration coefficient data, the error correction may not be ap
plied (as indicated by the Apply Cal LED being momentarily
turned on, then off).
-
5-637XXXC PM
CALIBRATION FUNCTIONSFUNCTIONAL COMMANDS
Table 5-3. Functional Commands Listing (2 of 2)
CommandFunctionDescription
CON, COFTurn on/off vector error
correction
BEG, TC1,
TC2, TCD,
NCS, KEC,
RPC
U10, U15,
U25
MAT, MIXLoad match for Reflection
Calibration Sequencing
and Control commands
Calibration Kit selection
commands
devices measurement
sequences
These commands are not used during calibration. They are used during
normal measurements to apply the current calibration error correction to
the measured data (CON) or to turn off error correction calibration (COF).
These commands are used to start and control the data-taking process.
KEC will keep existing calibration error corrections and return to the
measurement mode. Command TC1 takes calibration data for the current
(calibration) standard for port 1 using a separate forward measurement
sweep. Command TC2 performs the same function for port 2 using a
separate (reverse) sweep. (Note that command TCD performs these iden
tical operations, using consecutive forward and reverse measurement
sweeps.)
Using the TC1 and TC2 commands allows one calibration standard of
each type to be used for both ports.
These commands are used to select 10, 15, or 25 mil UTF calibration kits
respectively.These calibration kits are used to perform a 37XXXC calibration for microstrip device measurements.
The MAT (MATched) command changes the measurement sequence for
the standard 12 term, coaxial, two-channel calibration so that the “open”
measurements are performed in sequence, followed by the “short” measurements. The MIX (MIXed) command returns to the normal sequence for
a two-channel 12 term calibration.
-
37XXXC PM5-7
EXAMPLE PROGRAMCALIBRATION FUNCTIONS
5-5EXAMPLE PROGRAMThe following is an example of how to set up a calibration sequence for
This example code sets up a calibration using standard calibration
mode (SCM), coax cable media (LTC), and 12-term calibration type
(C12). A discrete set of points is defined for frequency operation start
ing at 1 GHz (FRS 1.0 GHZ), spaced 100 MHz apart (FRI 100 MHZ),
at 41 consecutive points (FRP 41 XX1). This range is confirmed or
"filled" ( FIL), then completed (DFD).
The Port 1 test port connector is defined as a female type K connector
(P1C CFK) and the Port 2 test port connector is defined as a male K
type connector (P2C CMK). Broadband loads are selected as the de
fault load type (BBL). The BEG command instructs the 37XXXC to
begin the calibration-data-taking-process.
-
-
The calibration control program should contain commands to control
the data-collection portion of the calibration process. Typical commands used for this process are:
q
Take Calibration Data for Current Standard (TCD,orTC1,or
TC2)
q
Go on to the Next Calibration Step (NCS)
q
Averaging On and Set to Value (AVG)
q
Set IF Bandwidth to 10 Hz (IF1)
q
Set IF Bandwidth to 100 Hz (IF2)
q
Set IF Bandwidth to 1 KHz (IF3)
q
Set IF Bandwidth to 10 KHz (IF4)
q
Any Graph Type Specification or Scaling Change
q
Active Channel Specification (CH1–CH4)
The TCD (or TC1,orTC2) and NCS commands control the data-
taking process.Commands AVG, IFN, IFR, IFA, and IFM control the
data-enhancement function used for a particular measurement (refer
to Chapter 3, paragraph 5-6, Enhancement Commands).
Before the TCD (or TC1,orTC2) and NCS commands are invoked in
the program, the system operator must be instructed to perform the
exact steps necessary to setup the calibration sequence for the type of
37XXXC calibration to be used. An example program segment to con
tinue the 12-term calibration started in the previous example is shown
on the next page. This example program segment is written in HPBASIC.
The calibration control program should determine if the 37XXXC is
ready for the next step of the calibration sequence before prompting
the system operator to connect new calibration standards to the test
5-837XXXC PM
CALIBRATION FUNCTIONSFLAT TEST PORT
ports. This can be done by monitoring the status byte of the 37XXXC
or by waiting for the operation to complete after executing the NCS
command.
For example, the commands in the following example instruct the
37XXXC to take calibration data (TCD), go to the next calibration step
(NCS), then output the number "1" (*OPC?). When the controller is
able to read the number "1" from the 37XXXC, the calibration step is
complete.
260 OUTPUT 706;"TCD;NCS;*OPC?"
270 ENTER 706; N$ ! READ AND DISCARD ASCII '1' WHEN
STEP IS COMPLETE
280 DISP "CALIBRATION STEP COMPLETE"
5-6FLAT TEST PORTSignal source power correction data produced during this type of
37XXXC calibration is used to flatten the signal power output from the
test set port(s) over a specified frequency range. This feature is used to
provide flat test stimulus signals to the device-under-test while performing normal measurements.
Flat Test Port Power
Calibration Coefficients
This process requires operator intervention. The system operator is
guided through a sequence of operations and measurements that
make up the flat test port calibration sequence. Before attempting to
write a GPIB controlled program to produce this calibration sequence,
first become thoroughly familiar with the manual procedure.
Flat test port calibrations require considerable time to perform. The
time required is dependent upon the number of points selected; For
these calibrations,the GPIB timeout value must be increased accord
ingly, or the control program must generate an appropriate time delay
before executing subsequent commands. See the documentation for
your GPIB controller for timeout-setting procedures.
The commands listed in Table 5-4 are used to invoke and control flat
test port calibrations.
The coefficients are input and output using the following codes:
q
IFPC – Enter the power sweep linearity calibration coefficients
q
OFPC – Output the power sweep linearity calibration coeffi
cients
These codes would be useful in applications where there is no power
meter to hook up to the 37000 to perform the calibration normally, or
the power meter is not one of the ones that the 37000 has been pro
grammed to interface with.
-
-
-
The code OFPC outputs an arbitrary block of binary or ASCII data de
pending on the output mode selected with the codes FMA, FMB, FMC,
37XXXC PM5-9
-
FLAT TEST PORTCALIBRATION FUNCTIONS
LSB and MSB.See the description of these codes in Chapter 10. See
Chapter 10, paragraph 10-3 for a description of the arbitrary block for
mat. Each coefficient represents the adjustment in dB (correct to a
hundredth of a dB) required to achieve the correct power at the partic
ular frequency point. There will be as many coefficients as there are
frequency points in the sweep. If a VNA does not currently have a
valid power sweep linearity calibration in place when the OFPC is re
ceived, an arbitrary block will be sent with zeros for each coefficient.
The code IFPC is used to input coefficients into the VNA and set up a
valid flat test port power calibration. The coefficients are contained in
an arbitrary block, which follows IFPC.The makeup of the arbitrary
block is identical to the one described above. The VNA must be pro
grammed with the appropriate number of frequency points prior to re
ceiving IFPC. If the number of coefficients in the arbitrary block does
not match what would be required by the current VNA setup, the data
will be rejected and an error message displayed on the screen and re
corded in the service log.
Table 5-4. Flat Test Port Power Commands
-
-
-
-
-
-
CommandsDescription
PTPEnter target power for calibration.
PTP?Outputtarget power for calibration.
PTSSelects the number of frequency points (1 – 65) to be skipped between each measured point on
the power measurement sweep. It therefore determines the number of points measured on each
sweep .
PTS?Skippedpoints for flat test port power calibration query .
SFCStartsthe flat test port calibration sequence.
FP1Causes the flat test port power correction data to be used during normal measurement mode.
FP0Turns off the flat test port power correction for normal measurement mode.
FPX?Flatpower ON/OFFstatus query.
IFPCEnter the power sweep linearity calibration coefficients
OFPCOutput the power sweep linearity calibration coefficients
5-1037XXXC PM
CALIBRATION FUNCTIONSCALIBRATION COMMANDS
5-7CALIBRATION
COMMANDS
Table 5-5 provides a listing of the commands used to perform measure
ment calibrations.Unless otherwise noted, all front panel menus men
tioned in Table 5-5 are accessed by first pressing the Begin Cal key.
Table 5-5. Calibration Commands (1 of 4)
CommandDescription
A12Simulate 12-term calibration
A8RSimulate 1-path 2-port calibration reverse path
A8TSimulate 1-path 2-port calibration forward path
ABTSimulate trans freq response calibration forward and reverse
AFTSimulate transmission frequency response calibration forward path
ARBSimulate reflection only calibration both ports
ARFSimulate reflection only calibration port 1
ARRSimulate reflection only calibration port 2
ARTSimulate trans freq response calibration reverse path
BBLSelect broadband load for calibration
BBZEnter broadband load impedance for calibration
BBZLEnterbroadband load inductance for calibration
BEGBegin taking calibration data
BPFEnter break point frequency for 3 line LRL calibration
C12Select 12 term calibration
C8RSelect 1-path 2-port calibration reverse path
C8TSelect 1-path 2-port calibration forward path
CBTSelect trans freq response calibration forward and reverse
CC0Enter capacitance coefficient 0 for open
CC1Enter capacitance coefficient 1 for open
CC2Enter capacitance coefficient 2 for open
CC3Enter capacitance coefficient 3 for open
CF1Select female 1.0 mm connector for current port
CF2Select female 2.4mm connector for current port
CF3Select female GPC-3.5 connector for current port
CF716Select female 7/16 connector for current port
CFCSelect female TNC connector for current port
CFKSelect female K connector for current port
CFNSelect female Type N connector for current port
CFN75Select Female type N 75-ohm connector for current port
CFSSelect female SMA connector for current port
CFSPSelect Special Female connector for current port
CFSPASelect Band A special female connector for current port
CFSPBSelect Band B special female connector for current port
CFSPCSelect Band C special female connector for current port
CFTSelect trans freq response calibration forward path
CFVSelect female V connector for current port
CL0Enter inductive coefficient 0 for short
CL1Enter inductive coefficient 1 for short
CL2Enter inductive coefficient 2 for short
CL3Enter inductive coefficient 3 for short
CM1Select male 1.0 mm connector for current port
CM2Select male 2.4mm connector for current port
CM3Select male GPC-3.5 connector for current port
CM716Select male 7/16 connector for current port
-
-
37XXXC PM5-11
CALIBRATION COMMANDSCALIBRATION FUNCTIONS
Table 5-5. Calibration Commands (2 of 4)
CommandDescription
CMCSelect male TNC connector for current port
CMKSelect male K connector for current port
CMNSelect male N connector for current port
CMN75Select Male type N 75-Ohm connector for current port
CMSSelect male SMA connector for current port
CMSPSelect Special Male connector for current port
CMSPASelect Band A special male connector for current port
CMSPBSelect Band B special male connector for current port
CMSPCSelect Band C special male connector for current port
CMVSelect male V connector for current port
CMX?Output calibration method
CNDSelect user specified connector for current port
CNGSelect GPC-7 connector for current port
COFTurn error correction off
CONTurn error correction on
CON?Output error correction on/off status
COOEnter offset for open for user specified connector (Standard Calibration)
COSEnter offset for short for user specified connector
CRBSelect reflection only calibration both ports
CRFSelect reflection only calibration port 1
CRRSelect reflection only calibration port 2
CRTSelect trans freq response calibration reverse path
CSF?Output cal start frequency
CTF?Output cal stop frequency
CWCSelect CW frequency calibration data points
CXX?Output calibration type
DFCSelect discrete frequency calibration data points
DFDDone specifying discrete frequency ranges
DFQEnter single discrete frequency
IC2Input Calibration Coefficient 2
IC3Enter calibration coefficient 3
IC4Enter calibration coefficient 4
IC5Enter calibration coefficient 5
IC6Enter calibration coefficient 6
IC7Enter calibration coefficient 7
IC8Enter calibration coefficient 8
IC9Enter calibration coefficient 9
ICAEnter calibration coefficient 10
ICBEnter calibration coefficient 11
ICCEnter calibration coefficient 12
ICDEnter corrected data for active channel parameter
ICFEnter front panel setup and calibration data
ICLEnter all applicable calibration coefficients for cal type
IFDEnter final data for active channel parameter
ISFExclude isolation
ISNInclude isolation
KECKeep existing calibration data
LCMSelect LRL calibration method
LL1Enter length of line 1 for LRL calibration
LL2Enter length of line 2 for LRL calibration
LL3Enter length of line 3 for LRL calibration
5-1237XXXC PM
CALIBRATION FUNCTIONSCALIBRATION COMMANDS
Table 5-5. Calibration Commands (3 of 4)
CommandDescription
LLZEnter line impedance for LRL calibration
LM2Select a match for the second device during a LRM type calibration
LM3Select a match for the third device during a LRM type calibration
LMZEnter match impedance for LRM calibration
LMZ?Output match impedance for LRM calibration
LMZLEnter match inductance for LRM calibration
LMZL?Output match inductance for LRM calibration
LR2Specify 2 line LRL calibration
LR3Specify 3 line LRL calibration
LTCSelect coaxial transmission line for calibration
LTUSelect microstrip transmission line for calibration
LTWSelect waveguide transmission line for calibration
LTX?Output line type
MATSelect matched reflective devices during cal
MIXSelect mixed reflective devices during calibration
NCSGo to next calibration step
NOCSelect normal calibration data points
O3CMSelect Triple Offset Short calibration method
OCMSelect offset short calibration method
ONCTOutput number of cal terms for current calibration
P1CSelect port 1 for connector specification
P1C?Outputport 1 connector type
P1P?Output approximate power level at port 1
P2CSelect port 2 for connector specification
P2C?Outputport 2 connector type
PSPEnter number of power sweeps for flat power correction (obsolete)
PSP?Output number of power sweeps for flat power correction (obsolete)
PTSEnter number of points to be skipped during flat power correction
PTS?Outputnumber of points to be skipped during flat power correction
RGZSelect reflective device greater than Z0
RLZSelect reflective device less than Z0
RM1Select reference plane at line 1 midpoint
ROLEnter reflective device offset length
RPCRepeat previous calibration
RRPSelect reference plane at reflection plane
SBDEnter substrate dielectric for microstrip calibration
SBTEnter substrate thickness for microstrip calibration
SCMSelect standard calibration method
SFCPerform flat test port calibration
SH1Set offset short 1 or 2 offset length for offset short calibration
SH2Set offset short 1 or 2 offset length for offset short calibration
SLDSelect sliding load for calibration
TC1Take calibration data for port 1
TC2Take calibration data for port 2
TCDTake calibration data on one or both ports as necessary
TCMSelect the TRM calibration method
TDCSelect time domain harmonic frequency calibration data points
TLZEnter through line impedance for calibration
TOLEnter through offset length for calibration
U10Select 10 mil UTF calibration kit
37XXXC PM5-13
CALIBRATION COMMANDSCALIBRATION FUNCTIONS
Table 5-5. Calibration Commands (4 of 4)
CommandDescription
U15Select 15 mil UTF calibration kit
U25Select 25 mil UTF calibration kit
USEEnter effective dielectric for microstrip calibration
USWEnter microstrip width for microstrip calibration
USZEnter microstrip impedance for microstrip calibration
WCOEnter waveguide cutoff frequency for user defined kit
WKDSelect user defined waveguide calibration kit
WKISelect installed waveguide calibration kit
WSH1Enter waveguide short offset 1 for user defined kit
WSH2Enter waveguide short offset 2 for user defined kit
WSH3Enter waveguide short 3 offset for user defined kit
5-1437XXXC PM
CALIBRATION FUNCTIONSAUTOCAL FUNCTIONS
5-8AUTOCAL FUNCTIONSThis function requires an optional AutoCal â module that provides an
automated method for performing fast, repeatable high-quality cali
brations. The AutoCal module is inserted between the VNA test ports
to perform the calibration. The commands for implementing this func
tion remotely are provided in Table 5-6.
Table 5-6. List of AutoCal Commands (1 of 2)
CommandDescription
ABORTCALAbort calibration in progress and keep existing calibration data
ACAASet AutoCal standard to assurance
ACADPLEnter AutoCal adapter length
ACADPL?Output AutoCal adapter length
ACADRSet AutoCal type to adapter removal
ACAL1R2Set adapter removal port configuration to ADAPT & L=1 and R=2
ACAR1L2Set adapter removal port configuration to ADAPT & R=1 and L=2
ACARP?Output AutoCal adapter removal port configuration
ACDEFSelect default AutoCal isolation averaging factor
ACF2P?OutputAutoCal full 2 port configuration
ACF2TCSet AutoCal 2 port thru type to calibrator
ACF2TTSet AutoCal 2 port thru type to true thru
ACF2TX?Output AutoCal 2 port thru type selection
ACHFDSave AutoCal characterization data to floppy disk
ACHHDSave AutoCal characterization data to hard disk
ACIAFEnter user AutoCal isolation averaging factor
ACIAF?Output user AutoCal isolation averaging factor
ACIAX?Output AutoCal isolation averaging factor omit/default/user selection
ACISOEnter AutoCal isolation averaging number
ACISO?Output AutoCal isolation averaging number
ACL1AR2Set adapter removal port configuration to L=1 and ADAPT & R=2
ACL1R2SetAutoCal full 2 port configuration to L=1 and R=2
ACLOEnter AutoCal load averaging number
ACLO?Output AutoCal load averaging number
ACLOADSet AutoCal standard to load
ACOMITOmit using AutoCal isolation averaging factor
ACOPENSet AutoCal standard to open
ACP1?Output AutoCal S11 port configuration
ACP1LSet AutoCal S11 port configuration to left
ACP1RSet AutoCal S11 port configuration to right
ACP2?Output AutoCal S22 port configuration
ACP2LSet AutoCal S22 port configuration to left
ACP2RSet AutoCal S22 port configuration to right
ACPLSet AutoCal S11 port configuration to left
ACPRSet AutoCal S11 port configuration to right
ACR1AL2Set adapter removal port configuration to R=1 and ADAPT & L=2
ACR1L2SetAutoCal full 2 port configuration to R=1 and L=2
ACRFLEnter AutoCal reflection averaging number
ACRFL?Output AutoCal reflection averaging number
ACS11Set AutoCal type to S11
ACS22Set AutoCal type to S22
ACSF2PSet AutoCal type to full 2 port
-
-
5-1537XXXC PM
AUTOCAL FUNCTIONSCALIBRATION FUNCTIONS
Table 5-6. List of AutoCal Commands (2 of 2)
CommandDescription
ACSHORTSet AutoCal standard to short
ACSTD?Output AutoCal standard
ACSWEnter AutoCal switch averaging number
ACSW?Output AutoCal switch averaging number
ACTHRUSet AutoCal standard to thru
ACTUEnter AutoCal thru averaging number
ACTU?Output AutoCal thru averaging number
ACTUAVGEnter AutoCal thru update averaging number
ACTUAVG?Output AutoCal thru update averaging number
ACTULSApply last thru update cal setup
ACX?Output AutoCal type
BEGACStart AutoCal
BEGCHStart AutoCal characterization
BEGTUStart AutoCal thru update
IACCHARInput AutoCal characterization data from the GPIB
OACCHAROutput AutoCal characterization data to the GPIB
TACDTake AutoCal data
37XXXC PM5-16
Chapter 6
Markers and Limits
Functions
Table of Contents
6-1INTRODUCTION .........................6-3
6-2MARKERS .............................6-3
6-3LIMITS...............................6-7
Single (Non-Segmented) Limits..................6-7
Segmented Limits .........................6-8
Limits Example ..........................6-8
Limits Pass/FailTesting ......................6-8
Chapter 6
Markers and Limits
Functions
6-1INTRODUCTIONThis chapter describes markers and limits commands.
6-2MARKERSThe commands listed in Table 6-1 (next page) control the location and
display of the markers and the functions related to the markers.A full
description of each command mnemonic is contained in Chapter 11,
Command Dictionary.
A marker is turned on whenever any of the following conditions occur:
q When the marker is set to a value
Example: "MK2 20 GHZ"
q When the marker is selected for readout
Example: "MR2"
q When the marker is selected as the delta reference marker (left)
Example: "DR2 4.5632 GHZ"
MMN and MMX Commands — The MMN and MMX commands move
the active marker to the minimum and maximum trace values on the
active channel, respectively. There must be an active marker selected
for these command to execute.
Example: "WFS;MR1;MMX"
This code instructs the 37XXX to:
q
Wait for a full sweep of data to be present (WFS)
q
Turn on marker 1 and select it for readout (MR1)
q
Move marker 1 to the maximum value of the trace on the active
channel (MMX)
37XXXC PM6-3
MARKERSMARKERS/LIMITS FUNCTIONS
Table 6-1. Marker Commands (1 of 3)
CommandDescription
AMKRSelect active marker on all channels marker mode
BWL3Set bandwidth loss value to 3 dB
BWLSEnter bandwidth loss value
BWLS?Output bandwidth loss value
DR1Select Marker 1 as Delta Reference Marker
DR2Select Marker 2 as Delta Reference Marker
DR3Select Marker 3 as Delta Reference Marker
DR4Select Marker 4 as Delta Reference Marker
DR5Select Marker 5 as Delta Reference Marker
DR6Select Marker 6 as Delta Reference Marker
DRFTurn delta reference mode on
DROTurn delta reference mode off
DRO?Output delta reference mode on/off status
DRX?Output delta reference marker number
DSF0Disable filter shape factor calculation
DSF1Enable filter shape factor calculation
DSFX?Output filter shape factor calculation enable/disable status
DSQ0Disable filter Q calculation
DSQ1Enable filter Q calculation
DSQX?Output filter Q calculation enable/disable status
FLTBW?Output filter bandwidth
FLTC?Output filter center frequency
FLTL?Output filter loss at reference value
FLTQ?Output filter Q
FLTS?Output filter shape factor
FMKRSelect filter parameters marker mode
M1CSet CW mode at marker 1 frequency
M1ESet sweep/zoom end to marker 1 frequency distance or time
M1SSet sweep/zoom start to marker 1 frequency distance or time
M2CSet CW mode at marker 2 frequency
M2ESet sweep/zoom end to marker 2 frequency distance or time
M2SSet sweep/zoom start to marker 2 frequency distance or time
M3CSet CW mode at marker 3 frequency
M3ESet sweep/zoom end to marker 3 frequency distance or time
M3SSet sweep/zoom start to marker 3 frequency distance or time
M4CSet CW mode at marker 4 frequency
M4ESet sweep/zoom end to marker 4 frequency distance or time
M4SSet sweep/zoom start to marker 4 frequency distance or time
M5CSet CW mode at marker 5 frequency
M5ESet sweep/zoom end to marker 5 frequency distance or time
M5SSet sweep/zoom start to marker 5 frequency distance or time
M6CSet CW mode at marker 6 frequency
M6ESet sweep/zoom end to marker 6 frequency distance or time
M6SSet sweep/zoom start to marker 6 frequency distance or time
MK1Enter marker 1 frequency distance or time and turn on
MK1?Output marker 1 frequency distance or time
MK2Enter marker 2 frequency distance or time and turn on
MK2?Output marker 2 frequency distance or time
MK3Enter marker 3 frequency distance or time and turn on
6-437XXXC PM
MARKERS AND LIMITSMARKERS
FUNCTIONSCOMMANDS
Table 6-1. Marker Commands (2 of 3)
CommandDescription
MK3?Output marker 3 frequency distance or time
MK4Enter marker 4 frequency distance or time and turn on
MK4?Output marker 4 frequency distance or time
MK5Enter marker 5 frequency distance or time and turn on
MK5?Output marker 5 frequency distance or time
MK6Enter marker 6 frequency distance or time and turn on
MK6?Output marker 6 frequency distance or time
MKRCSelect interpolated marker functionality
MKRDSelect discrete marker functionality
MKRX?Output interpolated/discrete marker functionality
MKSLMarker search left
MKSRMarker search right
MKT0Turn marker tracking off
MKT1Turn marker tracking on
MKTX?Output marker tracking on/off status
MMNMove active marker to minimum trace value
MMXMove active marker to maximum trace value
MO1Turn off marker 1
MO2Turn off marker 2
MO3Turn off marker 3
MO4Turn off marker 4
MO5Turn off marker 5
MO6Turn off marker 6
MOFTurn marker display off
MONTurn marker display on
MON?Output marker display on/off status
MR1Turn marker 1 on and make it the active marker
MR1?Output marker 1 on/off status
MR2Turn marker 2 on and make it the active marker
MR2?Output marker 2 on/off status
MR3Turn marker 3 on and make it the active marker
MR3?Output marker 3 on/off status
MR4Turn marker 4 on and make it the active marker
MR4?Output marker 4 on/off status
MR5Turn marker 5 on and make it the active marker
MR5?Output marker 5 on/off status
MR6Turn marker 6 on and make it the active marker
MR6?Output marker 6 on/off status
MRMDisplay the Marker Readout menu
MRX?Output active marker number
MSFHEnter high loss value for shape factor calculation
MSFH?Output high loss value for shape factor calculation
MSFLEnter low loss value for shape factor calculation
MSFL?Output low loss value for shape factor calculation
MSR0Select 0 as reference for marker search and bandwidth calculation
MSRDSelect delta reference marker as reference for marker search and bandwidth calculation
MSRMSelect maximum as reference for marker search and bandwidth calculation
MSRX?Output reference selection for marker search and bandwidth calculation
NMKRSelect normal markers on active channel marker mode
SMKRSelect marker search marker mode
37XXX PM6-5
MARKERSMARKERS AND LIMITS
COMMANDSFUNCTIONS
Table 6-1. Marker Commands (3 of 3)
CommandDescription
SRCHEnter marker search value
SRCH?Output marker search value
XMKR?Output marker mode
6-637XXX PM
MARKERS/LIMITS FUNCTIONSSLIMITS
6-3LIMITSThe Limits commands perform the functions that are available via the
Display key and Limits menus. Figure 6-1 shows the relationship be
tween the major limits commands and the single and segmented limits
displays.The various limit-types are described below and the limits
commands are listed in Table 6-2 (page 6-9).
LUP , UPL0
UPL1
Single Upper Limits
LLO, LL0
LL1
Single Lower Limits
-
Single (Non-
Segmented) Limits
THIS IS NORMALLY
AUTO SELECTED
OR
LSEG, LSNG
Segmented
Upper Limits
Segmented
Lower Limits
Figure 6-1. Relationship Between Limits Commands and Limits Displays
SLU0, SLU1
SLL0, SLL1
LON, LOF
The Non-Segmented Limits Commands do the following:
q
Set up the upper and lower limit values for the active channel.
q
Set the limit delta for the limit frequency readout function. The
range of values and allowable terminator mnemonics are depend
ent on the graph type of the active channel, much like the SCL
and REF commands.
-
The LFR, LFP, and LFD commands that define limit frequency
readouts, are only available on the following graph types: log magni
-
tude (MAG), log magnitude and phase (MPH), phase (PHA), linear
37XXXC PM6-7
LIMITSMARKERS/LIMITS FUNCTIONS
magnitude (LIN), linear magnitude and phase (LPH), standing wave
ratio (SWR), and group delay (DLA). The active channel must be a fre
quency domain channel. The LFP command can be used to select
phase limit frequency readouts on log magnitude and phase and linear
magnitude and phase graph types.
-
To change values for the LFD,LLO,and LUP commands for the bot
tom graph of two graph display, use the appropriate suffix mnemonic
as shown below:
Graph TypeAppropriate Suffix Mnemonic
Log Mag / PhaseDEG / RAD
Lin Mag / PhaseDEG / RAD
Real / ImagIMU
Segmented LimitsSegmented limits (Table 6-4) allow different upper and lower limit val-
ues to be set at up to ten segments across the measurement range.
Limits ExampleThis example makes limit 2 the active segment, sets its vertical start
to 10 dB,its horizontal start to 10 GHz, its vertical stop to 12 dB, its
horizontal stop to 16 GHz, and sets it to display on the 37XXX screen.
Limits Pass/FailTestingLimits pass/fail testing commands are listed in Table 6-5. These com-
mands are used to produce a beep and/or a TTL voltage at the rear
panel External I/O connector when a measurement exceeds any of the
set limits (refer to the 37XXX Operation Manual).
-
NOTE
Pass/fail testing, when turned on, will generate an SRQ (if
enabled) whenever a test failure occurs. Refer to
Chapter 7, "Status Reporting" for details.
6-837XXXC PM
MARKERS/LIMITS FUNCTIONSSLIMITS
Table 6-2. Limit Commands (1 of 2)
CommandDescription
ATTNAttach next segment and make the active segment
BEGNBegin next segment and make it the active segment
CASClear active segmented limit vertical/horizontal definitions
DISDisplay active segmented limit
DIS?Output active segmented limit on/off status
HIDHide active segmented limit
LB0Turn limits testing beep on failure off
LB1Turn limits testing beep on failure on
LBX?Output limits testing beeper enable status
LFDEnter limit frequency readout delta value
LFD2Enter limit frequency readout delta value for bottom graph
LFD2?Output limit frequency readout delta value for bottom graph
LFD?Output limit frequency readout delta value
LFPSelect limit frequency readout for phase displays
LFRSelect limit frequency readout for active channel
LLM?Outputlimit line display mode single or segmented
LLOEnter lower limit value for top graph on active channel
LLO2Enter lower limit value for bottom graph on active channel
LLO2?Output lower limit value for bottom graph on active channel
LLO?Output lower limit value for top graph on active channel
LOFLimits display off
LOL0Turn lower limit off
LOL1Turn lower limit on at current value
LOL20Turn lower limit off for bottom graph
LOL21Turn lower limit on at current value for bottom graph
LOL2X?Output lower limit on/off status for bottom graph
LOLX?Output lower limit on/off status
LONLimits display on
LON?Output limits display on/off status
LPF1?Output limit test failure status on channel 1
LPF2?Output limit test failure status on channel 2
LPF3?Output limit test failure status on channel 3
LPF4?Output limit test failure status on channel 4
LPF?Output limit test failure status all channels
LS1Set lower segmented limit 100 as the active segment
LS10Select lower segmented limit 10 as the active segment
LS2Select lower segmented limit 2 as the active segment
LS3Select lower segmented limit 3 as the active segment
LS4Select lower segmented limit 4 as the active segment
LS5Select lower segmented limit 5 as the active segment
LS6Select lower segmented limit 6 as the active segment
LS7Select lower segmented limit 7 as the active segment
LS8Select lower segmented limit 8 as the active segment
LS9Select lower segmented limit 9 as the active segment
LSEGSelect segmented limit line display mode
LSNGSelect single limit line display mode
LSX?Output active segmented limit
LT0Turn limits testing off
LT1Turn limits testing on
LT1?Output limits testing enable status
37XXXC PM6-9
LIMITSMARKERS/LIMITS FUNCTIONS
Table 6-3. Limit Commands (2 of 2)
CommandDescription
LTSTDisplay the limits testing menu
LUPEnter upper limit value for top graph on active channel
LUP2Enterupper limit value for bottom graph on active channel
LUP2?Output upper limit value for bottom graph on active channel
LUP?Outputupper limit value for top graph on active channel
LVHSelect high as limits testing TTL level
LVLSelect low as limits testing TTL level
LVX?Output limits testing ttl level status
SLCClear all segmented limits definitions
SLHEnter segmented limits horizontal offset
SLH?Outputsegmented limits horizontal offset
SLL0Turn lower segmented limits display off
SLL1Turn lower segmented limits display on
SLLX?Output lower segmented limits display on/off status
SLU0Turn upper segmented limits display off
SLU1Turn upper segmented limits display on
SLVEnter segmented limits vertical offset
SLV?Output segmented limits vertical offset
SPHEnter active segmented limit horizontal stop position
SPH?Output active segmented limit horizontal stop position
SPVEnter active segmented limit vertical stop position
SPV?Output active segmented limit vertical stop position
STHEnter active segmented limit horizontal start position
STH?Output active segmented limit horizontal start position
STVEnter active segmented limit vertical start position
STV?Outputactive segmented limit vertical start position
UPL0Turn upper limit off
UPL1Turn upper limit on at current value
UPL20Turn upper limit off for bottom graph
UPL21Turn upper limit on at current value for bottom graph
UPL2X?Output upper limit on/off status for bottom graph
UPLX?Output upper limit on/off status
US1Select upper segmented limit 1 as the active segment
US10Selectupper segmented limit 10 as the active segment
US2Select upper segmented limit 2 as the active segment
US3Select upper segmented limit 3 as the active segment
US4Select upper segmented limit 4 as the active segment
US5Select upper segmented limit 5 as the active segment
US6Select upper segmented limit 6 as the active segment
US7Select upper segmented limit 7 as the active segment
US8Select upper segmented limit 8 as the active segment
US9Select upper segmented limit 9 as the active segment
6-1037XXXC PM
Chapter 7
Remote-Only
Functions
Table of Contents
7-1INTRODUCTION .........................7-3
7-2DATA TRANSFER PROTOCOL .................7-3
GPIB Messages ..........................7-3
Separation and Termination Methods ..............7-3
Separation and Termination Example ..............7-4
7-3DATA TRANSMISSION METHODS ...............7-6
7-4ASCII OR BINARY DATA FORMAT ..............7-10
Non-Array Data..........................7-10
Numerical Data Arrays .....................7-10
Enhanced ASCII Formatting...................7-11
7-5DATA TRANSFER COMMANDS ................7-11
A Note On Query Commands ..................7-11
Error And Status Reporting Commands ............7-12
7-6MEASUREMENT POINTS DATA................7-15
Sweep Measurement Points Data Transfer Example......7-16
7-7FAST CW OPERATION .....................7-16
Fast CW Mode 1 .........................7-17
Fast CW Mode 2 .........................7-17
7-8INTERNAL BUFFER ......................7-18
7-9TRIGGERS ............................7-19
7-10CALIBRATION COEFFICIENTS ................7-20
Calibration Coefficients Data Transfer Example ........7-21
7-11MEASUREMENT DATA TRANSFER .............7-22
Measurement Data Transfer Example .............7-25
Status Reporting Commands Example .............7-37
7-16STATUS EVENT DESCRIPTIONS ...............7-38
Standard Event Status Register .................7-38
Extended Event Status Register.................7-39
Limits Event Status Register ..................7-40
Status Byte Register .......................7-41
7-17IEEE 488.2 COMMON COMMANDS ..............7-42
7-18SYNCHRONIZATION COMMANDS ..............7-43
7-19MISCELLANEOUS COMMANDS................7-44
Chapter 7
Remote-Only
Functions
7-1INTRODUCTIONThis chapter describes 37XXXC GPIB functions that support opera
tions typically required when in remote mode:
Data transfers (paragraphs 7-2 through 7-11)
q
Error reporting,including the Service Log (paragraphs 7-12
q
through 7-14)
Status reporting (paragraphs 7-15, 7-16)
q
IEEE 488.2 Common commands (paragraph 7-17)
q
Synchronization commands (paragraph 7-18)
q
7-2DATATRANSFER
PROTOCOL
GPIB MessagesA GPIB message is any information sent over GPIB to a device. This
There are several basic ideas associated with transferring data between your controller and the 37XXXC. This paragraph introduces
data transfer terminology, message terminator and separator characters, and data transfer methods (protocols) used by the 37XXXC.
includes instrument commands or data that you send to or receive
from the 37XXXC.
Program Message (PM)
This is the message string that your controller sends to the 37XXXC.
The message can contain commands, queries (or other requests for
data transfer), and data strings.
-
Response Message
This is the data your controller receives from the 37XXXC.
The data can contain ASCII or binary represented numerical values,
-
Separation and
Termination Methods
character strings or other arbitrary ASCII data, and 37XXXC inter
nally represented binary strings.
Termination and separation protocols of messages transmitted over
the GPIB are specified by the IEEE 488.2 GPIB Standard. The
37XXXC conforms to those specifications as described below.
Message Elements Separator
A program or response message can consist of one or more elements,
called units.Units are separated with the semi-colon (;) character.
37XXXC PM7-3
DATA TRANSFER PROTOCOLREMOTE ONLY FUNCTIONS
Units in a program message are complete valid 37XXXC commands or
queries. For example, "CH1;PHA;SRT 2 GHZ;SRT?" consist of four
commands or queries that make channel 1 active, set it to phase dis
play, sets start frequency to 2 GHz, then outputs the start frequency.
-
A single unit in a response message is the complete data output in re
sponse to a single command. For example, the command sequence
"ONP;CHX?" - Output Number of Points and Output Currently Ac
tive Channel, will output a response message that contains two units
separated by a semi-colon (;). The first unit of data is the response to
the ONP command. The second unit of data is the response to the
CHX? query.
Message Unit Data Separator
The comma (,) character separates multiple ASCII data elements of a
single command or response message unit. For example, the command
OM1 - Output Marker 1 Value,will output a complex data value (two
values, that is, dB and degrees) representing the measurement data
at the marker. The two values in the complex data will be separated
with a comma.
Message Terminator
A complete program or response message is terminated by sending the
linefeed character (0A, or decimal 10) at the same time (concurrent
with) setting the EOI state on the GPIB. The notation <0A^END> will
be used throughout this Programming Manual to reference the message terminator. Simply put, the message terminator signals the end
of transmission.
NOTE
EOI is the GPIB End of Transmission state that is set by
the controller, or an instrument, when it is done "talking,"
i.e., done sending a message on the GPIB and therefore re
leasing the GPIB for use by another device.
-
-
-
Separation and
Termination Example
The following example shows how a program message with multiple
units is sent to the 37XXXC. Also shown is the response message the
37XXXC will send back to the controller.
PROGRAM MESSAGE (to 37XXXC):
"CH2;LPH;MK6 2.5 GHZ;OM6;OFV"
This program message makes channel 2 active (CH2), sets it to linear
magnitude and phase display (LPH), activates and sets marker 6 to
2.5 GHz (MK6 2.5 GHZ), outputs its value (OM6), then outputs the
list of current sweep frequencies (OFV).
Response message elements:
<marker 6 dB value>,<marker 6 degrees value>;<frequency list
header> <frequency 1>,<frequency 2>,...,<frequency 101><0A^EOI>
7-437XXXC PM
REMOTE ONLY FUNCTIONSDATA TRANSFER PROTOCOL
NOTE
The (< >) characters in the message elements list are not
actually transmitted in the response message; they are
shown here in the text to distinguish the various data
fields from each other.
OM6 outputs 2 ASCII data items (dB,degrees). They are sent
separated with a comma (,).
The output of OM6 and OFV is separated with a semicolon (;).
This was done because the external controller requested two out
puts before reading the first one from the 37XXXC.
Note that certain data transfer commands require that
you read their output before another data output command is sent [see <Arbitrary ASCII> format and <Arbitrary Block> format (Example 3), in paragraph 7-3].
0A
NOTE
-
The OFV command outputs data using the <Arbitrary Block>
format (see description in paragraph 7-3). The frequency values
are preceded by a <frequency list header> (#41817). This is an
ASCII text string that is encoded with the number of bytes to follow. This data transmission method, used by the OFV and other
37XXXC block data transfer commands, allows you to prepare an
appropriate size memory block to receive the data in your appli
cation.
The first frequency value (4.00000000000E+7) is then transmit
ted immediately after the header followed by a comma. This con
tinues until all 101 frequency values are transmitted.
NOTE
The commas are used because the values are in ASCII
format. If binary format was selected (see FMA, FMB,
FMC format commands,paragraph 7-4), the frequency
values would have been sent without commas.
The linefeed character (0A) signals the end of transmission at the
end of the response message. The end of transmission (EOI) is
set by the 37XXXC at the same time the linefeed is sent and thus
the GPIB is released for use by another device.
-
-
-
37XXXC PM7-5
DATA TRANSMISSION METHODSREMOTE ONLY FUNCTIONS
7-3DATATRANSMISSION
METHODS
Data transmissions to and from the 37XXXC conform to the protocols
specified by the IEEE 488.2 GPIB Standard. The 488.2 Standard
specifies how any data, such as ASCII numbers,strings, or blocks of
data bytes,will be transmitted over the GPIB. This paragraph de
scribes the various transmission methods in use by the 37XXXC.
The transmission method names described below (also called nota
tions) will be used throughout the Programming Manual when de
scribing specific 37XXXC data transfer commands.
Data transmission notations are easily distinguished in text as they
are always shown surrounded by the “less than” and the “greater
than” characters (< >). The transmission type notations used in de
scribing various 37XXXC data transmissions are:
For ASCII numbers, the notations are:
<NR1>, <NR2>, <NR3>, or <NRf>
For ASCII strings (printable characters and print formatting
codes), the notation is:
<ASCII String>
For generic (7-bit) ASCII characters, the notation is:
<ASCII Block>.
-
-
-
-
For generic binary bytes, (i.e. 7-bit ASCII or binary), the notation
is:
<Arbitrary Block>
<NR1>
This notation represents ASCII integer values. A comma (,) is used to
separate multiple values sent in a single command's input or output
string.
Examples of values that can be represented by <NR1> notation:
1
0
-29,179
<NR2>
This notation represents ASCII floating point values in decimal point
format. A comma (,) is used to separate multiple values sent in a single
command's input or output string.
Examples of values that can be represented by <NR2> notation:
1.0
-0.00015
12.743,-180.07
7-637XXXC PM
REMOTE ONLY FUNCTIONSDATA TRANSMISSION METHODS
<NR3>
This notation represents ASCII floating point values in exponential
format (scientific notation). A comma (,) is used to separate multiple
values sent in a single command's input or output string.
Examples of values that can be represented by <NR3> notation:
1.0E9
-7.056E3
9.0E-2,3.42E2
<NRf>
This notation is used to signify that data can be in either <NR1>,
<NR2>, or <NR3> format as described above.
Examples of values that can be represented by <NRf> notation:
1.0E-9
10.005
-83,4.5E2,-234.9901
<String>
This notation represents a string of ASCII characters (including nonprintable characters) that is delimited (surrounded) with either single
quotes (' ') or double quotes (""). The string can include text formatting characters such as linefeed, space, carriage return, or printer control characters.
Note that if a double quote character must be sent as part of the
string, then it must be followed by an additional double quote. Alternatively, the string can be sent using single quotes (See "cal_file" exam
ple below).
Examples of data represented by <String> notation:
This notation represents undelimited 7-bit ASCII text. The end of the
text must be terminated with the 0A character (decimal 10) and con
current setting (^) of the GPIB End of Transmission State (EOI). This
requirement makes it necessary for <Arbitrary ASCII> text to be
transmitted only at the end of a program or response message, i.e., at
the end of a multiple input or output statement.
Example of data represented by <Arbitrary ASCII> notation:
ANRITSU,37247C,123456,1.0<0A^EOI>
The example shows a sample response from the *IDN?, 488.2 common
query. In the example,the instrument identifies itself as an ANRITSU
-
-
37XXXC PM7-7
DATA TRANSMISSION METHODSREMOTE ONLY FUNCTIONS
37247C,with serial number 123456, and software version 1.0 in
-
stalled.
Note that decimal 10 (0A character) must be sent with the EOI to sig
nal end of transmission
<Arbitrary Block>
This notation represents data that is transmitted as 8-bit data bytes
(00–FF hex, 0–255 decimal, notation is <DAB>). This is useful for
transmitting large blocks of formatted ASCII or binary data or unfor
matted binary data. The data stream is immediately preceded by a
variable length ASCII header that is encoded with the number of data
bytes to be sent. The header always starts with the pound (#) charac
ter. Figure 7-1 below describes the header and the transmitted data
messages.
#nm
1
..m
n<DAB>1
..<DAB>
m
Where:
# = The pound sign character.Required for binary data transfer.
n = Number of digits to follow (m
..mn)that make up the
1
number m.
m
..mn= Taken together, this makes up the number m which is
1
the number of data bytes to follow that constitute the requested
data.
<DAB> = An 8 bit binary data byte. This is the data (or information) being sent.
-
-
NOTE
If n = 0, then m is omitted, and transmission end is sig
-
naled by sending the linefeed character (0A, or decimal
10) and concurrent setting (^) of the GPIB End Of
Transmission State (EOI) immediately following the last
<DAB>.
Figure 7-1. <Arbitrary Block> Data Format
EXAMPLE 1 : #3204<DAB
>...<DAB
1
204
>
Example 1 shows how 204 7-bit bytes are transmitted using the proper
header. The header in this example is comprised of 5 characters
(#3204). It begins with with the pound character (#). The next charac
ter (3) indicates there are 3 digits to follow that indicate the number of
bytes being transmitted (204). The next three characters (204) indicate
the number of data bytes being transmitted immediately after the
header. Next comes the actual data bytes, or information, being trans
mitted (<DAB
>...<DAB
1
204
>).
-
-
7-837XXXC PM
REMOTE ONLY FUNCTIONSDATA TRANSMISSION METHODS
EXAMPLE 2: #512808<DAB1>...<DAB
12808
>
Example 2 shows how 12808 bytes are transmitted using the proper
header. The header in this example is comprised of 7 characters
(#512808). It begins with with the pound character (#). The next char
acter (5) indicates there are 5 digits to follow that indicate the number
of bytes being transmitted (12808). The next five characters (12808)
indicate the number of data bytes being transmitted immediately after
the header. Next comes the actual data bytes, or information, being
transmitted (<DAB
>...<DAB
1
12808
>).
NOTE
Examples 1 and 2 above demonstrate the <Arbitrary
Block> form referred to as <Definite Length Arbitrary
Block>. It is so called because the number of data bytes be
-
ing transmitted is known from the encoded header.
EXAMPLE 3: #0<DAB
>...<DABn><0A^EOI>
1
Example 3 shows how an unknown number of bytes are transmitted
using the proper header.The header in this example is comprised of 2
characters (#0). As usual, the header begins with the pound character
(#). The next character (0) indicates there is an unknown number of
data bytes being transmitted immediately after the header. Next
comes the actual data bytes being transmitted (<DAB
>...<DABn>).
1
The end of the data stream is signaled by sending the linefeed character (0A, or decimal 10) and concurrent setting (^) of the GPIB End of
Transmission State (EOI).
-
NOTES
·
Example 3, above, demonstrates a special form of the
<Arbitrary Block> referred to as the <Indefinite Length
Arbitrary Block>. It is so called because the number of
data bytes being transmitted is unknown, and therefore
can not be encoded in the header.Instead, the header always consists of the pound and zero characters (#0) and
end of the data stream is always signaled by sending
the linefeed character (0A, or decimal 10) and concur
rent setting (^) of the GPIB End of Transmission State
(EOI). This requirement makes it necessary for <Indefinite Length Arbitrary Block> text to be transmitted
only at the end of a program or response message, i.e.,
at the end of a multiple input or output statement.
·
When using this method to input data you must not ex
ceed the 37XXXC input buffer size (refer to Chapter 1,
Table 1-2.)
Three commands are provided to alter the way the arbitrary block
header for output data is formed.
-
-
-
37XXXC PM7-9
ASCII OR BINARY DATA FORMATREMOTE ONLY FUNCTIONS
FDH0: Specifies that the length of the arbitrary block header will be
minimized; that is, the byte count section will not contain leading ze
ros, thus its length is indeterminate. This means that a program must
decode the header in order to skip over it.
FDH1: Specifies that the length of the arbitrary block header will be
fixed at 11 characters. This is accomplished by forcing leading zeros as
required in the byte count section. This means that a program can skip
over the arbitrary block header by skipping 11 characters.
FDH2: Specifies that no arbitrary block header will be sent with the
next transmission. This mode is not in compliance with IEEE 488.2
specifications and will only be in effect for the current program mes
sage. Afterwards, it will change to FDH1.
FDHX?: FDH mode query.
-
-
7-4ASCII OR BINARY DATA
FORMAT
Non-Array DataThe formats used for data transfers not involving numerical data ar-
Numerical Data
Arrays
The following paragraphs discuss the various data output formats.
Data transfers involving numerical data arrays.
q
Data transfers not involving numerical data arrays.
q
Enhanced ASCII formatting.
q
rays are preset. They always occur in either binary format or ASCII
format, depending on the data.
These data transfers include a variety of information. Examples include: instrument setup strings, marker data, queries, and disk directory listings.See the desired data transfer command description for its
applicable data transfer format.
Numerical data array transfers are used to transfer the following
types of data:
q
Measurement data
q
Calibration data
q
Sweep frequency, time,or distance values.
Each of these data transfer types are individually explained in follow
ing paragraphs.
-
You can select either binary or ASCII format for data transfers involv
ing numerical data arrays. The five commands described below will se
lect and keep the format for all subsequent transfers (these commands
are also listed and described in Table 7-1).
or <NRf> formats as described in paragraph 7-3. The 37XXXC will ac
cept any of the above formats as input. It will always output values us
-
7-1037XXXC PM
-
-
-
REMOTE ONLY FUNCTIONSDATA TRANSFER COMMANDS
ing <NR3> exponential format with each value represented using 18
characters, plus a comma to separate multiple values.
Binary Format:
FMB: Each eight consecutive data bytes represent one floating point
value in IEEE 754 64-bit format (double precision, 8 byte,floating
point value).
FMC: Each four consecutive data bytes represent one floating point
value in IEEE 754 32-bit format (single precision, 4 byte,floating point
value).
FMX?: FMA, FMB, FMC format selection query.
MSB: Byte ordering is most significant byte first. For use only with
FMB and FMC.This the default byte ordering mode for the 37XXXC.
LSB: Byte ordering is least significant byte first. For use with FMB
and FMC.This is required for transferring data to/from Intel/IBM
based computers.
Enhanced ASCII
Formatting
7-5DATATRANSFER
COMMANDS
A Note On Query
Commands
XSB?: MSB, LSB format selection query.
FMT0: Turn ASCII enhancement off (normal default mode).
FMT1: Turn ASCII enhancement on.
FMTX?: ASCII enhancement ON/OFF status query.
Enhanced ASCII formatting can be applied to both non-array ASCII
data and numerical data arrays in the FMA format when this data is
output within an <arbitrary block> format. The format selectively re
places comma data element separators with a line feeds (ASCII 10) in
order to enhance the visual effect. Figure 7-2 provides two examples of
this enhanced structure.
Table 7-1 is an alphabetical listing of all data transfer commands. Ta
bles 7-2 through 7-4 list these commands separately, with each table
listing the commands for a particular data transfer type. These tables
are located with the explanatory paragraphs.
Query commands are a special form of data transfer commands. They
are used to query (or output) a variety of 37XXXC setup parameters.
For example, SRT? will output the current sweep start frequency.
Query command mnemonics typically closely resemble the correspond
ing setup command mnemonic but with an added question mark (?).
For example, CH1 is used to set the active channel to channel 1, CHX?
is used to query the currently active channel setting. Query commands
are listed in their respective Command Function Group chapter. For
example, since SRT? queries a Measurement Function, it will be listed
in Chapter 4, Measurement Group.
-
-
-
37XXXC PM7-11
DATA TRANSFER COMMANDSREMOTE ONLY FUNCTIONS
Error And Status
Reporting Commands
Commands associated with transferring error and status reporting
data are described in detail in paragraphs 7-11 and 7-15 respectively.
An unenhanced directory listing
#9000000392Directory of C:\ 1-30-96 13:03,UTIL<DIR>1-25-96 12:58,PLOT
Table 7-1. Alphabetical Listing of All 37XXXC Data Transfer Commands (1 of 2)
CommandDescription
DPR0Visible data only OFD format
DPR1Data pair always OFD format
FDE0Disable Output Data End Message
FDE1Enable Output Data End Message
FDEX?Output Output Data End Message enable/disable status
FMASelect ASCII data transfer format
FMBSelect IEEE754 64 bit data transfer format
FMCSelect IEEE754 32 bit data transfer format
FMX?Output data output mode FMA FMB or FMC
IC1Enter calibration coefficient 1
IC10Enter calibration coefficient 10
IC11Enter calibration coefficient 11
IC12Enter calibration coefficient 12
IFPCEnter flat power coefficients
LSBSelect least significant byte first binary transfer
MSBSelect most significant byte first binary transfer
O4FDOutput final data for all 4 channels to the GPIB
O4SCOutput corrected data for all four S-parameters
O4SROutput raw data for all four S-parameters
OAM1Output channel 1 active marker value
OAM2Output channel 2 active marker value
OAM3Output channel 3 active marker value
OAM4Output channel 4 active marker value
OC1Output calibration coefficients 1
OC10Output calibration coefficients 10
OC11Output calibration coefficients 11
OC12Output calibration coefficients 12
OC2Output calibration coefficients 2
OC3Output calibration coefficients 3
OC4Output calibration coefficients 4
OC5Output calibration coefficients 5
OC6Output calibration coefficients 6
OC7Output calibration coefficients 7
OC8Output calibration coefficients 8
OC9Output calibration coefficients 9
OCAOutput calibration coefficient A
OCBOutput calibration coefficient B
OCCOutput calibration coefficient C
OCDOutput corrected data for active channel parameter
OCFOutput front panel setup and calibration data
37XXXC PM7-13
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.