Agilent E6380A Programming Manual

Agilent Technologies 8935 Series
E6380A CDMA Cellular/PCS Base Station Test Set
and E6381A TDMA Base Station Test Set
Programmer’s Guide
Firmware Version: E6380A - A.02.02 and above E6381A - A.02.01 and above
Agilent Part Number: E6380-90018
Revision C
March 2000
Notice
Information contained in this document is subject to change without notice.
All Rights Reserved. Reproduction, adaptation, or translation without prior written permission is prohibited, except as allowed under the copyright laws.
This material may be reproduced by or for the U.S. Government pursuant to the Copyright License under the clause at DFARS
52.227-7013 (APR 1988).
© Copyright Agilent Technologies 1997-1999
2

Contents

1. Using HP-IB
Overview of the Test Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Manual Control Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Internal Automatic Control Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
External Automatic Control Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Writing programs for the Test Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
What is HP-IB? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
HP-IB Information Provided in This Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
General HP-IB Programming Guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Control Annunciators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Preparing the Test Set For HP-IB Use . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Using the HP-IB with the Test Set’s built-in IBASIC Controller . . . . . . . . . . . . . . . . . . . . 38
Basic Programming Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Remote Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Remote Capabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Factory Set Address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Extended Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Multiple Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Setting the Test Set’s Bus Address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Displaying the Bus Address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
IEEE 488.1 Remote Interface Message Capabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Remote/Local Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Remote Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Local Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Remote or Local Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Local To Remote Transitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Remote To Local Transitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Local Lockout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Clear Lockout/Set Local . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
2. Methods For Reading Measurement Results
Background. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
RMB ‘ON TIMEOUT’ Example Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Comments for Recommended Routine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
RMB ‘MAV’ Example Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Comments for Recommended Routine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
3. HP-IB Command Guidelines
Sequential and Overlapped Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Guidelines for Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Command Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Command Punctuation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Specifying Units-of-Measure for Settings and Measurement Results . . . . . . . . . . . . . . . . 68
Using the STATe Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Sample HP-IB Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
3
Contents
4. IEEE Common Commands
IEEE 488.2 Common Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .88
Common Command Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .89
*IDN? (Identification Query) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .89
*OPT? (Option Identification Query) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .90
*RST (Reset) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .91
*TST? (Self-Test Query) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .92
*OPC (Operation Complete) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .93
*OPC? (Operation Complete Query) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .96
*WAI (Wait To Complete) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .98
*CLS (Clear Status) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .99
*ESE (Standard Event Status Enable) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .99
*ESE? (Standard Event Status Enable Query) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .99
*ESR? (Standard Event Status Register Query) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .99
*SRE (Service Request Enable) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .99
*SRE? (Service Request Enable Query) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .100
*STB? (Status Byte Query) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .100
*TRG (Trigger) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .100
*PCB (Pass Control Back) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .100
*RCL (Recall Instrument State) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .100
*SAV (Save Instrument State) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .101
5. Triggering Measurements
Triggering Measurements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .105
Trigger Event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .105
Trigger Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .106
Default Trigger Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .108
Local/Remote Triggering Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .108
Trigger Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .109
Trigger Mode and Measurement Speed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .110
Measurement Pacing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .111
Arming Hardware-Triggered Measurements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .112
6. Advanced Operations
Increasing Measurement Throughput . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .114
Optimizing Measurement Speed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .114
Optimizing Measurement Setup Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .116
Optimizing the Execution Speed of the Control Program . . . . . . . . . . . . . . . . . . . . . . . . . .117
Status Reporting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .121
Status Reporting Structure Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .121
Status Byte Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .123
Status Register Structure Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .127
Status Register Group Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .132
Operation Status Register Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .133
Standard Event Status Register Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .137
Output Queue Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .143
Error Message Queue Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .145
Questionable Data/Signal Register Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .147
4
Contents
Calibration Status Register Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
Hardware Status Register #2 Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
Hardware Status Register #1 Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
Communicate Status Register Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
HP-IB Service Requests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
Setting Up and Enabling SRQ Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
Service Request Enable Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
Procedure for Generating a Service Request . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
Example BASIC Program to Set Up and Service an SRQ Interrupt . . . . . . . . . . . . . . . . 173
Instrument Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
Methods of Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
Power-On Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
Front-panel PRESET Key . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
*RST IEEE 488.2 Common Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
Device Clear (DCL) HP-IB Bus Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
Selected Device Clear (SDC) HP-IB Bus Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
Interface Clear (IFC) HP-IB Bus Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
Passing Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
Configuring the Test Set as the System Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
When Active Controller Capability is Required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
Passing Control to the Test Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
Passing Control Back to Another Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
Requesting Control using IBASIC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
Pass Control Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
7. Memory Cards/Mass Storage
Default File System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
Mass Storage Device Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
Default Mass Storage Locations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
Built-in IBASIC Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
Save/Recall Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
Tests Subsystem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
Selecting the Mass Storage Location . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
Mass Storage Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
DOS File System Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
Test Set File Naming Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
Potential File Name Conflicts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
File Naming Recommendations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
Initializing Media . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
Test Set File Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
Using the ROM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
Using PC Cards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
Inserting and Removing Memory Cards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
Setting the Write-Protect Switch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
The Memory Card Battery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
Memory Card Mass Storage Volume Specifier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
Memory Cards and Initialization. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
Backing Up Procedure and Library Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
Using the COPY_PL ROM Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
5
Contents
Copying Files Using IBASIC Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .219
Copying an Entire Volume . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .219
Using RAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .221
Initializing RAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .222
8. IBASIC Controller
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .224
The IBASIC Controller Screen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .225
Important Notes for Program Development . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .227
Program Development . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .228
Interfacing to the IBASIC Controller using Serial Ports . . . . . . . . . . . . . . . . . . . . . . . . . . . .230
Test Set Serial Port Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .230
Receive and Transmit Pacing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .233
PC Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .234
Terminal Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .240
Choosing Your Development Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .241
Method 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .242
Method 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .242
Method 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .242
Method #1. Program Development on an External BASIC Language Computer . . . . . . . . .243
Configuring the Test Set’s HP-IB Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .244
Compatible BASIC Language Computers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .244
HP BASIC for Windows PC Configuration for Windows NT Operating System . . . . . . . .245
Program Development Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .246
Downloading Programs to the Test Set through HP-IB . . . . . . . . . . . . . . . . . . . . . . . . . . .247
Uploading Programs from the Test Set to an External BASIC Controller through HP-IB . . 248
Method #2. Developing Programs on the Test Set Using the IBASIC EDIT Mode . . . . . . .250
Selecting the IBASIC Command Line Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .250
Entering and Exiting the IBASIC EDIT Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .252
Setting Up Function Keys In HyperTerminal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .253
Setting Up Function Keys in AdvanceLink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .253
Setting Up Function Keys in ProComm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .254
Method #3. Developing Programs Using Word Processor on a PC
(Least Preferred) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .255
Configuring a Word Processor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .255
Writing Lines of IBASIC Code on a Word Processor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .256
Transferring Programs from the Word Processor to the Test Set . . . . . . . . . . . . . . . . . . .257
Sending ASCII Text Files Over RS-232 With HyperTerminal . . . . . . . . . . . . . . . . . . . . . .260
Sending ASCII Text Files over RS-232 with ProComm Communications Software . . . . .261
Uploading Programs from the Test Set to a PC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .263
Serial I/O from IBASIC Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .264
Serial Ports 9 and 10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .264
Example IBASIC Program Using Serial Port 10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .265
Serial Port 10 Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .266
PROGram Subsystem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .267
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .267
SCPI PROGram Subsystem. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .267
Test Set PROGram Subsystem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .268
6
Contents
PROGram Subsystem Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
Using the EXECute Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
The TESTS Subsystem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
Writing Programs For the TESTS Subsystem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
TESTS Subsystem File Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
TESTS Subsystem Screens . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
9. Error Messages
General Information About Error Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298
Positive Numbered Error Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298
IBASIC Error Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299
HP-IB Error Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299
Text Only Error Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300
The Message Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
Non-Recoverable Firmware Error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
Text Only Error Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
HP-IB Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304
Text Only HP-IB Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305
Numbered HP-IB Error Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
7
Contents
8

About this manual, its companions, and product regulatory information.

What is discussed in this manual

This manual explains how to program the Test Set.
This document presents the information needed to perform IBASIC programming operations, such as writing, editing, copying, or cataloguing programs.

Where to find other information

HP-IB syntax used to write programs for the Test Set if found in the HP-IB Syntax Reference Guide.
The IBASIC language is explained in the Agilent Technologies Instrument BASIC User’s Handbook (Agilent Technologies part number E2083-90005).
A step-by-step approach to base station testing using the Test Set, including what you need to know before you can start testing is found in the Application Guides. These guides each cover a specific technology or radio system.
General operation of the Test Set (such as changing display screens and using their associated controls) is discussed in the Reference Guide. The
Reference Guide also describes the Test Set’s keys, connectors and display screens, and the measurements that the Test Set can perform.
Each manufacturer and cellular service provider has their own cell site control and base station configuration procedures that go beyond the scope of this documentation. You must refer to the manufacturer’s documentation for information about controlling the base station, switching system, or any other software or hardware associated with your cell site equipment.

Conventions Used in This Manual

The following conventions are used throughout this manual to help clarify instructions and reduce unnecessary text:
Test Set refers to the Agilent Technologies 8935 Series E6380A CDMA Cellular/PCS Base Station Test Set and E6381A TDMA Base Station Test Set.
• Test Set keys are indicated like this:
• Test Set screen information, such as a measurement result or an error message, is shown like this: TX Channel Power -1.3 dBm
Preset
9
NOTE
HP-IB and GPIB are one and the same.

Trademark Acknowledgements

Hewlett-Packard and HP are registered trademarks of Hewlett-Packard Company.
Microsoft‚, Windows, and MS-DOS‚ are registered trademarks of Microsoft Corporation.
ProComm‚ is a registered trademark of DataStorm Technologies, Inc.
HyperTerminal is a registered trademark of Hilgraeve, Incorporated
Pentiumand Intel are registered trademarks of Intel Corporation.

Which Document is Required?

The following documents are part of the Test Set’s family’s document library. Use the table to help you decide which documents you need. Some of the documents are provided with the Test Set, others may be ordered separately.
Table 1 Agilent Technologies 8935 Series E6380A Document Navigation
Documents Part Number Usage
HP-IB Syntax Guide E6381-90014 Use this listing of HP-IB syntax when writing
control programs for the Test Set.
Assembly Level Repair Guide
CDMA Application Guide E6380-90016 Use this manual for basic CDMA measurements
AMPS Application Guide E6380-90017 Use this manual for making AMPS base station
Programmer’s Guide E6380-90018 Use this manual to learn how to write programs
Reference Guide E6381-90019 Use this manual for general information on
CD-ROM E6380-90027 All user documentation.
E6380-90015 Use this manual to perform calibration on the
Test Set and for general service information.
and for getting started with the Test Set.
measurements.
for the Test Set.
accessing and changing settings, general Test Set operation, connector descriptions, and error messages. It also contains information on loading and running the various automated test routines (RF Tools) built in to the Test Set.
10
O:\Manuals\E6380A_Progguid\Book\Preface.fm

Regulatory Information

Manufacturer’s Declaration
This statement is provided to comply with the requirements of the German Sound Emission Directive, from 18 January 1991.
This product has a sound pressure emission (at the operator position) < 70 dB(A).
• Sound Pressure Lp < 70 dB(A).
• At Operator Position.
• Normal Operation.
• According to ISO 7779:1988/EN 27779:1991 (Type Test).

Herstellerbescheinigung

Diese Information steht im Zusammenhang mit den Anforderungen der Maschinenlärminformationsverordnung vom 18 Januar 1991.
• Schalldruckpegel Lp < 70 dB(A).
•Am Arbeitsplatz.
• Normaler Betrieb.
• Nach ISO 7779:1988/EN 27779:1991 (Typprüfung).
11

Safety

GENERAL
This product and related documentation must be reviewed for familiarization with safety markings and instructions before operation.
This product has been designed and tested in accordance with IEC Publication 1010, Safety Requirements for Electronic Measuring Apparatus, and has been supplied in a safe condition. This instruction documentation contains information and warnings which must be followed by the user to ensure safe operation and to maintain the product in a safe condition.
SAFETY SYMBOLS
WARNING
CAUTION
!
Indicates instrument damage can occur if indicated operating limits are exceeded. Refer to the instructions in this guide.
Indicates hazardous voltages.
Indicates earth (ground) terminal
A WARNING note denotes a hazard. It calls attention to a procedure, practice, or the like, which, if not correctly performed or adhered to, could result in personal injury. Do not proceed beyond a WARNING sign until the indicated conditions are fully understood and met.
A CAUTION note denotes a hazard. It calls attention to an operation procedure, practice, or the like, which, if not correctly performed or adhered to, could result in damage to or destruction of part or all of the product. Do not proceed beyond a CAUTION note until the indicated conditions are fully understood and met.
12
O:\Manuals\E6380A_Progguid\Book\Preface.fm
Safety Considerations for this Instrument
WARNING
This product is a Safety Class I instrument (provided with a protective earthing ground incorporated in the power cord). The mains plug shall only be inserted in a socket outlet provided with a protective earth contact. Any interruption of
!
the protective conductor inside or outside of the product is likely to make the product dangerous. Intentional interruption is prohibited.
This product is not intended for use in wet or damp
!
environments. Do not expose this product to excessive moisture. Operate this product only within the temperature
and humidity ranges specified in the user’s manual.
This instrument is equipped with internal ground fault circuit
!
interrupter class A.
• This device does not protect against electrical shock due to contact with both circuit conductors or a fault in supply wiring to product.
• Do not use extension cord to connect this product to power receptacle. Attention-ne pas utiliser de rallonge pour raccorder le detecteur-disjoncteur a la prise de courant.
• Replace cordset only with Agilent Technologies 8120 series. Attention - Remplacer uniquement par un cordon amovible numero 8120.
• Do not use in wet location. Ne pas utiliser dans un emplacement mouille.
13
WARNING
Whenever it is likely that the protection has been impaired, the instrument must be made inoperative and be secured against any unintended operation.
If this instrument is to be energized via an autotransformer (for voltage reduction), make sure the common terminal is connected to the earth terminal of the power source.
If this product is not used as specified, the protection provided by the equipment could be impaired. This product must be used in a normal condition (in which all means for protection are intact) only.
No operator serviceable parts in this product. Refer servicing to qualified personnel. To prevent electrical shock, do not remove covers.
Servicing instructions are for use by qualified personnel only. To avoid electrical shock, do not perform any servicing unless you are qualified to do so.
The opening of covers or removal of parts is likely to expose dangerous voltages. Disconnect the product from all voltage sources while it is being opened.
Adjustments described in the manual are performed with power supplied to the instrument while protective covers are removed. Energy available at many points may, if contacted, result in personal injury.
The power cord is connected to internal capacitors that my remain live for 5 seconds after disconnecting the plug from its power supply.
For Continued protection against fire hazard, replace the line fuse(s) only with 250 V fuse(s) or the same current rating and type (for example, normal blow or time delay). Do not use repaired fuses or short circuited fuseholders. FUSE: T 5.0A
14
O:\Manuals\E6380A_Progguid\Book\Preface.fm
CAUTION
Always use the three-prong ac power cord supplied with this product. Failure to ensure adequate earth grounding by not using this cord may cause personal injury and/or product damage.
This product is designed for use in Installation Category II and Pollution Degree 2 per IEC 1010 and IEC 664 respectively. For indoor use only.
This product has autoranging line voltage input, be sure the supply voltage is within the specified range.
Ventilation Requirements: When installing the product in a cabinet, the convection into and out of the product must not be restricted. The ambient temperature (outside the cabinet) must be less than the
maximum operating temperature of the product by 4° C for every 100 watts dissipated in the cabinet. If the total power dissipated in the cabinet is greater than 800 watts, then forced convection must be used.
To prevent electrical shock, disconnect instrument from mains (line) before cleaning. Use a dry cloth or one slightly dampened with water to clean the external case parts. Do not attempt to clean internally.
Product Markings
CE - the CE mark is a registered trademark of the European Community. A CE mark accompanied by a year indicated the year the design was proven.
CSA - the CSA mark is a registered trademark of the Canadian Standards Association.
15

