Anritsu 37211B Prelimary Programming Manual

MODEL
372XXB
VECTOR NETWORK ANALYZER
PRELIMINARY PROGRAMMING MANUAL
Software Version: 1.05
REVISION: A
PRINTED: FEBRUARY 1996
COPYRIGHT 1996 WILTRON CO.
490 JARVIS DRIVE MORGAN HILL, CA 95037-2809
WARRANTY
The WILTRON product(s) listed on the title page is (are) warranted against defects in materials and workmanship for one year from the date of shipment. WILTRON’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 WIL­TRON for warranty repairs. Obligation is limited to the original purchaser. WILTRON is not liable for consequential damages.
LIMITATION OF WARRANTY
The foregoing warranty does not apply to WILTRON connectors that have failed due to normal wear. Also, the warranty does not apply to defects resulting from improper or inadequate mainte­nance by the Buyer, unauthorized modification or misuse, or operation 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 WILTRON Company. ANACAT is a registered trademark of EEsof, Inc. Ink Jet and Think Jet are registered trademarks of Hewlett-Packard Co. MS-DOS is a registered trademark of Microsoft Corporation. Excel is a registered trademark of Microsoft Corporation.
NOTICE
WILTRON Company has prepared this manual for use by WILTRON Company personnel and customers as a guide for the proper installation, operation and maintenance of WILTRON Company equipment and computer programs. The drawings, specifications, and information contained herein are the property of WILTRON 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
10410-00186, REV: A
Safety Symbols
To prevent the risk of personal injury or loss related to equipment malfunction, WILTRON Company uses the following symbols to indicate safety-related information. For your own safety, please read the information carefully BEFORE operating the equipment.
Symbols used in manuals
DANGER This indicates a very dangerous procedure that could result in serious
injury or death if not performed properly.
WARNING This indicates a hazardous procedure that could result in serious in-
jury or death if not performed properly.
CAUTION This indicates a hazardous procedure or danger that could result in
light-to-severe injury, or loss related to equipment malfunction, if proper precautions are not taken.
Safety Symbols Used on Equipment and in Manuals
(Some or all of the following five symbols may or may not be used on all WILTRON equipment. In addition, there may be other labels attached to products that are not shown in the diagrams in this manual.)
The following safety symbols are used inside or on the equipment near operation locations to provide informa­tion about safety items and operation precautions. Ensure that you clearly understand the meanings of the symbols and take the necessary precautions BEFORE operating the equipment.
This indicates a prohibited operation. The prohibited operation is indi­cated symbolically in or near the barred circle.
This indicates a compulsory safety precaution. The required operation is indicated symbolocally in or near the circle.
This indicates warning or caution. The contents are indicated symboli­cally in or near the triangle.
This indicates a note. The contents are described in the box.
These indicate that the marked part should be recycled.
372XXB PM SAFETY-1
For Safety
WARNING
Always refer to the operation manual when working near locations at which the alert mark, shown on the left, is attached. If the operation, etc., is performed without heeding the advice in the operation manual, there is a risk of personal injury. In addition, the equipment perform­ance may be reduced.
Moreover, this alert mark is sometimes used with other marks and de­scriptions indicating other dangers.
WARNING
When supplying power to this equipment, connect the accessory 3-pin power cord to a 3-pin grounded power outlet. If a grounded 3-pin outlet is not available, use a conversion adapter and ground the green wire, or connect the frame ground on the rear panel of the equipment to ground. If power is supplied without grounding the equipment, there is a risk of receiving a severe or fatal electric shock.
Repair
WARNING
This equipment can not be repaired by the operator. DO NOT attempt to remove the equipment covers or to disassemble internal components. Only qualified service technicians with a knowledge of electrical fire and shock hazards should service this equipment. There are high-volt­age parts in this equipment presenting a risk of severe injury or fatal electric shock to untrained personnel. In addition, there is a risk of dam­age to precision components.
WARNING
Use two or more people to lift and move this equipment, or use an equipment cart. There is a risk of back injury, if this equipment is lifted by one person.
SAFETY-2 372XXB PM
Table Of Contents
Part 1 — GPIB Interface
Chapter 1 — Model 372XXB GPIB Programmer Interface
This chapter provides an introduction to the 372XXB 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 — Model 372XXB Programming Examples
This chapter provides sample program elements that demonstrate common 372XXB operations. These sample elements are useful as an aid in developing 372XXB programs.
Part 2 — GPIB Function Groups
Chapter 4 — Measurement Functions
This chapter provides a detailed description of the 372XXB specific GPIB commands that control the various data display and measurement control functions of the 372XXB.
Chapter 5 — Calibration Functions
This chapter describes the 372XXB error correction (calibration) functions and the commands used to implement a measurement calibration.
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 372XXB 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 consist of time domain, multiple source, sweep control, rear panel output, and CW sweep commands.
Part 3 — Programming Reference
Chapter 10 — Command Dictionary
This chapter provides an alphabetically-ordered, dictionary-type listing and description of all 372XXB GPIB programming commands. The listing for each command includes relevant details about the command.
372XXB GPIB PM i
Table of Contents (Continued)
Chapter 11 — Instrument Data
This chapter provides general (non-command specific) tabular information for the 372XXB. Much of this information is presented in Chapters 4 through 10, but is provided in this chapter for easy access.
Chapter 12 — Error Messages
This chapter provides a list of all Error Messages including those related to remote-only (GPIB) operation of the 372XXB.
Part 4 — Supplemental Data -
NOT AVAILABLE FOR PRELIMINARY MANUAL
Appendix A — Introduction to the IEEE 488 Bus
This appendix contains an introduction to the IEEE 488 Bus (GPIB). This material is intended to assist new users in understanding GPIB basics.
Appendix B — Front Panel Keys & Menus
This appendix provides description and diagrams for the 372XXB front panel key-groups and menus.
Appendix C — GPIB Quick Reference Guide
This appendix provides a quick reference to all 372XXB 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.
Appendix D — 360B Compatibility Information
This appendix provides compatibility information for GPIB operation and programming between the 372XXB Series and the 360B Series of WILTRON Vector Network Analyzers. It includes a listing of all 372XXB commands that shows the degree of functional compatibility between the 372XXB commands and the associated 360B commands.
ii 372XXB GPIB PM
Part 1 The GPIB Interface
This part consists of three chapters that describe how the IEEE- 488 (GPIB) interface is implemented within the 372XXB Vector Network Analyzer and how to perform basic GPIB commu­nications operations.
Chapter 1 – briefly describes the 372XXB GPIB programmer in-
terface and describes the communication to and from the inter­face during remote-only (GPIB) operation of the 372XXB.
Chapter 2 – provides a tutorial for performing basic GPIB opera-
tions such as sending and receiving messages, synchronizing in­strument operations, setting timeouts, and status checking.
Chapter 3 – provides sample program elements to familiarize
the user with 372XXB programming techniques. They are also useful as an aid in developing 372XXB programs.
Chapter 1 Model 372XXA GPIB Programmer Interface
Table of Contents
1-1 INTRODUCTION . . . . . . . . . . . . . . . . . . 1-3
1-2 REMOTE OPERATION INTERFACE . . . . . . . 1-3
GPIB Setup Menu . . . . . . . . . . . . . . . . 1-3
Interface Connection . . . . . . . . . . . . . . 1-4
Local Operation Key . . . . . . . . . . . . . . 1-4
Remote Operation LED Indicators . . . . . . . 1-6
1-3 GPIB COMMUNICATION . . . . . . . . . . . . . . 1-7
Bus Interface Function Messages . . . . . . . 1-7
372XXB Specific Messages . . . . . . . . . . . 1-7
Separator Characters . . . . . . . . . . . . . . 1-8
Terminator Character . . . . . . . . . . . . . . 1-8
GPIB Error Conditions . . . . . . . . . . . . . 1-8
Testing the 372XXB GPIB Operation . . . . . 1-9
1-4 IEEE 488.2 DOCUMENTATION SUMMARY . . . 1-10
Chapter 1 Model 372XXB GPIB Programmer Interface
1-1
1-2
INTRODUCTI ON
REMOTE OPERATION INTERFACE
GPIB Setup Menu The 372XXB VNA GPIB address defaults to 6. This value may be
System State
Default
Pr ogram
Utility
Menu
This chapter contains a brief introduction to the 372XXB GPIB inter­face and programming environment.
The following paragraphs describe the 372XXB facilities for remote op­eration.
The 372XXB fully supports the IEEE 488.2–1992 GPIB standard. All 372XXB 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 372XXB VNA func­tions as both a listener and a talker.
changed via the Utility Menu key’s GPIB ADDRESSES menu (below).
SELECT UTILITY
FUNCTION OPTIONS
GPIB ADDRESSES DISPLAY
INSTRUMENT STATE PARAMS
GENERAL DISK UTILITIES
CALIBRATION COMPONENT UTILITIES
COLOR CONFIGURATION
DATA ON(OFF) DRAWING
BLANKING FREQUENCY INFORMATION
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
Figure 1-1. GPIB Address Menu
372XXB GPIB PM 1-3
USER THE GPIB PROGRAMMER INTERFACE INTERFACE
Interface Connection Connect your external controller to the IEEE 488.2 GPIB interface con-
nector on the rear panel (left). A pinout listing of this connector is con­tained in Table 1-1.
Dspay
Pr nt er O ut
VG A O UT
C RT De gau ss CR T Brt
10 M Hz Re f
Ex te rn a I/O
Bas Fuses
Po r t 1 Po r t 2
IEEE 488.2 Interface
Dedicated GPIB Interface
Display
Reference Extenson
RAO ut
RA I n RB I n RB O ut
NOTE
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 372XXB to control external GPIB devices, such as a plotter, second frequency source, fre­quency counter, or a power meter.
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­cluding the controller).
Total accumulative cable length (in meters) may not exceed two times the number of bus instruments or 20 meters—whichever is less.
Individual cable length should not exceed 4 meters. 2/3 of the devices must be powered on. Devices should not be powered on while bus is in operation (that
is; actively sending or receiving messages, data, etc.). Minimize cable lengths to achieve maximum data transfer rates.
Local Operation Key Press the Ret Loc key (below) to quickly restore the 372XXB to local op-
eration. Local operation will be restored unless the 372XXB is pro­grammed for local lockout; the Local Lockout LED indicator will be lit.
78
9
3
6
45
Enter
1
2
3
10-3Clear
.
-
0
Channel
Setup
Limits
Ch 1 Ch 2
Menu
Marker
Readout
Ch 3 Ch 4
Menu
Marker
Graph
Set
Menu
Type
Default
Utility
Program
Menu
Save/
Begin
Apply
Recall
Cal
Cal
Menu
Scale
Start
Stop
S
Ref
Params
Plane
Print
Print
Data
Menu
Points
Device
Domain
Hold
ID
Auto
Option
Video
Scale
Menu
IF BW
Avg/
Trace
Smooth
Average
Trac e
Memory
Menu
Smooth
Clear
Ret Loc
1-4 372XXB GPIB PM
12 11 10
9 8 7 6 5 4 3 2 1
24 23 22 21 20 19 18 17 16 15 14 13
THE GPIB PROGRAMMER USER INTERFACE INTERFACE
Pinout Diagram
PIN NAME DESCRIPTION
1-4 DIO 1 thru DIO 4
Data Input/Ou tpu t.
Bits are HIGH with the data is lo gi cal 0 an d LOW when the data
is logical 1.
5EOI
End Or Identify.
A low-true state indicates that the last byte of a multibyte me ssage
has been placed on the line.
6DAV
Data Valid.
A low-true state indicates that the tal ker has (1) sensed that NRFD is LOW, (2) placed a byte of data on the bus, and (3) wa ited an approp riate le ngth of time for the data to settle.
7 NRFD
Not Ready For Da ta.
A high-true state indicates that valid d ata has not yet bee n
accepte d b y a li ste ner.
8 NDAC
Not Data Accepted.
A low-true state indicate s that the cu rrent data byte has been
accepted for inte rnal pro cessing by a listen er.
9IFC
Interface Clear.
A low-true state places all bus instrum ents in a known state—such
as, unaddressed to talk, unaddressed to listen, and service requ est idle.
10 SRQ
Service Request.
A low-true state indicates that a bus instrument needs service from
the contro lle r.
11 ATN
Attention.
A low-true state enables the controller to respond to both it’s own listen/talk address an d to ap propria te interfa ce me ssage s — such as, d evice clear and serial poll.
12 Shield Ground Poin t.
13-16 DIO 5 thru DIO 8
Data Input/Outp ut.
Bits are high with the data is lo gical 0 a nd L OW when the da ta
is logical 1.
17 REN
Remote En ab le.
A low-true state enables bus instru ments to be opera ted remotel y,
when addressed.
18-
GND Logi c gro un d.
24
Figure 1-2. Pinout Diagram, IEEE 488.2 GPIB Connector
372XXB GPIB PM 1-5
USER THE GPIB PROGRAMMER INTERFACE INTERFACE
78
9
3
6
45
Enter
123
10-3Clear
0.-
Channel
Setup
Data
Menu
Poi nts
Devi ce
Domain
Hold
ID
Auto
Option
Vid eo
Scale
Menu
IF BW
Avg/
Trace
Smooth
Average
Trace
Memory
Menu
Smooth
Default
Utility
Begin
Apply
Program
Menu
Cal
Cal
GPIB Remote
Talk Listen
SRQ Local Lockout
Limits
Ch 1 Ch 2
Menu
Marker
Readout
Ch 3 Ch 4
Menu
Marker
Graph
Set
Menu
Type
Save/ Recall
Menu
Scale
Start
Stop
S
Ref
Params
Plane
Print
Print
Remote Operation
LED Indicators
GPIB Remote Indicators (above) signal operational status of the GPIB, as described below:
Remote:
Lights when the 372XXB switches to remote (GPIB) control. It re­mains lit until the unit returns to local control.
Tal k:
Lights when you address the 372XXB to talk and remains lit until un­addressed to talk.
Listen:
Lights when you address the 372XXB to listen and remains lit until unaddressed to talk.
SRQ:
Lights when the 372XXB sends a Service Request (SRQ) to the exter­nal controller. The LED remains lit until the 372XXB 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 372XXB to local control via the front panel.
Audible Indicators A 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.
1-6 372XXB GPIB PM
THE GPIB PROGRAMMER GPIB INTERFACE COMMUNICATIONS
1-3
GPIB COMMUNICATION
The following paragraphs present a short summary of 372XXB GPIB communication. Subjects covered are program messages, separa­tor/termination characters, status reporting, and GPIB error condi­tions and corresponding 372XXB responses. Refer to Chapter 7, Re­mote-Only Operation, for detailed description of these topics.
The primary GPIB messages that effect 372XXB 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 Appen­dix 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 Func­tion Messages and the 372XXB response to them.
Table 1-1. IEEE-488 Interface Function Messages
Interfa ce F u n cti o n
Message
DCL SDC
Message Function
Device Clear Selected Device Clear
Addressed
Command
No
Yes
372XXB VNA Response
Resets the 372XXB GPI B com munica tion funct ions. Resets the 372XXB GPI B com munica tion funct ions.
GTL Go To Local Yes Returns the 372XXB to local (front panel) contro l. GET Group Execute
Trigger
IFC Interface Clear No Stops the 372XXB GPIB from talking/list enin g. LLO Local Lockout No Disables the front panel RETURN TO LOCA L key. REN Remot e Enable No Places the 372XXB in remote when addressed to listen.
372XXB Specific
Messages
The 372XXB specific GPIB messages (also known as commands, que­ries, and mnemonics) are used to control 372XXB front panel func-
Yes Executes a string of comm ands defin ed by the IEEE 488. 2
common comm and *D DT. A GET is also done b y using the *TRG command (see Chapter 10, Command Dictionary).
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­tion.
Refer to Chapter 10, Command Dictionary; Appendix C, Quick Refer­ence Guide; and Chapters 4-9 for information on all 372XXB com­mands. The commands are organized both alphabetically and by command function groups. There are many examples throughout the this manual to assist you in learning and using a desired command.
372XXB GPIB PM 1-7
GPIB THE GPIB PROGRAMMER COMMUNICATIONS INTERFACE
Most 372XXB commands are three character contractions of their func­tional descriptions. Examples include: OM1 (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 nu- meric value. These commands can optionally accept a units or suffix terminator mnemonic. For example, 2 GHz.)
Query commands, typically ending in a question mark (?), are used to inquire about the state of a particular instrument function. Many 372XXB 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 com­mands are described throughout the Programming Manual in the spe­cific funtional group where they are used. A consolidated listing of these commands can be found in Table 1-2, item 12 below and in Chap­ter 7. An example IEEE 488.2 Common command is the *IDN? query (Output Instrument ID String.)
SRT 2 GHZ (set start frequency to
(Output Marker 1), IFV
Separator
Characters
Terminator
Character
GPIB Error
Conditions
Separator characters are used to delimit program message elements sent to or received from the 372XXB. The permitted characters: semi­colon (;), comma (,), and space ( ) and their usage is shown below.
Character Used to separate
;
,
Space A command , its num eric al entry valu e, and suf f ix mnemo nic.
The only allowed terminator character for 372XXB GPIB messages is the the linefeed character (0A, decimal 10).
The 372XXB responds to GPIB errors in the following manner:
A beep is issued. An error message is displayed on the screen.
Multiple commands and multiple out put respon se messa ges. Multiple ASCII data e leme nts for a single comm and.
1-8 372XXB GPIB PM
THE GPIB PROGRAMMER GPIB INTERFACE COMMUNICATIONS
A bit is set in the Standard Event Status Register, and, if en­abled, an SRQ is generated.
An entry is written into the non-volatile Service Log describing 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 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 372XXB will ignore the remainder of commands in that
program message.
Testing the 372XXB
GPIB Operation
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.
Bit 3 - Device Dependant 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 372XXB cannot provide the requested data. For ex­ample, 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 372XXB error messages (including GPIB errors).
The following test can be used to check your GPIB cable and 372XXB GPIB connectors.
1. Disconnect all GPIB cables from the 372XXB.
2. Connect your GPIB cable between the two GPIB connectors on the 372XXB 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.
372XXB GPIB PM 1-9
IEEE 488.2 THE GPIB PROGRAMMER DOCUMENTATION SUMMARY INTERFACE
1-4
Table 1-2. 372XXB IEEE 488.2 Standard Documentation Summary (1 of 3)
Number Requirement Item Impl ementation in VNA
IEEE 488.2 DOCUMENTATION SUMMARY
1 Interface Functio n Subse ts Implemented SH1, AH1, T6, L4, SR1, RL1, PP1, DC1, DT1, C0, E2. 2 Device behavior w he n th e user (un it) GPI B addres s
is set outside of the 0–30 range
3 When is a user address change recog nized? New address is accepted and entry color remains
4 Description of settings at power-on The front panel setup that was in effect prior to power
Table 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 372XXB.
VNA returns an Out-of-Range error , issues an audible beep, and the entry color on front panel menu display is changed to red. Ente red addr ess is not accept ed.
green.
down will be restored, taken out of hold if it was previously set. Periodic I F Cal will be returned to timed operation.
Memories saved:
1. GPIB ad dress
2. Internal hardware calibration dat a
3. Information repor te d via the *IDN? and *OPT? queries.
4. Calibration coefficient s
5. Normalized trace data
6. Stored front pane l se tu ps
Memories Cleared:
1. Service Request message.
2. Standard event statu s register (excep t the Power-On bit is set)
3. Extended event status register
4. Limit pass/fail st at us re gister
5. Enable registers for items 2 thru 4, above.
6. GPIB input and output que ues.
7. Trigger action for *TRG and GET r eset t o n u ll.
Data Tr ansf er :
1. Data tr a ns fer is reset to MSB fir st for numerical array data transfer s.
2. Data transfer format is reset t o default, ASCII mode (FMA) for numerical array transf er s.
3. Data pair forma t for OFD/I FD/ O M 1- OM6 comma nds is set to default (off) mo de. (See com ma nd DPR0.)
Menu Displa y ed:
Setup Menu
except:
the 372XXB will be
1-10 372XXB GPIB PM
THE GPIB PROGRAMMER IEEE 488.2 INTERFACE DOCUMENTATION SUMMARY
Table 1-2. 372XXB IEEE 488.2 Standard Documentation Summary (2 of 3)
Number Requirement Item Impl ementation in VNA
5 Message exchan ge opt ions
a. Size and behavior of input buf fe r a. Default size = 3 KByte. Size increa ses to re quire d
amount , as need ed, for <Arbitr ar y B lock> t ransf er s. For the <Indefinit e Len gth Ar bitr ary Block> da ta element s, the inp ut buf f er size f or that element i s 64 Kbyte. At t empt in g to pr ogr am more dat a tha n 64 KByte will cause a loss of all data for that element. A DDE error message will be issued to indicate this con dition. F or <Def inite Len gth Ar bitr ary Block> data elements, an attempt is made to set the buffer size for that elem ent t o the size indicated in the header . If there is in suf ficien t system memory available at the time, a ll data for that eleme nt is lost. A DDE error messa ge will be issued to indicat e this condition.
b. Queries that return m ore than one <RESPON S E
MESSAGE UNIT> c. Queries that generate a respo nse w he n par sed c. Al l d. Queries that generat e a response w he n rea d d. None e. Commands that are coupled e. None
6 Functional element s us ed in cons truction of device-
specific commands.
b. None
See command desc ript ions.
7 Buffer size limitations 372XXB Attempts to allocate amou nt re quired; sets
DDE error if not possible. (See 5a., above)
8 <PROGRAM DAT A> elem ents that may appear
within an <expression>
9 Response synt ax for querie s See command desc ript ions.
10 Description of dev ice-to- dev ice messag e trans fer
traffic that does not follow the rules for <RESPON SE MESSAGES>
11 Size of block data responses V ar iable, See comm and descript ions for de tails. 12 IEEE.488.2 Comm on co mman ds and querie s that
are imp le me nted
13 State of VNA following the successful complet ion of
the Calibration quer y
14 Maximum lengt h of the block us ed to def ine t he
trigger macro (1 .) The met hod o f inter pret in g *TRG within a *DDT command sequence ( 2.)
N/A (expre ssions are not used)
None
*CLS, *DDT, *DDT?, *ESE, *ESE?, *ESR? , *IDN?, *IST?, *OPC, *OPC?, *OPT?, *PRE, *PRE?, *RST, *SRE, *SRE?, *STB?, *TRG, *TST?, *WAI
Normal State
1. 255 chara ct ers.
2. On execution, the 372XXB returns a command error and ignores the rest of the string.
372XXB GPIB PM 1-11
IEEE 488.2 THE GPIB PROGRAMMER DOCUMENTATION SUMMARY INTERFACE
Table 1-2. 372XXB IEEE 488.2 Standard Documentation Summary (3 of 3)
Number Requirement Item Impl ementation in VNA
15 Maximum length and complexity of macro labels;
maximum lengt h of block used t o define a m acr o; and how recursion is handle d durin g macro
expansion, if macro comma nds ar e imple me nted. 16 Response to common quer y *IDN?. WILTRON, <Model>, <SN>, <SW rev ision > 17 Size of the protected us er data storag e are a, if the
*PUD command or *PUD? query are implemented. 18 Size of resource de scrip tion , if the *RDT com mand
or *RDT? query are implemented. 19 States affect ed by *RST, *LRN?, *RCL, and *SAV. *RST = default state (see Ch apt er 11),
20 Scope of the self test performe d by *TST? comm and . Fully automated internal har dwar e testing/ re por ting .
21 Additional status data structu res used in stat us
reporting. 22 Statement des cribing wh ether each co mman d is
overlapped or sequ ent ial. 23 Functional criteria that is met when an operatio n
complete message is generat ed in respons e to that
command.
N/A
N/A
N/A
*LRN, *RCL, *SAV not implemented
Failure results, if any, are written to the internal non­volatile 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 overlappe d comm ands .
24 Descriptions used for infinit y and not-a- num ber. N/A
1-12 372XXB GPIB PM
Chapter 2 GPIB Programming Basics
Table of Contents
2-1 INTRODUCTION . . . . . . . . . . . . . . . . . . 2-3
2-2 EQUIPMENT AND CONFIGURATION . . . . . . 2-3
Required Equipment . . . . . . . . . . . . . . 2-3
Configuration . . . . . . . . . . . . . . . . . . 2-4
2-3 GPIB PROGRAM ELEMENTS . . . . . . . . . . . 2-5
National Instruments GPIB Interface . . . . . 2-5
Definitions . . . . . . . . . . . . . . . . . . . . 2-5
2-4 INITIALIZING THE GPIB . . . . . . . . . . . . . 2-6
2-5 SHUTTING DOWN THE GPIB SYSTEM . . . . . 2-6
2-6 DETECTING GPIB ERRORS . . . . . . . . . . . . 2-7
Full Error Detection . . . . . . . . . . . . . . . 2-7
Limited Handling Error Detection . . . . . . . 2-7
NI488 Global Variables . . . . . . . . . . . . . 2-7
Example . . . . . . . . . . . . . . . . . . . . . 2-7
2-7 SETTING GPIB OPERATION TIME OUT . . . . . 2-8
Example . . . . . . . . . . . . . . . . . . . . . 2-8
2-8 SENDING COMMANDS . . . . . . . . . . . . . . 2-9
Example: . . . . . . . . . . . . . . . . . . . . . 2-9
372XXB Commands Used . . . . . . . . . . . . 2-9
2-9 RECEIVING DATA FROM AN INSTRUMENT . . 2-10
Example: . . . . . . . . . . . . . . . . . . . . . 2-10
Error Handling: . . . . . . . . . . . . . . . . . 2-10
372XXB Commands Used . . . . . . . . . . . . 2-11
2-10 SRQ HANDLING . . . . . . . . . . . . . . . . . . 2-11
Calculating the Binary Weighted
Bit Value . . . . . . . . . . . . . . . . . . . . 2-11
Enabling Service Request . . . . . . . . . . . . 2-11
Example . . . . . . . . . . . . . . . . . . . . . 2-11
Commands Used . . . . . . . . . . . . . . . . . 2-12
NI488 SRQ Functions . . . . . . . . . . . . . . 2-12
2-11 WAITING FOR INSTRUMENT OPERATIONS
TO COMPLETE . . . . . . . . . . . . . . . . . . . 2-13
Example 1 . . . . . . . . . . . . . . . . . . . . 2-13
Example 2 . . . . . . . . . . . . . . . . . . . . 2-13
372XXB Commands Used . . . . . . . . . . . . 2-14
Chapter 2 GPIB Programming Basics
2-1
2-2
INTRODUCTI ON
EQUIPM ENT A ND CONFIGU RATION
Required Equipment The following equipment represents a minimum GPIB controllable
This chapter contains a brief introduction to GPIB programming tech­niques and describes procedures to be used when preparing GPIB pro­grams for the 372XXB VNA. It includes information about equipment requirements and configuration for GPIB control of the 372XXB VNA, and many programming tips.
Familiarity with manual (front panel) operation of the 372XXB is as­sumed. (Throughout this section, the 372XXB VNA is referred to sim­ply as “372XXB”.) A complete description of front panel operation is contained in the 372XXB Vector Network Analyzer System Operation Manual.
The programming examples contained in this chapter assume the equipment listed below is present and configured as described.
372XXB VNA system:
A 372XXB Vector Network Analyzer. A computer/controller that supports the IEEE 488 GPIB stand-
ard. The examples in this chapter address the IBM compatible computers.
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.
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.).
A GPIB cable (preferably 2 meters long).
372XXB GPIB PM 2-3
EQUIPMENT AND MODEL 372XXB CONFIGURATION PROGRAMMING
To: IEEE 488.2 Interface
From: IEEE 488 Interface card connector
Figure 2-1. Model 372XXB Shown Connected to an IEEE 488.2 Controller
NOTE
The IBM PC and National Instruments GPIB interface were chosen for demonstrating the 372XXB GPIB opera­tion in this manual. Any other GPIB controller that con­forms to the IEEE 488 standard can be used to interface to the 372XXB.
connector
D spay
Pr nt er O ut
CRT Degaus s CRT Br t
Configuration Configure the 372XXB as shown in Figure 2-1. Apply power to the
372XXB and allow the system software to load from disk. Once the software has finished loading and start-up testing is complete, the
10 M Hz Re f
372XXB is ready to be remotely controlled via the GPIB. It is impor­tant to note that the 372XXB will not respond to GPIB commands un-
VG A O UT
Ex te rn a I/ O
Re ference Exte nson
Bas Fuses
Po r t 1 Po r t 2
RAO u t
RA I n RB I n RB O u t
til the 372XXB 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-
Connect here
Do not connect here
Dis play
gramming language software (QuickBASIC, “C”, etc.).
The default GPIB address for the 372XXB (6) is assumed for all exam­ples in this chapter.
2-4 372XXB GPIB PM
MODEL 372XXB GPIB PROGRAMMING PROGRAM ELEMENTS
2-3
GPIB PROGRAM ELEMENTS
National
Instruments
GPIB 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 included 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 proce­dures 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 g pi b.com is what allows your GPIB program to physically inter- face 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.
Definitions The following definitions apply for the remainder of this chapter:
board = 0, Active controller board number address = 6, GPIB address of the instrument. 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).
372XXB GPIB PM 2-5
INITIALIZING MODEL 372XXB THE GPIB PROGRAMMING
2-4
INITIALIZING THE GPIB
Initializing 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.
NI488 does this by sending an interface clear to the desired board using:
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.
2-5
SHUTTI NG DO WN T HE GPIB SYSTEM
To place all instruments in remote state, use:
EnableRemote(board, addressList)
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
Insuring that you have control over the bus. Clearing all instruments’ GPIB and placing them in an idle state. Releasing the controller GPIB software and hardware.
Implement the above by sending:
SendIFC(board) ibonl(board, 0)
2-6 372XXB GPIB PM
MODEL 372XXB DETECTING PROGRAMMING GPIB ERRORS
2-6
DETEC TING GP IB ERRORS
Full Error Detection Full 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 proc­ess. This process is typically much slower than executing (error check­ing) 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
This variable provides the latest bus activity status; that is, er­rors, completions, time outs, etc.
IBERR This variable provides information on the type of error, if an error was reported in IBSTA.
IBCNT/IBCNTL
The number of data bytes transferred on the bus in the last opera­tion. IBCNTL is the “long integer” version of IBCNT.
Example Error checking for the NI488 interface is as follows. After each GPIB
call, the IBSTA is checked for errors using the NI488 declared constant EERR - in BASIC, or ERR in C. If true, the gpiberr() function is called to decode and display the global variables IBS TA, IBERR, and IBCNT. For example, for QuickBASIC, the following code is inserted after a GPIB call:
IF IBST A% 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.
372XXB GPIB PM 2-7
SETTING GPIB MODEL 372XXB OPERATION TIME OUT PROGRAMMING
2-7
SETT ING GPIB OPERATION TIME OUT
Example The NI488 time out is set using the ibtmo() interface call, as follows:
Setting 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.)
ibtmo(instrument_handle, timeout_setting)
Where:
instrument_handle = The value returned by the ibfind() or ibdev() interface call for the instrument.
timeout_setting = A value that disables or sets the time out set­ting. 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.b a s, decl .h ).
NOTE
Consult NI488 documentation and distribution disks for information and an example on using ibtmo() , ifbind(), and ibdev().
2-8 372XXB GPIB PM
MODEL 372XXB SENDING PROGRAMMING COMMANDS
2-8
SENDING COMMANDS
GPIB 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 , numByt es, eot_mode)
Where:
board, address = see section 2-3 for definitions. buffer = String of one or more instrument specific GPIB com-
mands from the defined list in the instrument’s GPIB documenta­tion.
buffer = String of one or more instrument specific GPIB com­mands from the defined list in the instrument’s GPIB documenta­tion.
numBytes = The number of bytes contained in the buffer. eot_mode = The method used to signal end of transmission. This
is typically done using ASCII linefeed character 0A hex (10 deci- mal) 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:
NLend - linefeed with EOI DABend - EOI only NULLend - Do nothing to mark end of transmission
Example: Send the 372XXB at address 6, the commands CH2;DSP;MAG”, from
372XXB
Commands Used
controller number 0, using the linefeed with EOI to mark the end of transmission:
Send (0, 6, “CH2;DSP;MAG”,1 1,NLend)
The above example uses the following commands defined in the 372XXB 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.
372XXB GPIB PM 2-9
RECEIVING DATA MODEL 372XXB FROM AN INSTRUMENT PROGRAMMING
2-9
RECEIVING DATA FROM AN INSTRUMENT
In 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. buffer = The name of the memory address of the buffer where 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­strument. Insure that “buffer” above is of at least this size.
eod_mode = The method used to signal the controller to stop re­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 charac­ter is received, then use the hex value of that character instead of the ST OPend.
Example: Use the NI488 controller number 0, to send the 372XXB at address 6,
the command ONP” using the line feed with EOI to mark end of trans- mission:
Send(0, 6, “ONP”, 3, NLend)
Upon receiving a data output command, the 372XXB 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-10 372XXB GPIB PM
Loading...
+ 347 hidden pages