WARNING - RUBIDIUM REFERENCE ASSEMBLY (E6381A)

The optional Rubidium Reference assembly, A2A15, (OPTION AY5) of the Agilent Technologies 8935 Series E6381A TDMA Base Station Test Set contains the radioactive isotope Rubidium 87. DO NOT attempt to repair this assembly. This assembly contains no user serviceable parts. The Rubidium 87 is isolated inside a vacuum tube which is enclosed within a metal housing, and as a result, there is no measurable external radiation. The rubidium Reference assembly does not present any safety hazard. This assembly, for disposal purposes, is regulated as a hazardous waste and must be disposed of in accordance with local, state, and federal laws.
FOR GROUND TRANSPORTATION IN THE U.S.A:
This package conforms to the conditions and limitations specified in
49CFR 173.424 for radioactive material, excepted package – instruments, UN2910.
FOR AIR TRANSPORTATION IN THE U.S.A AND INTERNATIONAL:
This instrument must be shipped as cargo with the following endorsement in the nature and quantity of goods box on the air waybill, “Radioactive material, excepted package – instruments.”
Figure 1 Rubidium Transportation Labels
AUDIO OUT
AUDIO IN
HI
AUDIO MONITOR OUTPUT
ANT IN DUPLEX OUT
MODULATION
VIDEO
EXT SCOPE
INPUT
OUT
TRIG IN
HEWLETT-PACKARD CO. SPOKANE 24001 E. MISSION AVE. LIBERITY LAKE, WA. 99019
FOR U.S.A. GROUND TRANSPORTATION:
THIS PACKAGE CONFORMS TO THE CONDITIONS AND LIMITA­TIONS SPECIFIED IN 49CFR 173.424 FOR "RADIOACTIVE MATERIAL, EXCEPTED PACKAGE - INSTRUMENTS, UN 2910"
8935 TDMA
DIGITAL MUX OUT
CLK OUT
TRANSPORTATION LABEL
HEWLETT-PACKARD CO. SPOKANE 24001 E. MISSION AVE. LIBERTY LAKE, WA. 99019
FOR U.S.A. GROUND TRANSPORTATION:
THIS PACKAGE CONFORMS TO THE CONDITIONS AND LIMITA­TIONS SPECIFIED IN 49CFR 173.424 FOR "RADIOACTIVE MATERIAL, EXCEPTED PACKAGE - INSTRUMENTS, UN 2910"
FOR U.S.A. AND INTERNATIONAL AIR TRANSPORTATION:
THIS INSTRUMENT MUST BE SHIPPING AS CARGO WITH THE FOLLOWING ENDORSE­MENT IN THE NATURE AND QUANTITY OF GOODS BOX ON THE AIR WAYBILL "RADIO­ACTIVE MATERIAL, EXCEPTED PACKAGE-INSTRUMENTS"
LO
FOR U.S.A. AND INTERNATIONAL AIR TRANSPORTATION:
THIS INSTRUMENT MUST BE SHIPPING AS CARGO WITH THE FOLLOWING ENDORSE­MENT IN THE NATURE AND QUANTITY OF GOODS BOX ON THE AIR WAYBILL "RADIO­ACTIVE MATERIAL, EXCEPTED PACKAGE-INSTRUMENTS"
FRAME
TDMA REF IN
REF OUT
TDMA ANALYZER INPUTS
DATA CLOCK
TRIGGER
OPTIONAL
GENERATOR
CDPD
DATA IN
MOD OUT
10 MHz
SYNTH REF IN
Serial Number Label
TDMA OUTPUTS
WARNING
The optional Rubidium Reference assembly (OPTION AY5) contains the radioactive isotope Rubidium 87. For Test Sets with this option, there are strict transportation requirements. See transportation label on Test Set. Fines and penalties can results if the directions on the label are not followed. If the Test Set is upgraded with this option, you must place the transportation label on the Test Set. Failure to do so can result in fines and penalties. If the rubidium assembly is permanently removed from the Test Set, the transportation label must also be removed. Failure to remove the label when the rubidium assembly is removed can also result in fines and penalties.
SERIAL 9
PARALLEL 15
SERIAL 10
PARALLEL 16
SERIAL 11
RF IN/OUT
Option Label
003 = CDPD Option AY5 = Rubidium Option
labels.eps
16
O:\Manuals\E6380A_Progguid\Book\Preface.fm

Agilent Technologies Warranty Statement for Commercial Products

Product Name: E6380A/E6381A

Duration of Warranty: 1 year

1. Agilent Technologies warrants Agilent hardware, accessories and supplies against defects in materials and workmanship for the period specified above. If Agilent Technologies receives notice of such defects during the warranty period, Agilent will, at its option, either repair or replace products which prove to be defective. Replacement products may be either new or like-new.
2. Agilent Technologies warrants that Agilent software will not fail to execute its programming instructions, for the period specified above, due to defects in material and workmanship when properly installed and used. If Agilent Technologies receives notice of such defects during the warranty period, Agilent will replace software media which does not execute its programming instructions due to such defects.
3. Agilent Technologies does not warrant that the operation of Agilent products will be uninterrupted or error free. If Agilent Technologies is unable, within a reasonable time, to repair or replace any product to a condition as warranted, customer will be entitled to a refund of the purchase price upon prompt return of the product.
4. Agilent Technologies products may contain remanufactured parts equivalent to new in performance or may have been subject to incidental use.
5. The warranty period begins on the date of delivery or on the date of installation if installed by Agilent Technologies. If customer schedules or delays Agilent installation more than 30 days after delivery, warranty begins on the 31st day from delivery.
6. Warranty does not apply to defects resulting from (a) improper or inadequate maintenance or calibration, (b) software, interfacing, parts or supplies not supplied by Agilent Technologies, (c) unauthorized modification or misuse, (d) operation outside of the published environmental specifications for the product, or (e) improper site preparation or maintenance.
7. TO THE EXTENT ALLOWED BY LOCAL LAW, THE ABOVE WARRANTIES ARE EXCLUSIVE AND NO OTHER WARRANTYOR CONDITION, WHETHER WRITTEN OR ORAL IS EXPRESSED OR IMPLIED AND AGILENT TECHNOLOGIES SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OR CONDITIONS OR MERCHANTABILITY, SATISFACTORY QUALITY, AND FITNESS FOR A PARTICULAR PURPOSE.
17
8. Agilent Technologies will be liable for damage to tangible property per incident up to the greater of $300,000 or the actual amount paid for the product that is the subject of the claim, and for damages for bodily injury or death, to the extent that all such damages are determined by a court of competent jurisdiction to have been directly caused by a defective Agilent Technologies product.
9. TO THE EXTENT ALLOWED BY LOCAL LAW, THE REMEDIES
IN THIS WARRANTY STATEMENT ARE CUSTOMER’S SOLE AND EXCLUSIVE REMEDIES. EXCEPT AS INDICATED ABOVE, IN NO EVENT WILL AGILENT TECHNOLOGIES OR ITS SUPPLIERS BE LIABLE FOR LOSS OF DATA OR FOR DIRECT, SPECIAL, INCIDENTAL, CONSEQUENTIAL (INCLUDING LOST PROFIT OR DATA), OR OTHER DAMAGE, WHETHER BASED IN CONTRACT, TORT, OR OTHERWISE.
FOR CONSUMER TRANSACTIONS IN AUSTRALIA AND NEW ZEALAND: THE WARRANTY TERMS CONTAINED IN THIS STATEMENT, EXCEPT TO THE EXTENT LAWFULLY PERMITTED, DO NOT EXCLUDE RESTRICT OR MODIFY AND ARE IN ADDITION TO THE MANDATORY STATUTORY RIGHTS APPLICABLE TO THE SALE OF THIS PRODUCT TO YOU.

ASSISTANCE

Maintenance Agreements
Product maintenance agreements and other customer assistance agreements are available for Agilent Technologies products. For any assistance, contact your nearest Agilent Technologies Sales and Service Office.
18
O:\Manuals\E6380A_Progguid\Book\Preface.fm

Regional Sales Offices

Table 2 Regional Sales and Service Offices
United States of America: Agilent Technologies Test and Measurement Call Center P.O. Box 4026 Englewood, CO 80155-4026
(tel) 1 800 452 4844
Japan: Agilent Technologies Japan Ltd. Measurement Assistance Center 9-1 Takakura-Cho, Hachioji-Shi, Tokyo 192-8510, Japan
(tel) (81) 456-56-7832 (fax) (81) 426-56-7840
Asia Pacific: Agilent Technologies 24/F, Cityplaza One, 111 Kings Road, Taikoo Shing, Hong Kong
Canada: Agilent Technologies Canada Inc. 5150 Spectrum Way Mississauga, Ontario L4W 5G1
(tel) 1 877 894 4414
Latin America: Agilent Technologies Latin America Region Headquarters 5200 Blue Lagoon Drive, Suite #950 Miami, Florida 33126 U.S. A .
(tel) (305) 267 4245 (fax) (305) 267 4286
Europe: Agilent Technologies European Marketing Organization P.O. Box 999 1180 AZ Amstelveen The Netherlands
(tel) (3120) 547 9999
Australia/New Zealand: Agilent Technologies Australia Pty Ltd. 347 Burwood Highway Forest Hill, Victoria 3131
(tel) 1 800 629 485 (Australia) (fax) (61 3) 9272 0749 (tel) 0 800 738 378 (New Zealand) (fax) (64 4) 802 6881
(tel) (852) 3197 7777 (fax) (852) 2506 9233
19
20
O:\Manuals\E6380A_Progguid\Book\Preface.fm

1 Using HP-IB

21
Using HP-IB

Overview of the Test Set

Overview of the Test Set
The Test Set combines numerous separate test instruments and an
IBASIC controller into one package. All of the Test Set’s functions can be automatically controlled through application programs running on the built-in IBASIC controller or on an external controller connected through HP-IB.
Developing programs for the Test Set is simplified if the programmer has a basic understanding of how the Test Set operates. An overview of the Test Set’s operation is best presented in terms of how information flows through the unit. The simplified block diagrams shown in Figure
1-1 on page 28 and Figure 1-2 on page 29 depict how instrument
control information and measurement result information are routed among the Test Set’s instruments, instrument control hardware, built-in IBASIC controller, and other components.
The Test Set has two operating modes: Manual Control mode and Automatic Control mode. In Manual Control mode the Test Set’s operation is controlled through the front panel keypad/rotary knob. There are two Automatic Control modes: Internal and External. In Internal Automatic Control mode the Test Set’s operation is controlled by an application program running on the built-in IBASIC controller. In External Automatic Control mode the Test Set’s operation is controlled by an external controller connected to the Test Set through the HP-IB interface.
22 Chapter 1
O:\Manuals\E6380A_Progguid\Book\Usehpib.fm
Using HP-IB
Overview of the Test Set

Manual Control Mode

The Test Set’s primary instruments are shown on the left side of Figure
1-1 on page 28. There are two classes of instruments in the Test Set:
signal analyzers (RF Analyzer, AF Analyzer, Oscilloscope, Spectrum Analyzer) and signal sources (RF Generator, AF Generator #1, AF Generator #2).
Since so many instruments are integrated into the Test Set, it is not feasible to have an actual “front panel” for each instrument. Therefore, each instrument’s front panel is maintained in firmware and is displayed on the display whenever the instrument is selected. Only one instrument front panel can be displayed at any given time (up to four measurement results can be displayed simultaneously if desired). Just as with stand alone instruments, instrument front panels in the Test Set can contain instrument setting information, measurement result(s), or data input from the DUT (Device Under Test).
Using the Test Set in Manual Control mode is analogous to using a set of bench or rack-mounted test equipment. To obtain a measurement result with a bench or racked system, the desired measurement must be “active.” For example, if an RF power meter is in the bench or racked system and the user wishes to measure the power of an RF carrier they must turn the power meter on, and look at the front panel to see the measurement result. Other instruments in the system may be turned off but this would not prevent the operator from measuring the RF power.
Conceptually, the same is true for the Test Set. In order to make a measurement or input data from a DUT, the desired measurement field or data field must be “active.” This is done by using the front panel keypad/rotary knob to select the instrument whose front panel contains the desired measurement or data field and making sure that the desired measurement or data field is turned ON.
Figure 1-1 on page 28 shows that instrument selection is handled by
the screen control hardware which routes the selected instrument’s front panel to the display. Once an instrument’s front panel is displayed on the display, the user can manipulate the instrument settings, such as turning a specific measurement or data field on or off, using the keypad/rotary knob. Figure 1-1 also shows that instrument setup is handled by the Instrument Control hardware which routes setup information from the front panel to the individual instruments.
An HP-IB/RS-232/Parallel Printer interface is located in the Test Set. In Manual Control mode this provides the capability of connecting an external HP-IB, serial, or parallel printer to the Test Set so that display screens can be printed.
Chapter 1 23
Using HP-IB
Overview of the Test Set

Internal Automatic Control Mode

In Internal Automatic Control mode the Test Set’s operation is controlled by an application program running on the built-in IBASIC controller. The built-in controller runs programs written in Agilent Technologies Instrument BASIC (IBASIC), a subset of the BASIC programming language used on the HP 9000 Series 200/300 System Controllers. IBASIC is the only programming language supported on the built-in IBASIC controller.
Similarities Between the Test Set’s IBASIC Controller and Other Single-Tasking Controllers
The architecture of the IBASIC controller is similar to that of other single-tasking instrumentation controllers. Only one program can be run on the IBASIC controller at any given time. The program is loaded into RAM from some type of mass storage device. Four types of mass storage devices are available to the Test Set: SRAM PC cards, ROM memory cards connected to the HP-IB interface, and internal ROM and RAM. Three types of interfaces are available for connecting to external instruments and equipment: HP-IB, RS-232, and 16-bit parallel.
Figure 1-2 on page 29 shows how information is routed inside the Test
Set when it is in Internal Automatic Control mode. In Manual Control mode certain Test Set resources are dedicated to manual operation. These resources are switched to the IBASIC controller when an IBASIC program is running. These include the serial interface ports at select codes 9, 10, and 11, the HP-IB interface at select code 7, the parallel printer interface ports at select codes 15 and 16, and the display. In Manual Control mode, front panel information (instrument settings, measurement results, data input from the DUT) is routed to the display through the screen control hardware. In Internal Automatic Control mode the measurement results and data input from the DUT are routed to the IBASIC controller through a dedicated HP-IB interface. Also, in Internal Automatic Control mode, the display is dedicated to the IBASIC controller for program and graphics display. This means instrument front panels cannot be displayed on the display when an IBASIC program is running.
24 Chapter 1
O:\Manuals\E6380A_Progguid\Book\Usehpib.fm
Using HP-IB
Overview of the Test Set
Differences Between the Test Set’s IBASIC Controller and Other Single-Tasking Controllers
The IBASIC controller is unlike other single tasking instrumentation controllers in several ways. First, it does not have a keyboard. This imposes some limitations on creating and editing IBASIC programs
directly on the Test Set. In Internal Automatic Control mode a “virtual” keyboard is available in firmware which allows the operator to enter alphanumeric data into a dedicated input field using the rotary knob. This is not the recommended programming mode for the IBASIC controller. This feature is provided to allow user access to IBASIC programs for short edits or troubleshooting. Several programming modes for developing IBASIC programs to run on the internal IBASIC controller are discussed in this manual.
Secondly, the IBASIC controller has a dedicated HP-IB interface, select code 8 in Figure 1-2 on page 29, for communicating with the internal instruments of the Test Set. This HP-IB interface is only available to the IBASIC controller. There is no external connector for this HP-IB interface. No external instruments may be added to this HP-IB interface. The HP-IB interface, select code 7 in Figure 1-2, is used to interface the Test Set to external instruments or to an external controller. The dedicated HP-IB interface at select code 8 conforms to the IEEE 488.2 Standard in all respects but one. The difference being that each instrument on the bus does not have a unique address. The Instrument Control Hardware determines which instrument is being addressed through the command syntax. Refer to the HP-IB Syntax Reference Guide for a listing of the HP-IB command syntax for the Test Set.
Chapter 1 25
Using HP-IB
Overview of the Test Set

External Automatic Control Mode

In External Automatic Control mode the Test Set’s operation is controlled by an external controller connected to the Test Set through the HP-IB interface. When in External Automatic Control mode the Test Set’s internal configuration is the same as in Manual Control Mode with two exceptions:
1. Configuration and setup commands are received through the external HP-IB interface, select code 7, rather than from the front-panel keypad/rotary knob.
2. The MEASure command is used to obtain measurement results and DUT data through the external HP-IB interface.
Figure 1-1 on page 28 shows how information is routed inside the Test
Set in Manual Control mode. Figure 1-1 also shows that certain Test Set resources are dedicated to the IBASIC controller (PC Card, internal ROM, Serial Ports 10 and 11) and are not directly accessible to the user in Manual Control Mode. In addition, Figure 1-1 shows that Serial Port 9 and Parallel Printer Port 15 are accessible as write-only interfaces for printing in Manual Control mode. These same conditions are true when in External Automatic Control mode. If the user wished to access these resources from an external controller, an IBASIC program would have to be run on the Test Set from the external controller.
26 Chapter 1
O:\Manuals\E6380A_Progguid\Book\Usehpib.fm
Using HP-IB
Overview of the Test Set

Writing programs for the Test Set

One of the design goals for automatic control of the Test Set was that it operate the same way programmatically as it does manually. This is a key point to remember when developing programs for the Test Set. The benefit of this approach is that to automate a particular task, one need only figure out how to do the task manually and then duplicate the same process in software. This has several implications when designing and writing programs for the Test Set:
1. In Manual Control mode a measurement must be “active” in order to
obtain a measurement result or input data from the DUT. From a programming perspective this means that before attempting to read a measurement result or to input data from the DUT, the desired screen for the measurement result or data field must be selected using the DISPlay command and the field must be in the ON state.
2. In Manual Control mode instrument configuration information is not routed through the screen control hardware. From a programming perspective this means that configuration information can be sent to any desired instrument without having to first select the instrument’s front panel with the DISPlay command.
Keeping these points in mind during program development will minimize program development time and reduce problems encountered when running the program.
Chapter 1 27
Using HP-IB
Overview of the Test Set
Figure 1-1 Manual Control Mode
FRONT PANEL
SCREEN
CONTROL
HARDWARE
Display
KEY-
KNOB
PAD/ROTARY
FRONT
PANE L
INFORMA-
PC CARD
ROM
IBASIC
CONTROLLER
#8
HP - IB
WARE
INSTRUMENT
CONTROL HARD-
#11
SERIAL I/F
SERIAL I/F
INSTRUMENT
SETUP
INFORMA-
SERIAL I/F
#9
#10
#16
PRINTER
PRINTER
PARALLEL
PARALLEL
#7
#15
HP - IB
RF GEN
MEASUREMENT RESULTS AND DUT DATA
AF GEN #1
AF GEN #2
AF ANALYZER
ANALYZER
SPECTRUM
OSCILLOSCOPE
RF ANALYZER
28 Chapter 1
O:\Manuals\E6380A_Progguid\Book\Usehpib.fm
Figure 1-2 Internal Automatic Control Mode
Using HP-IB
Overview of the Test Set
FRONT PANEL
SCREEN
CONTROL
HARDWARE
Display
#9
#10
KEY-
KNOB
PAD/ROTARY
FRONT
PANE L
INFORMA-
PC CARD
ROM DISK
IBASIC
CONTROLLER
#8
HP - IB
WARE
INSTRUMENT
CONTROL HARD-
SERIAL I/F
#11
SERIAL I/F
SERIAL I/F
INSTRUMENT
SETUP
INFORMA-
#16
PRINTER
PRINTER
PARALLEL
PARALLEL
#15
#7
HP - IB
RF GEN
MEASUREMENT RESULTS AND DUT DATA
AF GEN #1
AF GEN #2
AF ANALYZER
ANALYZER
SPECTRUM
OSCILLOSCOPE
RF ANALYZER
Chapter 1 29
Using HP-IB

Getting Started

Getting Started

What is HP-IB?

The Hewlett-Packard Interface Bus (HP-IB) is a Hewlett-Packard implementation of the IEEE 488.1-1987 Standard Digital Interface for Programmable Instrumentation. Incorporation of the HP-IB into the Test Set provides several valuable capabilities:
• Programs running in the Test Set’s IBASIC controller can control all the Test Set’s functions using its internal HP-IB. This capability provides a single-instrument automated test system.
• Programs running in the Test Set’s IBASIC controller can control other instruments connected to the external HP-IB.
• An external controller, connected to the external HP-IB, can remotely control the Test Set.
• An HP-IB printer, connected to the external HP-IB, can be used to print test results and full screen images.
30 Chapter 1
O:\Manuals\E6380A_Progguid\Book\Usehpib.fm
Using HP-IB
Getting Started

HP-IB Information Provided in This Manual

What Is Explained
• How to configure the Test Set for HP-IB operation
• How to make an instrument setting over HP-IB
• How to read-back instrument settings over HP-IB
• How to make measurements over HP-IB
• How to connect external PCs, terminals or controllers to the Test Set
• HP-IB command syntax for the Test Set
• IBASIC program development
• IBASIC program transfer over HP-IB
• Various advanced functions such as, increasing measurement throughput, status reporting, error reporting, pass control, and so forth
What Is Not Explained
• HP-IB (IEEE 488.1, 488.2) theory of operation
• HP-IB electrical specifications
• HP-IB connector pin functions
1
1
1
• IBASIC programming (other than general guidelines related to
2
HP-IB)
1. Refer to the Tutorial Description of the Hewlett-Packard Interface Bus (HP P/N 5952-0156) for detailed information on HP-IB theory and operation.
2. Refer to the Agilent Technlolgies Instrument BASIC Users Handbook (Agilent part number E2083-90005) for more information on the IBASIC Version 2.0 lan­guage.
Chapter 1 31
Using HP-IB
Getting Started

General HP-IB Programming Guidelines

The following guidelines should be considered when developing programs which control the Test Set through HP-IB:
Guideline #1.
1. Bring the Test Set to its preset state using the front-panel PRESET key. This initial step allows you to start developing the measurement sequence with most fields in a known state.
2. Make the measurement manually using the front-panel controls of the Test Set. Record, in sequential order, the screens selected and the settings made within each screen. The record of the screens selected and settings made in each screen becomes the measurement procedure.
3. Record the measurement result(s).
4. Develop the program using the measurement procedure generated in step 2. Be sure to start the programmatic measurement sequence by bringing the Test Set to its preset state using the *RST Common Command. As the measurement procedure requires changing screens, use the DISPlay command to select the desired screen followed by the correct commands to set the desired field(s).
NOTE
NOTE
When IBASIC programs are running the display is dedicated to the IBASIC controller for program and graphics display. This means instrument front panels are not displayed when an IBASIC program is running. However, the DISPlay <screen> command causes all setting and measurement fields in the <screen> to be accessible programmatically. Attempting to read from a screen that has not been made accessible by the DISPlay command will cause
HP-IB Error: −420 Query UNTERMINATED, or HP-IB Error: −113 Undefined header
Make sure the desired measurement is in the ON state. This is the preset state for most measurements. However, if a previous program has set the state to OFF, the measurement will not be available. Attempting to read from a measurement field that is not in the ON state will cause HP-IB Error:−420 Query UNTERMINATED.
5. If the trigger mode has been changed, trigger a reading.
Triggering is set to FULL SETTling and REPetitive RETRiggering after receipt of the *RST Common Command. These settings cause the Test Set to trigger itself and a separate trigger command is not necessary.
32 Chapter 1
O:\Manuals\E6380A_Progguid\Book\Usehpib.fm
Using HP-IB
Getting Started
6. Send the MEASure query command to initiate a reading. This
will place the measured value into the Test Set’s Output Queue.
NOTE
When making AF Analyzer SINAD, Distortion, Signal to Noise Ratio, AF Frequency, DC Level, or Current measurements, the measurement type must first be selected using the SELect command. For example, MEAS:AFR:SEL'SINAD' followed by MEAS:AFR:SINAD?
7. Use the ENTER statement to transfer the measured value to a variable within the context of the program.
The following example program illustrates how to make settings and then take a reading from the Test Set. This setup takes a reading from the spectrum analyzer marker after tuning it to the RF generator’s output frequency.
Example 1-1 Example
10 Addr=714 20 OUTPUT Addr;"*RST" !Preset to known state 30 OUTPUT Addr;"TRIG:MODE:RETR SING" !Sets single trigger 40 OUTPUT Addr;"DISP RFG" !Selects the RF Gen screen 50 OUTPUT Addr;"AFG1:FM:STAT OFF" !Turns FM OFF 60 OUTPUT Addr;"RFG:AMPL -66 DBM" !Sets RF Gen ampl to -66 dBm 70 OUTPUT Addr;"RFG:FREQ 500 MHZ" !Sets RF Gen freq to 500 MHz 80 OUTPUT Addr;"RFG:AMPL:STAT ON" !Turns RF Gen output ON 90 OUTPUT Addr;"DISP SAN"!Selects Spectrum Analyzer’s screen
100 OUTPUT Addr;"SAN:CRF 500 MHZ" !Center Frequency 500 MHz 110 ! -------------------MEASUREMENT SEQUENCE------------------­120 OUTPUT Addr;"TRIG" !Triggers reading 130 OUTPUT Addr;"MEAS:SAN:MARK:LEV?" !Query of Spectrum 140 !Analyzer’s marker level 150 ENTER Addr;Lvl !Places measured value in variable Lvl 160 DISP Lvl!Displays value of Lvl
170 END
The RF Generator’s output port and the Spectrum Analyzer’s input port are preset to the RF IN/OUT port. This allows the Spectrum Analyzer to measure the RF Generator with no external connections. The Spectrum Analyzer marker is always tuned to the center frequency of the Spectrum Analyzer after preset. With the RF Generator’s output port and Spectrum Analyzer input port both directed to the RF IN/OUT port, the two will internally couple with 46 dB of gain, giving a measured value of approximately −20 dBm. While not a normal mode of operation this setup is convenient for demonstration since no external cables are required. This also illustrates the value of starting from the preset state since fewer programming commands are required.
Chapter 1 33
Using HP-IB
Getting Started
Guideline #2.
If the program stops or “hangs up” when trying to ENTER a measured value, it is most likely that the desired measurement field is not available. There are several reasons that can happen:
1. The screen where the measurement field is located has not been DISPlayed before querying the measurement field.
2. The measurement is not turned ON.
3. The squelch control is set too high. If a measurement is turned ON but is not available due to the Squelch setting, the measurement field contains four dashes (- - - -). This is a valid state. The Test Set is waiting for a signal of sufficient strength to unsquelch the receiver before making a measurement. If a measurement field which is squelched is queried the Test Set will wait indefinitely for the receiver to unsquelch and return a measured value.
4. The RF Analyzer’s Input Port is set to ANT (antenna) while trying to read TX power. TX power is not measurable with the Input Port set to ANT. The TX power measurement field will display four dashes (- - - -) indicating the measurement is unavailable.
5. The input signal to the Test Set is very unstable causing the Test Set to continuously autorange. This condition will be apparent if an attempt is made to make the measurement manually.
6. Trigger mode has been set to single trigger (TRIG:MODE:RETRig SINGle) and a new measurement cycle has not been triggered before attempting to read the measured value.
7. The program is attempting to make an FM deviation or AM depth measurement while in the RX TEST screen. FM or AM measurements are not available in the RX TEST screen. FM or AM measurements are made from the AF Analyzer screen by setting the AF Anl In field to FM or AM Demod.
34 Chapter 1
O:\Manuals\E6380A_Progguid\Book\Usehpib.fm
Guideline #3.
The syntax diagrams in the HP-IB Syntax Reference Guide show where single quotes are needed and where spaces are needed.
Example 1-2 Example
OUTPUT 714;"DISP<space>AFAN" OUTPUT 714;"AFAN:DEMP<space>’Off’"
Improper use of single quotes and spaces will cause, HP-IB Error: −103 Invalid Separator
Guideline #4.
When making settings to fields that can be turned OFF with the STATe ON/OFF command (refer to the HP-IB Syntax Reference Guide), make sure the STATe is ON if the program uses that field. Note that if the STATe is OFF, just setting a numeric value in the field will not change the STATe to ON. This is different than front-panel operation whereby the process of selecting the field and entering a value automatically sets the STATe to ON. Programmatically, fields must be explicitly set to the ON state if they are in the OFF state.
Using HP-IB
Getting Started
For example, the following command line would set a new AMPS ENCoder SAT tone deviation and then turn on the SAT tone (note the use of the; to back up one level in the command hierarchy so that more than one command can be executed in a single line):
Example 1-3 Example
OUTPUT 714;"ENC:AMPS:SAT:FM 2.1 KHZ;FM:STAT ON"
To just turn on the SAT tone without changing the current setting the following commands would be used:
Example 1-4 Example
OUTPUT 714;"ENC:AMPS:SAT:FM:STAT ON"
Chapter 1 35
Using HP-IB
Getting Started

Control Annunciators

The letters and symbols at the top right corner of the display indicate these conditions:
R indicates the Test Set is in remote mode. The Test Set can be put
into the remote mode by an external controller or by an IBASIC program running on the built-in IBASIC controller.
L indicates that the Test Set has been addressed to Listen.
T indicates that the Test Set has been addressed to Talk.
S indicates that the Test Set has sent the Require Service message
by setting the Service Request (SRQ) bus line true. (See “Status
Reporting” on page 121.)
C indicates that the Test Set is currently the Active Controller on the
bus.
* indicates that an IBASIC program is running.
? indicates that an IBASIC program is waiting for a user response.
• - indicates that an IBASIC program is paused.
36 Chapter 1
O:\Manuals\E6380A_Progguid\Book\Usehpib.fm
Using HP-IB
Getting Started

Preparing the Test Set For HP-IB Use

1. If other HP-IB devices are in the system, attach an HP-IB cable from
the Test Set’s HP-IB connector to any one of the other devices in the test system.
2. Access the I/O CONFIGURE screen and perform the following steps:
a. Set the Test Set’s HP-IB address using the HP-IB Adrs field. b. Set the Test Set’s HP-IB controller capability using the Mode field.
Talk&Listen configures the Test Set to not be the System
Controller. The Test Set has Active Controller capability (take control/pass control) in this mode. Use this setting if the Test Set will be controlled through HP-IB from an external controller.
Control configures the Test Set to be the System Controller.
Use this setting if the Test Set will be the only controller on the HP-IB. Selecting the Control mode automatically makes the Test Set the Active Controller.
NOTE
Only one System Controller can be configured in an HP-IB system. Refer to “Passing Control” on page 186 for further information.
3. If an HP-IB printer is or will be connected to the Test Set’s HP-IB connector then,
a. access the PRINT CONFIGURE screen. b. select one of the supported HP-IB printer models using the Model
field.
c. set the Printer Port field to HP-IB. d. set the printer address using the Printer Address field.
Chapter 1 37
Using HP-IB
Getting Started

Using the HP-IB with the Test Set’s built-in IBASIC Controller

The Test Set has two HP-IB interfaces, an internal-only HP-IB at select code 8 and an external HP-IB at select code 7. The HP-IB at select code 8 is only available to the built-in IBASIC controller and is used exclusively for communication between the IBASIC controller and the Test Set. The HP-IB at select code 7 serves three purposes:
1. It allows the Test Set to be controlled by an external controller
2. It allows the Test Set to print to an external HP-IB printer
3. It allows the built-in IBASIC controller to control external HP-IB devices
IBASIC programs running on the Test Set’s IBASIC controller must use the internal-only HP-IB at select code 8 to control the Test Set. IBASIC programs would use the external HP-IB at select code 7 to control HP-IB devices connected to the HP-IB connector.
NOTE
Refer to “Overview of the Test Set” on page 22 for a detailed explanation of the Test Set’s architecture.
When using a BASIC language Workstation with an HP-IB interface at select code 7 to control the Test Set, HP-IB commands would look like this:
Example 1-5 Example
! This command is sent to the Test Set at address 14. OUTPUT 714;"*RST" ! This command is sent to another instrument whose address is
19.
OUTPUT 719;"*RST"
When executing the same commands on the Test Set’s IBASIC controller, the commands would look like this:
Example 1-6 Example
OUTPUT 814;"*RST" ! Command sent to internal-only HP-IB at select code 8,
! Test Set’s address does not change OUTPUT 719;"*RST" ! Command sent to external HP-IB at select code 7, ! other instrument’s address does not change.
38 Chapter 1
O:\Manuals\E6380A_Progguid\Book\Usehpib.fm
Using HP-IB
Getting Started

Basic Programming Examples

The following simple examples illustrate the basic approach to controlling the Test Set through the HP-IB. The punctuation and command syntax used for these examples is given in the HP-IB Syntax Reference Guide.
The bus address 714 used in the following BASIC language examples assumes an HP-IB interface at select code 7, and a Test Set HP-IB address of 14. All examples assume an external controller is being used.
To Change a Field’s Setting over HP-IB
1. Use the DISPlay command to access the screen containing the field whose setting is to be changed.
2. Make the desired setting using the proper command syntax (refer to the HP-IB Syntax Reference Guide for proper syntax).
The following example makes several instrument setting changes:
Example 1-7 Example
OUTPUT 714;"DISP RFG" !Display the RF Generator screen. OUTPUT 714;"RFG:FREQ 850 MHZ" !Set the RF Gen Freq to 850 MHz. OUTPUT 714;"RFG:OUTP ’DUPL’"!Set the Output Port to Duplex. OUTPUT 714;"DISP AFAN"!Display the AF Analyzer screen.
OUTPUT 714;"AFAN:INP ’FM DEMOD’"!Set the AF Anl In to FM Demod.
Chapter 1 39
Using HP-IB
Getting Started
To Read a Field’s Setting over HP-IB
1. Use the DISPlay command to access the screen containing the field whose setting is to be read.
2. Use the Query form of the syntax for that field to place the setting
value into the Test Set’s output buffer.
3. Enter the value into the correct variable type within the program context (refer to the HP-IB Syntax Reference Guide, for proper variable type).
The following example reads several fields.
Example 1-8 Example
OUTPUT 714;"DISP AFAN"!Display the AF Analyzer screen. OUTPUT 714;"AFAN:INP?"!Query the AF Anl In field ENTER 714;Af_input$ !Enter returned value into a string ariable. OUTPUT 714;"DISP RFG"!Display the RF Generator screen OUTPUT 714;"RFG:FREQ?"!Query the RF Gen Frequency field.
NOTE
ENTER 714;Freq !Enter the returned value into a numeric variable
When querying measurements or settings through HP-IB, the Test Set always returns numeric values in HP-IB Units or Attribute Units, regardless of the current Display Units setting. Refer to “HP-IB Units
(UNITs)” on page 72 and “Attribute Units (AUNits)” on page 75 for
further information.
40 Chapter 1
O:\Manuals\E6380A_Progguid\Book\Usehpib.fm
To Make a Simple Measurement
The basic method for making a measurement is very similar to the method used to read a field setting.
1. Use the DISPlay command to access the screen containing the desired measurement.
2. Use the MEASure form of the syntax for that measurement to place
the measured value into the Test Set’s output buffer.
3. Enter the value into the correct variable type within the program context (refer to the HP-IB Syntax Reference Guide for proper variable type).
The following example measures the power of an RF signal.
Example 1-9 Example
!Display the RF Analyzer screen. OUTPUT 714;"DISP RFAN"
Using HP-IB
Getting Started
!Measure the RF power and place result in output buffer. OUTPUT 714;"MEAS:RFR:POW?" !Enter the measured value into a numeric variable. ENTER 714;Tx_power
The above example is very simple and is designed to demonstrate the fundamental procedure for obtaining a measurement result. Many other factors must be considered when designing a measurement procedure, such as instrument settings, signal routing, settling time, filtering, triggering and measurement speed.
Chapter 1 41
Using HP-IB

Remote Operation

Remote Operation
The Test Set can be operated remotely through the Hewlett-Packard Interface Bus (HP-IB). Except as otherwise noted, the Test Set complies with the IEEE
488.1-1987 and IEEE 488.2-1987 Standards. Bus compatibility, programming and data formats are described in the following sections.
All front-panel functions, except those listed in Table 1-1, are programmable through HP-IB.
Table 1-1 Non-Programmable Front Panel Functions
Function Comment
ON/OFF Power Switch
Vol ume Contr ol Knob
Squelch Control Knob The position of the squelch control knob cannot be
programmed. However squelch can be programmed to either the Open or Fixed position. Refer to the HP-IB Syntax Reference Guide for more information.
Cursor Control Knob
SHIFT Key
CANCEL Key
YES Key
NO Key
ENTER Key
Backspace (left-arrow) Key
PREV Key
HOLD (SHIFT, PREV Keys)
PRINT (SHIFT, TESTS Keys)
ADRS (SHIFT, LOCAL Keys)
ASSIGN (SHIFT, k4 Keys)
RELEASE (SHIFT, k5 Keys)
42 Chapter 1
O:\Manuals\E6380A_Progguid\Book\Usehpib.fm
Using HP-IB
Remote Operation

Remote Capabilities

Conformance to the IEEE 488.1-1987 Standard
For all IEEE 488.1 functions implemented, the Test Set adheres to the rules and procedures as outlined in that Standard.
Conformance to the IEEE 488.2-1987 Standard
For all IEEE 488.2 functions implemented, the Test Set adheres to the rules and procedures as outlined in that Standard with the exception of the *OPC Common Command. Refer to the *OPC Common Command description.
IEEE 488.1 Interface Functions
The interface functions that the Test Set implements are listed in Table
1-2.
Table 1-2 Test Set IEEE 488.1 Interface Function
Capabilities
Function Capability
Talker T6: No Talk Only Mode
Extended Talker T0: No Extended Talker Capability
Listener L4: No Listen Only Mode
Extended Listener LE0: No Extended Listener Capability
Source Handshake SH1: Complete Capability
Acceptor Handshake AH1: Complete Capability
Remote/Local RL1: Complete Capability
Service Request SR1: Complete Capability
Parallel Poll PP0: No Parallel Poll Capability
Device Clear DC1: Complete Capability
Device Trigger DT1: Complete Capability
Controller C1: System Controller
C3: Send REN C4: Respond to SRQ C11:No Pass Control to Self, No Parallel Poll
Drivers E2: Tri-State Drivers
Chapter 1 43
Using HP-IB

Addressing

Addressing

Factory Set Address

The Test Set’s HP-IB address is set to decimal 14 at the factory. The address can be changed by following the instructions in “Setting the
Test Set’s Bus Address” on page 44.

Extended Addressing

Extended addressing (secondary command) capability is not implemented in the Test Set.

Multiple Addressing

Multiple addressing capability is not implemented in the Test Set.

Setting the Test Set’s Bus Address

The Test Set’s HP-IB bus address is set using the HP-IB Adrs field which is located on the I/O CONFIGURE screen. To set the HP-IB bus address; select the I/O CONFIGURE screen and position the cursor next to the HP-IB Adrs field. The address can be set from decimal 0 to 30 using the numeric DATA keys, or by pushing and then rotating the Cursor Control knob. There are no DIP switches for setting the HP-IB bus address in the Test Set. The new setting is retained when the Test Set is turned off.

Displaying the Bus Address

The Test Set’s HP-IB bus address can be displayed by pressing and releasing the SHIFT key, then the LOCAL key. The address is displayed in the upper left-hand corner of the display screen.
44 Chapter 1
O:\Manuals\E6380A_Progguid\Book\Usehpib.fm

IEEE 488.1 Remote Interface Message Capabilities

IEEE 488.1 Remote Interface Message Capabilities
The remote interface message capabilities of the Test Set and the associated IEEE 488.1 messages and control lines are listed in Table
1-3.
Table 1-3 Test Set IEE 488.1 Interface Message Capability
Using HP-IB
Message Type
Data Yes All front-panel functions, except those listed
Remote Yes Remote programming mode is entered when
Local Yes The Test Set returns to local mode (full
Implemented Response IEEE 488.1
in Table 1-2 on page 43, are programmable. The Test Set can send status byte, message and setting information. All measurement
results (except dashed “- - - -” displays) and error messages are available through the bus.
the Remote Enable (REN) bus control line is true and the Test Set is addressed to listen. The R annunciator will appear in the upper-right corner of the display screen when the Test Set is in remote mode. All front-panel keys are disabled (except for the LOCAL key, POWER switch, Volume control and Squelch control knobs). When the Test Set enters remote mode the output signals and internal settings remain unchanged, except that triggering is reset to the state it was last set to in remote mode (Refer to “Triggering
Measurements” on page 105).
front-panel control) when either the Go To Local (GTL) bus command is received, the front-panel LOCAL key is pressed or the REN line goes false. When the Test Set returns to local mode the output signals and internal settings remain unchanged, except that triggering is reset to TRIG:MODE:SETT FULL;RETR REP. The LOCAL key will not function if the Test Set is in the local lockout mode.
Message
DAB END MTA MLA OTA
REN MLA
GTL MLA
Local Lockout
Yes Local Lockout disables all front-panel keys
including the LOCAL key. Only the System Controller or the POWER switch can return the Test Set to local mode (front-panel control).
Chapter 1 45
LLO
Using HP-IB
IEEE 488.1 Remote Interface Message Capabilities
Table 1-3 Test Set IEE 488.1 Interface Message Capability
Message
Implemented Response IEEE 488.1
Type
Clear Lockout/ Set Local
Yes The Test Set returns to local mode
(front-panel control) and local lockout is cleared when the REN bus control line goes false. When the Test Set returns to local mode the output signals and internal settings remain unchanged, except that triggering is set to TRIG:MODE:SETT FULL;RETR REP.
Service Request
Yes The Test Set sets the Service Request (SRQ)
bus line true if any of the enabled conditions in the Status Byte Register, as defined by the Service Request Enable Register, are true.
Status Byte Yes The Test Set responds to a Serial Poll Enable
(SPE) bus command by sending an 8-bit status byte when addressed to talk. Bit 6 will be true, logic 1, if the Test Set has sent the SRQ message
Status Bit No The Test Set does not have the capability to
respond to a Parallel Poll.
Message
REN
SRQ
SPE SPD STB MTA
PPE PPD PPU PPC IDY
Clear Yes This message clears the Input Buffer and
Output Queue, clears any commands in process, puts the Test Set into the Operation Complete idle state and prepares the Test Set to receive new commands. The Device Clear (DCL) or Selected Device Clear (SDC) bus commands
• do not change any settings or stored data (except as noted previously)
• do not interrupt front panel I/O or any Test Set operation in progress (except as noted previously)
• do not change the contents of the Status Byte Register (other than clearing the MAV bit as a consequence of clearing the Output Queue).
The Test Set responds equally to DCL or SDC bus commands.
DCL SDC MLA
46 Chapter 1
O:\Manuals\E6380A_Progguid\Book\Usehpib.fm
IEEE 488.1 Remote Interface Message Capabilities
Table 1-3 Test Set IEE 488.1 Interface Message Capability
Using HP-IB
Message Type
Trigger Yes If in remote programming mode and
Take Control Yes The Test Set begins to act as the Active
Abort Yes The Test Set stops talking and listening IFC
Implemented Response IEEE 488.1
Message
GET addressed to listen, the Test Set makes a triggered measurement following the trigger conditions currently in effect in the instrument. The Test Set responds equally to the Group Execute Trigger (GET) bus command or the *TRG Common Command.
Controller on the bus.
MLA
TCT
MTA
Chapter 1 47
Using HP-IB

Remote/Local Modes

Remote/Local Modes

Remote Mode

In Remote mode all front-panel keys are disabled (except for the LOCAL key, POWER switch, Volume control and Squelch control). The LOCAL key is only disabled by the Local Lockout bus command. When in Remote mode and addressed to Listen the Test Set responds to the Data, Remote, Local, Clear (SDC), and Trigger messages. When the Test Set is in Remote mode, the R annunciator will be displayed in the upper right corner of the display screen and triggering is set to the state it was last set to in Remote mode (if no previous setting, the default is FULL SETTling and REPetitive RETRiggering). When the Test Set is being addressed to Listen or Talk the L or T annunciators will be displayed in the upper-right corner of the display screen.

Local Mode

In Local mode the Test Set’s front-panel controls are fully operational. The Test Set uses FULL SETTling and REPetitive RETRiggering in Local mode. When the Test Set is being addressed to Listen or Talk the L or T annunciators will be displayed in the upper-right corner of the display screen.

Remote or Local Mode

When addressed to Talk in Remote or Local mode, the Test Set can issue the Data and Status Byte messages and respond to the Take Control message. In addition the Test Set can issue the Service Request Message (SRQ). Regardless of whether it is addressed to talk or listen, the Test Set will respond to the Clear (DCL), Local Lockout, Clear Lockout/Set Local, and Abort messages.
48 Chapter 1
O:\Manuals\E6380A_Progguid\Book\Usehpib.fm
Using HP-IB
Remote/Local Modes

Local To Remote Transitions

The Test Set switches from Local to Remote mode upon receipt of the Remote message (REN bus line true and Test Set is addressed to listen). No instrument settings are changed by the transition from Local to Remote mode, but triggering is set to the state it was last set to in Remote mode (if no previous setting, the default is FULL SETTling and REPetitive RETRiggering). The R annunciator in the upper-right corner of the display is turned on.
When the Test Set makes a transition from local to remote mode, all currently active measurements are flagged as invalid causing any currently available measurement results to become unavailable. If the HP-IB trigger mode is :RETR REP then a new measurement cycle is started and measurement results will be available for all active measurements when valid results have been obtained. If the HP-IB trigger mode is :RETR SING then a measurement cycle must be started by issuing a trigger event. Refer to “Triggering Measurements” on page
105 for more information.

Remote To Local Transitions

The Test Set switches from Remote to Local mode upon receipt of the Local message (Go To Local bus message is sent and Test Set is addressed to listen) or receipt of the Clear Lockout/Set Local message (REN bus line false). No instrument settings are changed by the transition from Remote to Local mode, but triggering is reset to FULL SETTling and REPetitive RETRiggering. The R annunciator in the upper right corner of the display is turned off.
If it is not in Local Lockout mode the Test Set switches from Remote to Local mode whenever the front-panel LOCAL key is pressed.
If the Test Set was in Local Lockout mode when the Local message was received, front-panel control is returned, but Local Lockout mode is not cleared. Unless the Test Set receives the Clear Lockout/Set Local message, the Test Set will still be in Local Lockout mode the next time it goes to the Remote mode.
Chapter 1 49
Using HP-IB
Remote/Local Modes

Local Lockout

The Local Lockout mode disables the front-panel LOCAL key and allows return to Local mode only by commands from the System Controller (Clear Lockout/Set Local message).
When a data transmission to the Test Set is interrupted, which can happen if the LOCAL key is pressed, the data being transmitted may be lost. This can leave the Test Set in an unknown state. The Local Lockout mode prevents loss of data or system control due to someone unintentionally pressing front-panel keys.
NOTE
Return to Local mode can also be accomplished by setting the POWER switch to OFF and back to ON. However, returning to Local mode in this way has the following disadvantages:
1. It defeats the purpose of the Local Lockout mode in that the Active Controller will lose control of the test set.
2. Instrument configuration is reset to the power up condition thereby losing the instrument configuration set by the Active Controller.

Clear Lockout/Set Local

The Test Set returns to Local mode when it receives the Clear Lockout/Set Local message. No instrument settings are changed by the transition from Remote mode with Local Lockout to Local mode but triggering is reset to FULL SETTling and REPetitive RETRiggering.
50 Chapter 1
O:\Manuals\E6380A_Progguid\Book\Usehpib.fm
2 Methods For Reading
Measurement Results
51
Methods For Reading Measurement Results

Background

Background
One of the most common remote user interface operations performed on an Test Set is to query and read a measurement result. Generally, this operation is accomplished by sending the query command to the Test Set, followed immediately by a request to read the requested measurement result. Using the Agilent Technologies Rocky Mountain BASIC (RMB) language, this operation would be written using the OUTPUT and ENTER command as follows:
Example 2-1 Query Example
OUTPUT 714;"MEAS:RFR:POW?" ENTER 714;Power
Using this programming structure, the control program will stay on the ENTER statement until it is satisfied - that is - until the Test Set has returned the requested measurement result. This structure works correctly as long as the Test Set returns a valid measurement result. If, for some reason, the Test Set does not return a measurement result, the
control program becomes “hung” on the ENTER statement and program execution effectively stops.
In order to prevent the control program from becoming “hung” programmers usually enclose the operation with some form of time-out function. The form of the time-out will of course depend upon the programming language being used. The purpose of the time-out is to specify a fixed amount of time that the control program will wait for the Test Set to return the requested result. After this time has expired the control program will abandon the ENTER statement and try to take some corrective action to regain control of the Test Set.
If the control program does not send the proper commands in the proper sequence when trying to regain control of the Test Set, unexpected operation will result. When this condition is encountered, power must be cycled on the Test Set to regain control.
This situation can be avoided entirely by:
1. sending a Selected Device Clear (SDC) interface message to put the Test Set’s HP-IB subsystem into a known state.
2. sending a command to terminate the requested measurement cycle.
These commands issued in this order will allow the control program to regain control of the Test Set. Any other sequence of commands will result in unexpected operation.
52 Chapter 2
O:\Manuals\E6380A_Progguid\Book\Measrslt.fm
Methods For Reading Measurement Results
Background
The following programs demonstrate a recommended technique for querying and entering data from the Test Set. This technique will
prevent the Test Set from getting into a ‘hung’ state such that power must be cycled on the Test Set to regain manual or programmatic control.
There are a variety of programming constructs which can be used to implement this technique. In the programming examples presented, a function call is implemented which returns a numeric measurement result. The function call has two pass parameters; the query command (passed as a quoted string) and a time-out value (passed as a integer number).
The time-out value represents how long you want to wait, in seconds, for the Test Set to return a valid measurement result. If a valid measurement result is not returned by the Test Set within the time-out value, the function returns a very large number. The calling program can check the value and take appropriate action.
The program examples are written so as to be self-explanatory. In practice, the length of: variable names, line labels, function names, etc., will be implementation dependent.
Chapter 2 53
Methods For Reading Measurement Results

RMB ‘ON TIMEOUT’ Example Program

RMB ‘ON TIMEOUT’ Example Program
The following example program demonstrates a recommended technique which can be utilized in situations where a measurement result time-out value of 32.767 seconds or less is adequate. In the RMB language, the time-out parameter for the ON TIMEOUT command has a maximum value of 32.767 seconds. If a time-out value of greater than
32.767 seconds is required refer to the “RMB ‘MAV’ Example Program”
on page 58.
The measurement result time-out value is defined to mean the amount of time the control program is willing to wait for the Test Set to return a valid measurement result to the control program.
Lines 10 through 230 in this example set up a measurement situation to demonstrate the use of the recommended technique. The recommended technique is exampled in the Measure Function.
NOTE
Lines 50 and 60 should be included in the beginning of all control programs. These lines are required to ensure that the Test Set is properly reset. This covers the case where the program was previously run and was stopped with the Test Set in an error condition.
54 Chapter 2
O:\Manuals\E6380A_Progguid\Book\Measrslt.fm
Example 2-2 Time-out Example
10 COM /Io_names/ INTEGER Inst_addr,Bus_addr 20 CLEAR SCREEN 30 Inst_addr=714 40 Bus_addr=7 50 CLEAR Inst_addr 60 OUTPUT Inst_addr;"TRIG:ABORT" 70 OUTPUT Inst_addr;"*RST" 80 OUTPUT Inst_addr;"DISP RFAN" 90 ! 100 ! Execute a call to the Measure function with a request to measure RF 110 ! power. The time out value is specified as 10 seconds. The value 120 ! returned by the function is assigned to the variable Measure_result. 130 ! 140 Measure_result=FNMeasure("MEAS:RFR:POW?",10) 150 ! 160 ! Check the result of the function call. 170 ! 180 IF Measure_result=9.E+99 THEN 190 PRINT "Measurement failed." 200 ELSE 210 PRINT "Power = ";Measure_result 220 END IF 230 END 240 !*********************************************************** 250 ! Recommended Technique: 260 !*********************************************************** 270 DEF FNMeasure(Query_command$,Time_out_value) 280 COM /Io_names/ INTEGER Inst_addr,Bus_addr 290 DISABLE 300 ON TIMEOUT Bus_addr,Time_out_value RECOVER Timed_out 310 OUTPUT Inst_addr;"TRIG:MODE:RETR SING;:TRIG:IMM" 320 OUTPUT Inst_addr;Query_command$ 330 ENTER Inst_addr;Result 340 OUTPUT Inst_addr;"TRIG:MODE:RETR REP" 350 ENABLE 360 RETURN Result 370 Timed_out:! 380 ON TIMEOUT Bus_addr,Time_out_value GOTO Cannot_recover 390 CLEAR Inst_addr 400 OUTPUT Inst_addr;"TRIG:ABORT;MODE:RETR REP" 410 ENABLE 420 RETURN 9.E+99 430 Cannot_recover:! 440 DISP "Cannot regain control of Test Set." 450 STOP
460 FNEND
Methods For Reading Measurement Results
RMB ‘ON TIMEOUT’ Example Program
Chapter 2 55
Methods For Reading Measurement Results
RMB ‘ON TIMEOUT’ Example Program

Comments for Recommended Routine

Table 2-1
Program Line Number
50 Send a Selected Device Clear (SDC) to the Test Set to put
60 Command the Test Set to abort the currently executing
290 Turn event initiated branches off (except ON END, ON
300 Set up a time-out for any I/O activity on the HP-IB. This
310 Set the triggering mode to single followed by a trigger
Comments
the HP-IB subsystem into a known state. This allows the control program to regain programmatic control of the Test Set if it is in an error state when the program begins to run.
measurement cycle. This will force the Test Set to stop waiting for any measurement results to be available from measurements which may be in an invalid state when the program begins to run.
ERROR and ON TIMEOUT) to ensure that the Measure function will not be exited until it is finished.
will allow the function to recover if the bus hangs for any reason.
immediate command. This ensures that a new measurement cycle will be started when the TRIG:IMM command is sent. This sequence, that is: set to single trigger and then send a trigger command, guarantees that the measurement result returned to the ENTER statement will accurately reflect the state of the DUT when the TRIG:IMM command was sent. The ’IMM’ keyword is optional.
320 Send the query command passed to the Measure function
to the Test Set.
330 Read the measurement result.
340 Set the trigger mode to repetitive retriggering. Setting the
trigger mode to repetitive will be implementation dependent.
350 Re-enable event initiated branching. If any event initiated
branches were logged while the Measure function was executing they will be executed when system priority permits.
360 Exit the Measure function and return the result value.
370 The following lines of code handle the case where the
request for a measurement result has timed out.
56 Chapter 2
O:\Manuals\E6380A_Progguid\Book\Measrslt.fm
Table 2-1
Methods For Reading Measurement Results
RMB ‘ON TIMEOUT’ Example Program
Program Line Number
380 Set up a time-out for any I/O activity on the HP-IB while
390 Send a Selected Device Clear (SDC) to the Test Set to put
400 Command the Test Set to abort the currently executing
410 Re-enable event initiated branching. If any event initiated
Comments
the control program is trying to regain control of the Test Set. This will allow the function to gracefully stop program execution if the control program cannot regain control of the Test Set. This time-out should only occur if there is some type of hardware failure, either in the Test Set or the external controller, which prevents them from communicating via HP-IB.
the HP-IB subsystem into a known state. This allows the control program to regain programmatic control of the Test Set.
measurement cycle. Set the trigger mode back to repetitive retriggering. Setting the Test Set back to repetitive retriggering will be implementation dependent.
branches were logged while the Measure function was executing they will be executed when system priority permits.
420 Exit the Measure function and return a result value of
9.E+99.
430 The following lines of code handle the case where the
control program cannot regain control of the Test Set. The actions taken in this section of the code will be implementation dependent. For the example case a message is displayed to the operator and the program is stopped.
440 Display a message to the operator that the control
program cannot regain control of the Test Set.
450 Stop execution of the control program.
Chapter 2 57
Methods For Reading Measurement Results

RMB ‘MAV’ Example Program

RMB ‘MAV’ Example Program
The following RMB example program demonstrates a technique that can be used in situations where a 32.767 measurement result time-out value is not adequate.
Measurement result time-out value is defined to mean the amount of time the control program is willing to wait for the Test Set to return a valid measurement result to the control program.
The technique uses the MAV (Message Available) bit in the Test Set’s HP-IB Status Byte to determine when there is data in the Output Queue. A polling loop is used to query the Status byte. The time-out duration for returning the measurement result is handled by the polling loop. An HP-IB interface activity time-out is also set up to handle time-outs resulting from problems with the HP-IB interface.
Lines 10 through 230 in this example set up a measurement situation to demonstrate the use of the recommended technique. The recommended technique is exampled in the Measure Function.
NOTE
Lines 50 and 60 should be included in the beginning of all control program. These lines are required to ensure that the Test Set is properly reset. This covers the case where the program was previously run and was stopped with the Test Set in an error condition.
58 Chapter 2
O:\Manuals\E6380A_Progguid\Book\Measrslt.fm
Example 2-3 MAV Example
10 COM /Io_names/ INTEGER Inst_addr,Bus_addr 20 CLEAR SCREEN 30 Inst_addr=714 40 Bus_addr=7 50 CLEAR Inst_addr 60 OUTPUT Inst_addr;"TRIG:ABORT" 70 OUTPUT Inst_addr;"*RST" 80 OUTPUT Inst_addr;"DISP RFAN" 90 ! 100 ! Execute a call to the Measure function with a request to measure RF 110 ! power. The time out value is specified as 50 seconds. The value 120 ! returned by the function is assigned to the variable Measure_result. 130 ! 140 Measure_result=FNMeasure("MEAS:RFR:POW?",50) 150 ! 160 ! Check the result of the function call. 170 ! 180 IF Measure_result=9.E+99 THEN 190 PRINT "Measurement failed." 200 ELSE 210 PRINT "Power = ";Measure_result 220 END IF 230 END 240 !*********************************************************** 250 ! Recommended Technique: 260 !*********************************************************** 270 DEF FNMeasure(Query_command$,Time_out_value) 280 COM /Io_names/ INTEGER Inst_addr,Bus_addr 290 DISABLE 300 ON TIMEOUT Bus_addr,5 GOTO Timed_out 310 OUTPUT Inst_addr;"TRIG:MODE:RETR SING;:TRIG:IMM" 320 OUTPUT Inst_addr;Query_command$ 330 Start_time=TIMEDATE 340 REPEAT 350 WAIT .1 360 Status_byte=SPOLL(Inst_addr) 370 IF BIT(Status_byte,4) THEN 380 ENTER Inst_addr;Result 390 OUTPUT Inst_addr;"TRIG:MODE:RETR REP" 400 ENABLE 410 RETURN Result 420 END IF 430 UNTIL TIMEDATE-Start_time>=Time_out_value 440 Timed_out:! 450 ON TIMEOUT Bus_addr,5 GOTO Cannot_recover 460 CLEAR Inst_addr 470 OUTPUT Inst_addr;"TRIG:ABORT;MODE:RETR REP" 480 RETURN 9.E+99 490 Cannot_recover: ! 500 DISP "Cannot regain control of Test Set." 510 STOP 520 FNEND
Methods For Reading Measurement Results
RMB ‘MAV’ Example Program
Chapter 2 59
Methods For Reading Measurement Results
RMB ‘MAV’ Example Program

Comments for Recommended Routine

Table 2-2 Comments for Measure Function from MAV
Example Program
Program Line Number
50 Send a Selected Device Clear (SDC) to the Test Set to put the
60 Command the Test Set to abort the currently executing
290 Turn event initiated branches off (except ON END, ON
300 Set up a 5 second time-out for any I/O activity on the HP-IB.
310 Set the triggering mode to single followed by a trigger
Comments
HP-IB subsystem into a known state. This allows the control program to regain programmatic control of the Test Set if it is in an error state when the program begins to run.
measurement cycle. This will force the Test Set to stop waiting for any measurement results to be available from measurements which may be in an invalid state when the program begins to run.
ERROR and ON TIMEOUT) to ensure that the Measure function will not be exited until it is finished.
This will allow the function to recover if the bus hangs for any reason. The length of the time-out will be implementation dependent.
immediate command. This ensures that a new measurement cycle will be started when the TRIG:IMM command is sent. This sequence, that is: set to single trigger and then send trigger command, guarantees that the measurement result returned to the ENTER statement will accurately reflect the state of the DUT when the TRIG:IMM command was sent. The ’IMM’ keyword is optional.
320 Send the query command passed to the Measure function to
the Test Set.
330 Establish a start time against which to compare the
measurement result time-out value passed to the Measure function.
340 Start the status byte polling loop.
350 Allow the Test Set some time (100 milliseconds) to process the
measurement. When polling the Test Set the polling loop must give the Test Set time to process the requested measurement. Since HP-IB command processing has a higher system priority within the Test Set than measurement functions, constantly sending HP-IB commands will result in longer measurement times.
60 Chapter 2
O:\Manuals\E6380A_Progguid\Book\Measrslt.fm
Methods For Reading Measurement Results
RMB ‘MAV’ Example Program
Table 2-2 Comments for Measure Function from MAV
Example Program
Program Line Number
360 Perform a serial poll to read the Status Byte from the Test Set.
370 Check bit 4, the Message Available bit (MAV), to see if it is set
380 Read the measurement result.
390 Set the trigger mode to repetitive retriggering. Setting the
400 Re-enable event initiated branching. If any event initiated
410 Exit the Measure function and return the result value.
430 Check to see if the measurement result time out value has
Comments
A serial poll is used because the *STB Common Command cannot be processed by the Test Set while a query is pending. Sending the *STB command will cause an ’HP-IB Error: -410 Query INTERRUPTED’ error.
to ’1’. If it is, then the requested measurement result is ready.
trigger mode to repetitive will be implementation dependent.
branches were logged while the Measure function was executing they will be executed when system priority permits.
been equaled or exceeded. If it has the polling loop will be exited.
440 The following lines of code handle the case where the request
for a measurement result has timed out because the polling loop has completed with no result available.
450 Set up a time-out for any I/O activity on the HP-IB while the
control program is trying to regain control of the Test Set. This will allow the function to gracefully stop program execution if the control program cannot regain control of the Test Set. This time-out should only occur if there is some type of hardware failure, either in the Test Set or the external controller, which prevents them from communicating via HP-IB.
460 Send a Selected Device Clear (SDC) to the Test Set to put the
HP-IB subsystem into a known state. This allows the control program to regain programmatic control of the Test Set.
470 Command the Test Set to abort the currently executing
measurement cycle. Set the trigger mode back to repetitive retriggering. Setting the Test Set back to repetitive retriggering will be implementation dependent.
480 Exit the Measure function and return a result value of 9.E+99.
Chapter 2 61
Methods For Reading Measurement Results
RMB ‘MAV’ Example Program
Table 2-2 Comments for Measure Function from MAV
Example Program
Program
Comments Line Number
490 The following lines of code handle the case where the control
program cannot regain control of the Test Set. The actions
taken in this section of the code will be implementation
dependent. For the example case a message is displayed to the
operator and the program is stopped.
500 Display a message to the operator that the control program
cannot regain control of the Test Set.
510 Stop execution of the control program.
62 Chapter 2
O:\Manuals\E6380A_Progguid\Book\Measrslt.fm

3 HP-IB Command Guidelines

63
HP-IB Command Guidelines

Sequential and Overlapped Commands

Sequential and Overlapped Commands
IEEE 488.2 makes the distinction between sequential and overlapped commands. Sequential commands complete their task before execution of the next command can begin. Overlapped commands can run concurrently, that is, a command following an overlapped command may begin execution while the overlapped command is still in progress. All commands in the Test Set are sequential.
The processing architecture of the Test Set allows it to accept commands through the HP-IB while it is executing commands already parsed into its command buffer. While this may appear to be overlapped, commands are always executed sequentially in the order received.
The process of executing a command can be divided into three steps:
1. Command is accepted from HP-IB and checked for proper structure and parameters.
2. Commands is sent to instrument hardware.
3. Instrument hardware fully responds after some time, Dt.
For example, in programming the Test Set’s RF Signal Generator it takes < 150 ms after receipt of the frequency setting command for the output signal to be within 100 Hz of the desired frequency. In the Test Set, commands are considered to have “completed their task” at the end of step 2. In manual operation all displayed measurement results take into account the instrument hardware’s response time. When programming measurements through HP-IB the Triggering mode selected will determine whether the instrument’s response time is accounted for automatically or if the control program must account for it. Refer to “Triggering Measurements” on page 105 for a discussion of the different Trigger modes available in the Test Set and their affect on measurement results.
64 Chapter 3
O:\Manuals\E6380A_Progguid\Book\Guidelin.fm

Guidelines for Operation

The following topics discuss rules and guidelines for controlling the Test Set through HP-IB.

Command Names

All command names of more than four characters have an alternate abbreviated form using only upper case letters and, in some cases, a single numeral. The commands are not case sensitive. Upper and lower case characters can be used for all commands.
For example, to set the destination of AF Generator 1 to Audio Out, any of the following command strings are valid:
Example 3-1 Example
AFGENERATOR1:DESTINATION ’AUDIO OUT’
HP-IB Command Guidelines
Guidelines for Operation
NOTE
or afgenerator1:destination ’audio out’ or afg1:dest ’audio out’ or AFG1:DEST ’AUDIO OUT’ or Afg1:Dest ’Audio oUT’

Command Punctuation

Programming Language Considerations
The punctuation rules for the Test Set’s HP-IB commands conform to the IEEE 488.2 standard. It is possible that some programming languages used on external controllers may not accept some of the punctuation requirements. It is therefore necessary that the equivalent form of the correct punctuation, as defined by the language, be used for HP-IB operation. Improper punctuation will results in
. HP-IB Error: -102 Syntax Error
Chapter 3 65
HP-IB Command Guidelines
Guidelines for Operation
Using Quotes for String Entries
Quotation marks ’ and " are used to select a non-numeric field setting. The value is entered into the command line as a quoted alphanumeric string.
Quotes are used with all Underlined (toggling) and One-of-many (menu choice) fields.
For example, to set the RF Generator’s Output Port field to Dupl (duplex), the Dupl would be entered into the command string.
Example 3-2 Example
RFG:OUTP ’Dupl’ or RFG:OUTP "Dupl"
Using Spaces
When changing a field’s setting, a space must always precede the setting value in the command string, regardless of the field type (command<space>value).
Example 3-3 Example
RFG:FREQ<space>850MHZ RFG:ATT<space>’OFF’
Using Colons to Separate Commands
The HP-IB command syntax is structured using a control hierarchy that is analogous to manual operation.
The control hierarchy for making a manual instrument setting using the front-panel controls is as follows: first the screen is accessed, then the desired field is selected, then the appropriate setting is made. HP-IB commands use the same hierarchy. The colon (:) is used to separate the different levels of the command hierarchy.
For example, to set the AF Analyzer input gain to 40 dB, the following command syntax would be used:
66 Chapter 3
O:\Manuals\E6380A_Progguid\Book\Guidelin.fm
Example 3-4 Example
DISP AFAN AFAN:INP:GAIN ’40 dB’
Using the Semicolon to Output Multiple Commands
Multiple commands can be output from one program line by separating
the commands with a semicolon (;). The semicolon tells the Test Set’s HP-IB command parser to back up one level of hierarchy and accept the next command at the same level as the previous command.
For example, on one command line, it is possible to
1. access the AF ANALYZER screen,
2. set the AF Analyzer’s Input to AM Demod
3. set Filter 1 to 300 Hz HPF
4. set Filter 2 to 3kHz LPF
HP-IB Command Guidelines
Guidelines for Operation
Example 3-5 Example
DISP AFAN;AFAN:INP ’AM DEMOD’;FILT1 ’300Hz HPF’;FILT2 ’3kHz LPF’
The semicolon after the “DISP AFAN” command tells the Test Set’s HP-IB command parser that the next command is at the same level in the command hierarchy as the display command. Similarly, the semicolon after the INP 'AM DEMOD' command tells the command parser that the next command (FILT1 '300Hz HPF') is at the same command level as the INP 'AM DEMOD' command.
Using the Semicolon and Colon to Output Multiple Commands
A semicolon followed by a colon (;:) tells the HP-IB command parser that the next command is at the top level of the command hierarchy. This allows commands from different instruments to be output on one command line. The following example sets the RF Analyzer’s tune frequency to 850 MHz, and then sets the AF Analyzer’s input to FM Demod.
Chapter 3 67
HP-IB Command Guidelines
Guidelines for Operation
Example 3-6 Example
RFAN:FREQ 850MHZ;:AFAN:INP ’FM DEMOD’
Using Question Marks to Query Setting or Measurement Fields
The question mark (?) is used to query (read-back) an instrument setting or measurement value. To generate the query form of a command, place the question mark immediately after the command. Queried information must be read into the proper variable type within the program context before it can be displayed, printed, or used as a numeric value in the program.
Queried information is returned in the same format used to set the value: queried numeric fields return numeric data; quoted string fields return quoted string information.
For example, the following BASIC language program statements query the current setting of the AFGen 1 To field:
Example 3-7 Example
NOTE
!Query the AFGen1 To field OUTPUT 714;"AFG1:DEST?" !Enter queried value into a string variable. ENTER 714;Afg1_to$

Specifying Units-of-Measure for Settings and Measurement Results

Numeric settings and measurement results in the Test Set can be displayed using one or more units-of-measure (V, mV, µV, Hz , k Hz ,
MHz…). When operating the Test Set manually, the units-of-measure can be easily changed to display measurement results and field settings in the most convenient format. HP-IB operation is similar to manual operation in that the units-of-measure used to display numeric data can be programmatically changed to the most convenient form.
When querying measurements or settings through HP-IB, the Test Set always returns numeric values in HP-IB Units or Attribute Units, regardless of the current Display Units setting. Refer to “HP-IB Units
(UNITs)” on page 72 and “Attribute Units (AUNits)” on page 75 for
further information.
There are three sets of units-of-measure used in the Test Set: Display Units, HP-IB Units, and Attribute Units. Writing correct HP-IB programs requires an understanding of how the Test Set deals with these different sets of units-of-measure.
68 Chapter 3
O:\Manuals\E6380A_Progguid\Book\Guidelin.fm
HP-IB Command Guidelines
Guidelines for Operation
Display Units (DUNits)
Display Units are the units-of-measure used by the Test Set to display numeric data (field settings and measurement results) on the front-panel CRT display. For example, the RF Generator’s frequency
can be displayed in Hz, kHz, MHz and GHz. Similarly, the measured TX Frequency can be displayed in Hz, kHz, MHz and GHz.
When evaluating an entered value for a numeric field, the Test Set interprets the data it receives in terms of the Display Units currently set. For example, if the Display Units for the RF Gen Freq field are set to GHz and the operator tries to enter 500 into the field, an Input value out of range error is generated since the Test Set interpreted the value as 500 GHz which is outside the valid frequency range of the Test Set.
Changing Display Units Use the DUNits command to change the units-of-measure used by the Test Set to display any field setting or measurement result. For example, to change the Display Units setting for the TX Power measurement field from W to dBm, the following command would be used:
Example 3-8 Example
MEAS:RFR:POW:DUN DBM
Example 3-9 GHz
:MEAS:RFR:FREQ:ABS:DUN GHZ
Example 3-10 MHz
:MEAS:RFR:FREQ:ABS:DUN MHZ
Example 3-11 kHz
:MEAS:RFR:FREQ:ABS:DUN KHZ
Example 3-12 Hz
:MEAS:RFR:FREQ:ABS:DUN HZ
Example 3-13 ppm
:MEAS:RFR:FREQ:ERR:DUN PPM
Example 3-14 %D
:MEAS:RFR:FREQ:ERR:DUN PCTDIFF
Example 3-15 V
:MEAS:RFR:POW:DUN V
Chapter 3 69
HP-IB Command Guidelines
Guidelines for Operation
Example 3-16 mV
:MEAS:RFR:POW:DUN MV
Example 3-17
V
µ
:RFG:AMPL:DUN µV
Example 3-18 dBµV
:RFG:AMPL:DUN DBµV
Example 3-19 W
:MEAS:RFR:POW:DUN W
Example 3-20 mW
:MEAS:RFR:POW:DUN MW
Example 3-21 dBm
:MEAS:RFR:POW:DUN DBM
Example 3-22 db
:MEAS:AFR:DISTN:DUN DB
Example 3-23 %
:MEAS:AFR:DISTN:DUN PCT
Example 3-24 s
:DEC:FGEN:GATE:DUN S
Example 3-25 ms
:DEC:FGEN:GATE:DUN MS
Reading Back Display Units Setting Use the Display Units query command, DUNits?, to read back the current Display Units setting. For example, the following BASIC language program statements query the current Display Units setting for the TX Power measurement:
70 Chapter 3
O:\Manuals\E6380A_Progguid\Book\Guidelin.fm
Example 3-26 Example
!Query Display Units setting for TX Power measurement. OUTPUT 714;"MEAS:RFR:POW:DUNits?" !Enter the returned value into a string variable. ENTER 714;A$
The returned units-of-measure will be whatever is shown on the Test
Set’s front-panel display for the TX Power measurement: dBm, V, mV, dBuV, or W. All returned characters are in upper case. For example, if dBuV is displayed, DBUV is returned.
Guidelines for Display Units
• When querying a field’s setting or measurement result through HP-IB, the Test Set always returns numeric values in HP-IB Units or Attribute Units, regardless of the field’s current Display Units setting.
• The Display Units for a field’s setting or measurement result can be set to any valid unit-of-measure, regardless of the field’s HP-IB Units or Attribute Units.
HP-IB Command Guidelines
Guidelines for Operation
• The Display Units setting for a field’s setting is not affected when changing the field’s value through HP-IB.
For example, if the AFGen1 Freq Display Units are set to kHz, and the command AFG1:FREQ 10 HZ is sent to change AFGen1’s frequency to 10 Hz, the Test Set displays 0.0100 kHz; not 10 Hz.
Chapter 3 71
HP-IB Command Guidelines
Guidelines for Operation
HP-IB Units (UNITs)
HP-IB Units are the units-of-measure used by the Test Set when sending numeric data (field settings and measurement results) through HP-IB, and the default units-of-measure for receiving numeric data (field settings and measurement results) through HP-IB. Changing HP-IB Units has no affect on the Display Units or Attribute Units settings. Table 3-1 lists the HP-IB Units used in the Test Set.
Table 3-1 HP-IB Units
Parameter Unit of Measure
Power Watts (W) or dBm (DBM)
Amplitude Volts (V), or dB
V (DBUV)
Frequency Hertz (Hz)
Frequency Error Hertz (HZ) or parts per million
(PPM)
Time Seconds (S)
Data Rate Bits per second (BPS)
Current Amperes (A)
Resistance Ohms (OHM)
Relative Level decibels (DB) or percent (PCT)
Marker Position Division (DIV)
FM Modulation Hertz (HZ)
AM Modulation Percent (PCT)
υ
Use the UNITs? command to determine the HP-IB Units for a measurement result or field setting (refer to “Reading-Back HP-IB
Units” on page 73 for more information).
72 Chapter 3
O:\Manuals\E6380A_Progguid\Book\Guidelin.fm
HP-IB Command Guidelines
Guidelines for Operation
Changing HP-IB Units Use the UNITs command to change the HP-IB Units setting for selected measurement or instrument setup fields. Only the HP-IB units for power, relative level, and frequency error can be changed. Table 3-2 lists the measurement and instrument setup fields which have changeable HP-IB Units.
Table 3-2 HP-IB Units That Can Be Changed
Function Available HP-IB Units
TX Power measurement W or DBM
Adjacent Channel Power
LRATio, URATio DB or PCT
LLEVel, ULEVel W or DBM
SINAD measurement DB or PCT
DISTN measurement DB or PCT
SNR measurement DB or PCT
RF Generator Amplitude W or DBM or V or DBUV
Frequency Error HZ or PPM
For example, the following BASIC language program statements change the HP-IB Units for the TX Power measurement from W to dBm:
Example 3-27 Example
OUTPUT 714;"MEAS:RFR:POW:UNIT DBM"
Reading-Back HP-IB Units Use the UNITs? command to read back the current HP-IB Units setting for a measurement or instrument setup field. For example, the following BASIC language program statements read back the current HP-IB Units setting for the TX Power measurement:
Example 3-28 Example
!Query the current HP-IB Units setting for TX Power. OUTPUT 714;"MEAS:RFR:POW:UNIT?" !Enter the returned value into a string variable. ENTER 714;A$
Chapter 3 73
HP-IB Command Guidelines
Guidelines for Operation
Guidelines for HP-IB Units
• When setting the value of a numeric field (such as AFGen1 Freq),
any non–HP-IB Unit unit-of-measure must be specified in the command string, otherwise the current HP-IB Unit is assumed by the Test Set.
For example, if the command RFG:FREQ 900 is sent through HP-IB, the Test Set will interpret the data as 900 Hz, since HZ is the HP-IB Unit for frequency. This would result in an Input value out of range error. Sending the command RFG:FREQ 900 MHZ would set the value to 900 MHz.
• When querying measurements or settings through HP-IB, the Test Set always returns numeric values in HP-IB units, regardless of the current Display Unit setting. Numeric values are expressed in scientific notation.
For example, if the TX Frequency measurement is displayed as
150.000000 MHz on the Test Set, the value returned through HP-IB
8
is 1.5000000E+008 (1.5 X10
). Converting the returned value to a format other than scientific notation must be done programmatically.
74 Chapter 3
O:\Manuals\E6380A_Progguid\Book\Guidelin.fm
HP-IB Command Guidelines
Guidelines for Operation
Attribute Units (AUNits)
Attribute Units are the units-of-measure used by the Test Set when sending or receiving numeric data through HP-IB for the MEASure commands: REFerence, METer (HEND, LEND, INT), HLIMit and
LLIMit (refer to “Number Measurements Syntax” in the HP-IB Syntax Reference Guide for further details). These measurement commands are analogous to the front-panel Data Function keys: REF SET, METER, HI LIMIT and LO LIMIT respectively. Attribute Units use the same set of units-of-measure as the HP-IB Units (except Frequency Error), but are only used with the MEASure commands: REFerence, METer (HEND, LEND, INT), HLIMit and LLIMit. Table 3-3 lists the Attribute Units used in the Test Set.
Table 3-3 Attribute Units
Parameter Unit of Measure
Power Watts (W) or dBm (DBM)
Amplitude Volts (V)
Frequency Hertz (Hz)
Time Seconds (S)
Data Rate Bits per second (BPS)
Current Amperes (A)
Resistance Ohms (OHM)
Relative Level decibels (DB) or percent (PCT)
Marker Position Division (DIV)
FM Modulation Hertz (HZ)
AM Modulation Percent (PCT)
Chapter 3 75
HP-IB Command Guidelines
Guidelines for Operation
Default Data Function Values The majority of measurements made with the Test Set can be made using the Data Functions: REF SET, METER, AVG, HI LIMIT and LO LIMIT. Measurements which can be made using the Data Functions have a cross-reference with the
comment “See Number Measurement Syntax” in their syntax. If one or more of the Data Functions are not available to that measurement, the Data Function(s) not available will be listed in the syntax.
For each measurement that can be made using the Data Functions, there is a default set of values for each Data Function for that measurement.
For example, the Audio Frequency Analyzer Distortion measurement can be made using all of the Data Functions. This would include REF SET, METER, AVG, HI LIMIT and LO LIMIT. A complete listing of the Distortion measurement’s Data Functions and their default values would appear as follows:
• The Attribute units are: PCT
• The number of Averages is: 10
• The Average state is: 0
• The Reference value is: 1
• The Reference Display units are: PCT
• The Reference state is: 0
• The High Limit is: 0
• The High Limit Display units are: PCT
• The High Limit state is: 0
• The Low Limit is: 0
• The Low Limit Display units are: PCT
• The Low Limit state is: 0
• The Meter state is: 0
• The Meter high end setting is: 10
• The Meter high end Display units are: PCT
• The Meter low end setting is: 0
• The Meter low end Display units are: PCT
• The Meter interval is: 10
76 Chapter 3
O:\Manuals\E6380A_Progguid\Book\Guidelin.fm
HP-IB Command Guidelines
Guidelines for Operation
The Data Functions are set to their default values whenever
• the power is cycled on the Test Set
• the front-panel PRESET key is selected
• the *RST Common Command is received through HP-IB
Changing Attribute Units The AUNits command can be used to change the Attribute Units setting for selected measurements. Only the Attribute Units for power and relative level measurements can be changed. Table 3-4 lists the measurements which have changeable Attribute Units.
Table 3-4 Measurements with Attribute Units That Can
Be Changed
Function Available Attribute Units
TX Power measurement W or DBM
Adjacent Channel Power
LRATio, URATio DB or PCT
LLEVel, ULEVel W or DBM
SINAD measurement DB or PCT
DISTN measurement DB or PCT
SNR measurement DB or PCT
Before changing the Attribute Units for a selected measurement, the Test Set verifies that all Data Function values can be properly converted from the current unit-of-measure to the new unit-of-measure. The following Data Function settings are checked:
• the Reference value
•the High Limit
• the Low Limit
• the Meter’s high end setting
• the Meter’s low end setting
• the Meter’s interval
Chapter 3 77
HP-IB Command Guidelines
Guidelines for Operation
If it is not possible to properly convert all the values to the new unit-of-measure, the Attribute Units are not changed and the following error is generated: HP-IB Error: HP-IB Units cause invalid conversion of attr. This error is most often encountered when one of the Data Function values listed above is set to zero. If this error is encountered, the programmer must change the Data Function settings to values that can be converted to the new units-of-measure before sending the :AUNits command to the Test Set.
For example, the following BASIC language program statements
1. reset the Test Set
2. set the Data Function default zero values to non-zero values
3. set the Attribute Units to DB
4. then query the value of each Data Function
The units of measure for the returned values will be DB.
Display Units and HP-IB Units are not affected when changing Attribute Units.
78 Chapter 3
O:\Manuals\E6380A_Progguid\Book\Guidelin.fm
Example 3-29 Example
!Reset the Test Set OUTPUT 714;"*RST" !Set HIgh LIMIT value to 15 OUTPUT 714;"MEAS:AFR:DIST:HLIM:VAL 15" !Set LOw LIMIT value to 1 OUTPUT 714;"MEAS:AFR:DIST:LLIM:VAL 1" !Set the Meter Lo End value to 1 OUTPUT 714;"MEAS:AFR:DIST:MET:LEND 1" !Set Attribute Units for Distortion measurement to DB OUTPUT 714;"MEAS:AFR:DIST:AUN DB" !Query the REFerence SET value OUTPUT 714;"MEAS:AFR:DIST:REF:VAL?" !Read the REFerence SET value into variable Ref_set_val ENTER 714;Ref_set_val !Query the HIgh LIMIT value OUTPUT 714;"MEAS:AFR:DIST:HLIM:VAL?" !Read the HIgh LIMIT value into variable Hi_limit_val ENTER 714;Hi_limit_val !Query the LOw LIMIT value OUTPUT 714;"MEAS:AFR:DIST:LLIM:VAL?" !Read the LOw LIMIT value into variable Lo_limit_val ENTER 714;Lo_limit_val !Query the Meter Hi End value OUTPUT 714;"MEAS:AFR:DIST:MET:HEND?" !Read the Meter Hi End value into variable Met_hiend_val ENTER 714;Met_hiend_val !Query the Meter Lo End value OUTPUT 714;"MEAS:AFR:DIST:MET:LEND?" !Read the Meter Lo End value into variable Met_loend_val ENTER 714;Met_loend_val !Query the Meter interval OUTPUT 714;"MEAS:AFR:DIST:MET:INT?" !Read the Meter interval into! variable Met_int_val
HP-IB Command Guidelines
Guidelines for Operation
ENTER 714;Met_int_val
Chapter 3 79
HP-IB Command Guidelines
Guidelines for Operation
Reading-back Attribute Units
Use the AUNits? command to read back the Attribute Units setting for the selected measurement. For example, the following BASIC language program statements show how the AUNits? command can be used to read-back a Distortion REFerence SET level:
Example 3-30 Example
!Query the REFerence SET value for the Distortion measurement OUTPUT 714;"MEAS:AFR:DIST:REF:VAL?" !Read the REFerence SET value into variable Ref_set_val ENTER 714;Ref_set_val !Query the Attribute Units setting for the Distortion measurement OUTPUT 714;"MEAS:AFR:DIST:AUN?" !Read the Attribute Units setting into string variable Atribute_set$ ENTER 714;Atribute_set$ !Print out the variables in the form <VALUE><UNITS>
PRINT Ref_set_val;Atribute_set$
If a reference of 25% is set, 25 PCT would be printed.
80 Chapter 3
O:\Manuals\E6380A_Progguid\Book\Guidelin.fm
HP-IB Command Guidelines
Guidelines for Operation
Guidelines for Attribute Units
• When setting the value of measurement functions REFerence, METer, HLIMit and LLIMit through HP-IB, a non–Attribute Unit unit-of-measure must be specified in the command string, otherwise the current Attribute Unit is assumed by the Test Set.
For example, if the Test Set is in a RESET condition and the command MEAS:AFR:DIST:REF:VAL 10 is sent through HP-IB, the Test Set will interpret the data as 10%, since % is the RESET Attribute Unit for the Distortion measurement. Sending the command, MEAS:AFR:DIST:REF:VAL 10 DBM, would set the REFerence SET value to 10 dB.
• When querying measurement functions REFerence, METer, HLIMit and LLIMit through HP-IB, the Test Set always returns numeric values in Attribute Units, regardless of the current Display Units or HP-IB Units settings. Numeric values are expressed in scientific notation.
For example, if the REF SET measurement function is displayed as 25% on the Test Set, the value returned through HP-IB is
1
+2.50000000E+001 (2.5 ¥ 10
). Converting the returned value to a format other than scientific notation must be done programmatically.
• Before changing the Attribute Units for a selected measurement, the Test Set verifies that all Data Function values can be properly converted from the current unit-of-measure to the new unit-of-measure. If it is not possible to properly convert all the values to the new unit-of-measure, the Attribute Units are not changed and the following error is generated: HP-IB Error: HP-IB
Units cause invalid conversion of attr.
Chapter 3 81
HP-IB Command Guidelines
Guidelines for Operation

Using the STATe Command

The STATe command corresponds to the front-panel ON/OFF key and is used to programmatically turn measurements, instrument functions, and data functions ON or OFF.
Turning measurements, instrument functions and data functions ON/OFF
Use 1 or ON to turn measurements, instrument functions, or data functions ON. Use 0 or OFF to turn measurements, instrument functions, or data functions OFF.
For example, the following BASIC language statements illustrate the use of the STATe command to turn several measurements, instrument functions, and data functions ON and OFF:
Example 3-31 Example
!Turn off FM source AFG1. * OUTPUT 714;"AFG1:FM:STAT OFF" !Turn off REFerence SET data function OUTPUT 714;"MEAS:AFR:DISTN:REF:STAT OFF" !Turn off TX Power measurement OUTPUT 714;"MEAS:RFR:POW:STAT 0" !Turn on REF SET measurement function for FM Deviation measurement
OUTPUT 714;"MEAS:AFR:FM:REF:STAT ON"
*This assumes the AFGen1 To field is set to FM.
82 Chapter 3
O:\Manuals\E6380A_Progguid\Book\Guidelin.fm
Reading back the measurement, instrument function, or data function state
Use the query form of the command, STATe?, to determine the current state of a measurement, instrument function or data function. If a measurement, instrument function, or data function is queried, the
returned value will be either a “1” (ON) or a “0” (OFF).
For example, the following BASIC language statements illustrate the use of the STATe? command to determine the current state of the TX Power measurement:
Example 3-32 Example
!Query the state of the TX Power measurement OUTPUT 714;"MEAS:RFR:POW:STAT?" ENTER 714;State_on_off IF State_on_off = 1 THEN DISP "TX Power Measurement is ON"
IF State_on_off = 0 THEN DISP "TX Power Measurement is OFF
HP-IB Command Guidelines
Guidelines for Operation
STATe Command Guidelines
• Measurements that are displayed as numbers, or as analog meters using the METER function, can be turned on and off.
• The data functions REFerence, METer, HLIMit, and LLIMit can be turned on and off.
• Any instrument function that generates a signal can be turned on and off. This includes the RF Generator, Tracking Generator, AF Generator 1, AF Generator 2, and the Signaling Encoder.
• The Oscilloscope’s trace cannot be turned off.
• The Spectrum Analyzer’s trace cannot be turned off.
Chapter 3 83
HP-IB Command Guidelines
Guidelines for Operation

Sample HP-IB Program

The following program was written on an HP 9000 Series 300 controller using Agilent Technologies Rocky Mountain BASIC (RMB). To run this
program directly in the Test Set’s IBASIC controller make the following modifications:
1. Use exclamation marks (!) to comment-out lines 440, 450, and 460 (these commands not supported in IBASIC).
2. Change line 70 to Bus = 8 (internal HP-IB select code = 8).
Example 3-33 Example
10 !This program generates an FM carrier, measures and displays the 20 !deviation, and draws the modulation waveform from the 30 !oscilloscope to the CRT display. For demonstration purposes the 40 !carrier is generated and analyzed through the uncalibrated input 50 !path so that no external cables are required. 60 GCLEAR !Clear graphics display. 70 Bus=7 ! Interface select code of HP-IB interface 80 Dut=100*Bus+14 ! Default Test Set HP-IB address is 14 90 CLEAR Bus! Good practice to clear the bus 100 CLEAR SCREEN ! Clear the CRT 110 OUTPUT Dut;"*RST" ! Preset the Test Set 115 OUTPUT Dut;"DISP RFAN" !Display the RF ANALYZER screen 116 OUTPUT Dut;"RFAN:FREQ 100 MHZ" !Set the tune freq. to 100 MHz 120 OUTPUT Dut;"DISP RFG" ! Display the RF GENERATOR screen 125 OUTPUT Dut;"RFG:FREQ 100 MHZ" ! Set the RF Gen frequency to 100 MHz 130 OUTPUT Dut;"RFG:AMPL -26 DBM" ! Set RF Gen Amptd to -26 dBm 135 OUTPUT Dut;"AFG1:FM:STAT ON" !Turn on FM (3 kHz deviation, default) 136 OUTPUT Dut;"DISP AFAN" ! Display the AF ANALYZER screen 140 OUTPUT Dut;"AFAN:INP ’FM Demod’"
150 ! Set AF Analyzer’s input to FM Demod 160 OUTPUT Dut;"AFAN:DET 'Pk+-Max'" 200 OUTPUT Dut;"TRIG"! Trigger all active measurements 210 OUTPUT Dut;"MEAS:AFR:FM?" ! Request an FM deviation measurement 220 ENTER Dut;Dev ! Read measured value into variable Dev 230 PRINT USING "K,D.DDD,K";"Measured FM = ",Dev/1000," kHz peak." 240 DISP "'Continue' when ready..." ! Set up user prompt 245 ! Set up interrupt on softkey 1 250 ON KEY 1 LABEL "Continue",15 GOTO Proceed 260 LOOP! Loop until the key is pressed 270 END LOOP 280 Proceed: OFF KEY! Turn off interrupt from softkey 1 290 DISP ""! Clear the user prompt
84 Chapter 3
O:\Manuals\E6380A_Progguid\Book\Guidelin.fm
HP-IB Command Guidelines
Guidelines for Operation
300 ! 310 !Measure and plot oscilloscope trace to see the waveform shape. 320 DIM Trace(0:416)! Oscilloscope has 417 trace points 330 OUTPUT Dut;"DISP OSC" Display the Oscilloscope screen 340 OUTPUT Dut;"TRIG"! Trigger all active measurements 350 OUTPUT Dut;"MEAS:OSC:TRAC?" 360 !Request the oscilloscope trace 370 ENTER Dut;Trace(*) 380 ! Read the oscilloscope trace into array Trace(*) 390 ! CRT is (X,Y)=(0,0) in lower left corner 400 !to (399,179) upper right. 410 ! (Each pixel is about 0.02 mm wide by 0.03 mm tall, not square.) 420 ! Scale vertically for 0 kHz dev center-screen and +4 kHz dev top 430 ! of screen. Leave the next three lines for external control, or 440 ! comment them out for IBASIC (Test Set stand-alone) control. 450 ! 460 PLOTTER IS CRT,"98627A" 470 !Your display may have a different specifier. 480 GRAPHICS ON!Enable graphics to plot the waveform. 490 WINDOW 0,399,0,179 500 ! 510 PEN 1 !Turn on drawing pen 520 MOVE 0,89.5+Trace(0)/4000*89.5 530 FOR I=1 TO 416 540 DRAW I/416*399,89.5+Trace(I)/4000*89.5 550 NEXT I
560 END
Chapter 3 85
HP-IB Command Guidelines
Guidelines for Operation
86 Chapter 3
O:\Manuals\E6380A_Progguid\Book\Guidelin.fm

4 IEEE Common Commands

This chapter describes IEEE 488.2 common commands.
87
IEEE Common Commands

IEEE 488.2 Common Commands

IEEE 488.2 Common Commands
The IEEE 488.2 Standard defines a set of common commands which provide for uniform communication between devices on the HP-IB. These commands are common to all instruments which comply with the IEEE 488.2 Standard. These commands control some of the basic instrument functions, such as instrument identification, instrument reset, and instrument status reporting.
The following common commands are implemented in the Test Set:
Table 4-1
Mnemonic Command Name
*CLS Clear Status Command
*ESE Standard Event Status Enable Command
*ESE? Standard Event Status Enable Query
*ESR? Standard Event Status Register Query
*IDN? Identification Query
*OPC Operation Complete Command
*OPC? Operation Complete Query
*OPT? Option Identification Query
*PCB Pass Control Back Command
*RCL Recall Command
*RST Reset Command
*SAV Save Command
*SRE Service Request Enable Command
*SRE? Service Request Enable Query
*STB? Read Status Byte Query
*TRG Trigger Command
*TST? Self-Test Query
*WAI Wait-to-Continue Command
88 Chapter 4
O:\Manuals\E6380A_Progguid\Book\Ieee.fm

Common Command Descriptions

*IDN? (Identification Query)

The *IDN? query causes a device to send its identification information over the bus. The Test Set responds to the *IDN? command by placing its identification information, in ASCII format, into the Output Queue. The response data is obtained by reading the Output Queue into a string variable of length 72. The response data is organized into four fields separated by commas. The field definitions are described in Table
4-2.
Table 4-2 Device Identification
IEEE Common Commands
Common Command Descriptions
Field Contents Response from Test
Set
1 Manufacturer Agilent Technologies
2 Model Depends upon Model of
Test Set
3 Serial Number US12345678 ASCII character “0”, decimal
4 Firmware Revision Level A.01.08 ASCII character “0”, decimal
NOTE
The Serial Number format can take one of two forms:
Comments
value 48, if not available
value 48,if not available
A = alpha character X = numeric character
The form returned will depend upon the manufacturing date of the Test Set being queried.
Example BASIC program
Example 4-1 Example
10 DIM A$[10]20 OUTPUT 714;"*IDN?" 30 ENTER 714;A$ 40 PRINT A$ 50 END
Chapter 4 89
IEEE Common Commands
Common Command Descriptions

*OPT? (Option Identification Query)

The *OPT? command tells the Test Set to identify any reportable device options install in the unit. The Test Set responds to the *OPT? command by placing information which describes any reportable installed options into the Output Queue. The data is in ASCII format. The response data is obtained by reading the Output Queue into a string variable of length 255. The response data is organized into fields separated by commas. Some fields, such as the Filter Option field, have more than one valid string (only one is returned).
If an option is not installed, an ASCII character 0 (zero) is placed in the output string for that option. If an option is standard, it is not reported (an ASCII character 0 (zero) is not placed in the output string for that option). The length of the returned string can vary depending upon the Test Set being queried, installed options and standard options.
Example BASIC program
Example 4-2 Example
10 DIM A$[255]20 OUTPUT 714;"*OPT?" 30 ENTER 714;A$ 40 PRINT A$ 50 END
90 Chapter 4
O:\Manuals\E6380A_Progguid\Book\Ieee.fm
IEEE Common Commands
Common Command Descriptions

*RST (Reset)

The *RST command resets the Test Set. When the *RST command is
received the majority of fields in the Test Set are “restored” to a default value, some fields are “maintained” at their current state and some are “initialized” to a known state. Refer to “Instrument Initialization” on
page 177 for further information. Other operational characteristics are
also affected by the *RST command as follows:
• All pending operations are aborted.
• The Test Set’s display screen is in the UNLOCKED state.
• Measurement triggering is set to TRIG:MODE:SETT FULL;RETR REP.
• Any previously received Operation Complete command (*OPC) is cleared.
• Any previously received Operation Complete query command (*OPC?) is cleared.
• The power-up self-test diagnostics are not performed.
• The contents of the SAVE/RECALL registers are not affected.
• Calibration data is not affected.
• The HP-IB interface is not reset (any pending Service Request is not cleared).
• All Enable registers are unaffected: Service Request, Standard Event, Communicate, Hardware #1, Hardware #2, Operation, Calibration, and Questionable Data/Signal.
• All Negative Transition Filter registers are unaffected: Communicate, Hardware #1, Hardware #2, Operational, Calibration, and Questionable Data/Signal.
• All Positive Transition Filter registers are unaffected: Communicate, Hardware #1, Hardware #2, Operational, Calibration, and Questionable Data/Signal.
• The contents of the RAM are unaffected.
• The contents of the Output Queue are unaffected.
• The contents of the Error Queue are unaffected.
Chapter 4 91
IEEE Common Commands
Common Command Descriptions

*TST? (Self-Test Query)

The *TST? self-test query causes the Test Set to execute a series of internal self-tests and place a numeric response into the Output Queue indicating whether or not the Test Set completed the self-test without any detected errors. The response data is obtained by reading the Output Queue into a numeric variable, real or integer. Upon successful completion of the self-test the Test Set settings are restored to their values prior to receipt of the *TST? command.
NOTE
Refer to the Test Set’s Assembly Level Repair manual for further information on Power-Up Self Test Failure.
Example BASIC program
Example 4-3 Example
10 INTEGER Slf_tst_respons20 OUTPUT 714;"*TST?" 30 ENTER 714;Slf_tst_respons 40 PRINT Slf_tst_respons$ 50 END
Example response
Example 4-4 Example
512
92 Chapter 4
O:\Manuals\E6380A_Progguid\Book\Ieee.fm
IEEE Common Commands
Common Command Descriptions

*OPC (Operation Complete)

The *OPC command allows for synchronization between the Test Set and an external controller. The *OPC command causes the Test Set to set bit 0, Operation Complete, in the Standard Event Status Register to the TRUE, logic 1, state when the Test Set completes all pending operations. Detection of the Operation Complete message can be accomplished by continuous polling of the Standard Event Status Register using the *ESR? common query command. However, using a service request eliminates the need to poll the Standard Event Status Register thereby freeing the controller to do other useful work.
NOTE
The Test Set contains signal generation and signal measurement instrumentation. The instrument control processor is able to query the signal measurement instrumentation to determine if a measurement cycle has completed. However, the instrument control processor is not able to query the signal generation instrumentation to determine if the signal(s) have settled. In order to ensure that all signals have settled to proper values, the instrument control processor initiates a one-second delay upon receipt of the *OPC, *OPC? and *WAI commands. In parallel with the one-second timer the instrument control processor commands all active measurements to tell it when the measurement(s) are done. When all active measurements are done and the one-second timer has elapsed, the *OPC, *OPC? and *WAI commands are satisfied.
If the *OPC, *OPC? or *WAI common commands are used to determine when a measurement has completed and the measurement is either in
the OFF State or unavailable (four dashed lines on CRT display “- - - -”), the *OPC, *OPC? or *WAI command will never complete.
Chapter 4 93
IEEE Common Commands
Common Command Descriptions
Example BASIC program - Service Request
Example 4-5 Example
10 OUTPUT 714;"*SRE 32" 20 !Enable SRQ on events in the Standard Event Status Register 30 OUTPUT 714;"*ESE 1" 40 !Enable Operation Complete bit in Standard Event Status Register 50 ON INTR 7,15 CALL Srvice_interupt!Set up interrupt 60 ENABLE INTR 7;2 !Enable SRQ interrupts
70 OUTPUT 714;"DISP RFG;RFG:OUTP ’Dupl’;AMPL 0 dBm;FREQ 320 MHz;*OPC" 80 LOOP!Dummy loop to do nothing 90 DISP "I am in a dummy loop." 100 END LOOP 110 END 120 SUB Srvice_interupt 130 PRINT "All operations complete." 140 ! Note: 150 ! This interrupt service routine is not complete. 160 ! Refer to the “HP-IB Service Requests” on page 167 for 170 ! complete information.
180 SUBEND
The program enables bit 0 in the Standard Event Status Enable Register and also bit 5 in the Service Request Enable Register so that the Test Set will request service whenever the OPC event bit becomes true. After the service request is detected the program can take appropriate action. Refer to “HP-IB Service Requests” on page 167 for
further information.
94 Chapter 4
O:\Manuals\E6380A_Progguid\Book\Ieee.fm
Example BASIC program - Polling the Standard Event Status Register
Example 4-6 Example
10 INTEGER Stdevnt_reg_val 20 OUTPUT 714;"DISP RFG;RFG:OUTP ’Dupl’;AMPL 0 dBm;FREQ 320 MHz;*OPC" 30 LOOP 40 OUTPUT 714;"*ESR?" ! Poll the register 50 ENTER 714;Stdevnt_reg_val 60 EXIT IF BIT(Stdevnt_reg_val,0) ! Exit if Operation Complete bit set 70 END LOOP 80 PRINT "All operations complete."
90 END
IEEE Common Commands
Common Command Descriptions
Chapter 4 95
IEEE Common Commands
Common Command Descriptions

*OPC? (Operation Complete Query)

The *OPC? query allows for synchronization between the Test Set and an external controller by reading the Output Queue or by polling the Message Available (MAV) bit in the Status Byte Register. The *OPC? query causes the Test Set to place an ASCII character, 1, into its Output Queue when the Test Set completes all pending operations. A consequence of this action is that the MAV bit in the Status Byte Register is set to the 1 state.
NOTE
The Test Set contains signal generation and signal measurement instrumentation. The instrument control processor is able to query the signal measurement instrumentation to determine if a measurement cycle has completed. However, the instrument control processor is not able to query the signal generation instrumentation to determine if the signal(s) have settled. In order to ensure that all signals have settled to proper values, the instrument control processor initiates a one-second delay upon receipt of the *OPC, *OPC? and *WAI commands. In parallel with the one-second timer the instrument control processor commands all active measurements to tell it when the measurement(s) are done. When all active measurements are done and the one-second timer has elapsed, the *OPC, *OPC? and *WAI commands are satisfied.
If the *OPC, *OPC? or *WAI common commands are used to determine when a measurement has completed and the measurement is either in
the OFF State or unavailable (four dashed lines on CRT display “- - - -”), the *OPC, *OPC? or *WAI command will never complete.
Using the *OPC? query by reading Output Queue
Bit 4 in the Service Request Enable Register is set to a value of zero (disabled). The *OPC? query is sent to the Test Set at the end of a command message data stream. The application program then attempts to read the *OPC? query response from the Test Set’s Output Queue. The Test Set will not put a response to the *OPC? query into the Output Queue until the commands have all finished.
NOTE
Reading the response to the *OPC? query has the penalty that both the HP-IB bus and the Active Controller handshake are in temporary holdoff state while the Active Controller waits to read the *OPC? query response from the Test Set.
96 Chapter 4
O:\Manuals\E6380A_Progguid\Book\Ieee.fm
Example 4-7 Example BASIC program
10 INTEGER Output_que_val 20 OUTPUT 714;"*SRE 0"! Disable Service Requests 30 OUTPUT 714;"DISP RFG;RFG:OUTP ’Dupl’;AMPL 0 dBm;FREQ 320 MHz;*OPC?" 40 ENTER 714;Output_que_val 50 !Program will wait here until all operations complete 60 PRINT "All operations complete."
70 END
Using the *OPC? query using the MAV bit in the Status Byte
Bit 4 in the Service Request Enable Register is set to a value of 1 (enabled). The *OPC? query is sent to the Test Set at the end of a command message data stream. The Test Set will request service when the MAV bit in the Status Byte register is set to the TRUE, logic 1, state. After the service request is detected the application program can take appropriate action. Refer to the “HP-IB Service Requests” on page
167 for further information.
IEEE Common Commands
Common Command Descriptions
Example 4-8 Example BASIC program
10 OUTPUT 714;"*SRE 16" 20 !Enable SRQ on data available in Output Queue (MAV bit) 30 ON INTR 7,15 CALL Srvice_interupt ! Set up interrupt 40 ENABLE INTR 7;2 ! Enable SRQ interrupts 50 OUTPUT 714;"DISP RFG;RFG:OUTP ’Dupl’;AMPL 0 dBm;FREQ 320 MHz;*OPC?"
60 LOOP ! Dummy loop to do nothing
70 DISP "I am in a dummy loop." 80 END LOOP 90 END 100 SUB Srvice_interupt 110 ENTER 714;Output_que_val!Read the 1 returned by the *OPC? 120 ! query command 130 PRINT "All operations complete." 140 ! Note: 150 ! This interrupt service routine is not complete. 160 ! Refer to the “HP-IB Service Requests” on page 167 for
170 ! complete information. 180 SUBEND
Chapter 4 97
IEEE Common Commands
Common Command Descriptions

*WAI (Wait To Complete)

The *WAI command stops the Test Set from executing any further commands or queries until all commands or queries preceding the *WAI command have completed.
Example BASIC statement
Example 4-9 Example
OUTPUT 714;"DISP RFG;RFG:OUTP ’Dupl’;*WAI;AMPL 0 dBm"
NOTE
The Test Set contains signal generation and signal measurement instrumentation. The instrument control processor is able to query the signal measurement instrumentation to determine if a measurement cycle has completed. However, the instrument control processor is not able to query the signal generation instrumentation to determine if the signal(s) have settled. In order to ensure that all signals have settled to proper values, the instrument control processor initiates a one-second delay upon receipt of the *OPC, *OPC? and *WAI commands. In parallel with the one-second timer the instrument control processor commands all active measurements to tell it when the measurement(s) are done. When all active measurements are done and the one-second timer has elapsed, the *OPC, *OPC? and *WAI commands are satisfied.
If the *OPC, *OPC? or *WAI common commands are used to determine when a measurement has completed and the measurement is either in
the OFF State or unavailable (four dashed lines on CRT display “- - - -”), the *OPC, *OPC? or *WAI command will never complete.
98 Chapter 4
O:\Manuals\E6380A_Progguid\Book\Ieee.fm
IEEE Common Commands
Common Command Descriptions

*CLS (Clear Status)

The *CLS command clears the contents (sets all bits to zero) of all Event Registers summarized in the Status Byte. The *CLS command also empties all queues (removes all current messages) which are summarized in the Status Byte, except the Output Queue. The Status Byte Register is cleared and any pending service request is cleared. The following Event Registers are affected:
• Hardware 1 Status Register
• Hardware 2 Status Register
• Questionable Data/Signal Register
• Standard Event Status Register
• Operational Status Register
• Calibration Status Register
• Communicate Status Register
NOTE
• Call Processing Status Register
The Following message queues are affected:
• Error Message Queue
The *CLS command does not clear the contents of the Message Screen which is displayed on the CRT when the SHIFT RX keys are selected. This display is only cleared when the unit is powered on.

*ESE (Standard Event Status Enable)

The Test Set responds to the *ESE command. See “Status Reporting” on
page 121 for a detailed explanation of the *ESE command.

*ESE? (Standard Event Status Enable Query)

The Test Set responds to the *ESE? command. See “Status Reporting”
on page 121 for a detailed explanation of the *ESE? command.

*ESR? (Standard Event Status Register Query)

The Test Set responds to the *ESR? command. See “Status Reporting”
on page 121 for a detailed explanation of the *ESR? command.

*SRE (Service Request Enable)

The Test Set responds to the *SRE command. See “HP-IB Service
Requests” on page 167 for a detailed explanation of the *SRE
command.
Chapter 4 99
IEEE Common Commands
Common Command Descriptions

*SRE? (Service Request Enable Query)

The Test Set responds to the *SRE? command. See “HP-IB Service
Requests” on page 167 for a detailed explanation of the *SRE?
command.

*STB? (Status Byte Query)

The Test Set responds to the *STB? command. See “Status Reporting”
on page 121 for a detailed explanation of the *STB? command.

*TRG (Trigger)

The *TRG command is equivalent to the IEEE 488.1 defined Group Execute Trigger (GET) message and has the same effect as a GET when received by the Test Set. The Test Set responds to the *TRG command by triggering all currently active measurements.

*PCB (Pass Control Back)

The Test Set accepts the *PCB command. See “Passing Control” on page
186 for a detailed explanation of the *PCB command.

*RCL (Recall Instrument State)

The *RCL command restores the state of the Test Set from a file previously stored in battery-backed internal memory, on a PC card, or on an external disk. The *RCL command is followed by a decimal number in the range of 0 to 99 which indicates which Test Set SAVE/RECALL file to recall. The mass storage location for SAVE/RECALL files is selected using the SAVE/RECALL field on the I/O CONFIGURE screen.
The *RCL command cannot be used to recall files with names which contain non-numeric characters or a decimal number greater than 99. To recall SAVE/RECALL files saved with names which contain non-numeric characters or a decimal number greater than 99, use the REG:RECall filename command.
100 Chapter 4
O:\Manuals\E6380A_Progguid\Book\Ieee.fm
Loading...