Agilent Technologies 1660A, 1660AS User Manual

Programmer’s Guide
Publication number 01660-97033 Second edition, January 2000
For Safety information, Warranties, and Regulatory information, see the pages behind the index
Copyright Agilent Technologies 1992-2000 All Rights Reserved
Agilent Technologies 1660A/AS-Series Logic Analyzers
ii

In This Book

Introduction to Programming
1
This programmer’s guide contains general information, mainframe level commands, logic analyzer commands, oscilloscope module commands, and programming examples for programming the 1660-series logic analyzers. This guide focuses on how to program the instrument over the GPIB and the RS-232C interfaces.
Instruments covered by the 1660-Series Programmer’s Guide
The 1660-series logic analyzers are available with or without oscilloscope measurement capabilities. The 1660A-series logic analyzers contain only a logic analyzer. The 1660AS-series logic analyzers contain both a logic analyzer and a digitizing oscilloscope.
What is in the 1660-Series Programmer’s Guide?
The 1660-Series Programmer’s Guide is organized in five parts.
2
3
4
5
6
7
8
9
10
11
Programming Over GPIB
Programming Over RS-232C
Programming and
Documentation Conventions
Message Communication
and System Functions
Status Reporting
Error Message
Common Commands
Mainframe Commands
SYSTem Subsystem
MMEMory Subsystem
Part 1 Part 1 consists of chapters 1 through 7 and contains general information about programming basics, GPIB and RS-232C interface requirements, documentation conventions, status reporting , and error messages.
12
13
14
INTermodule Subsystem
MACHine Subsystem
WLISt Subsystem
iii
If you are already familiar with IEEE 488.2 programming and GPIB or RS-232C, you may want to just scan these chapters. If you are new to programmiung the system, you should read part 1.
Chapter 1 is divided into two sections. The first section, "Talking to the Instrument," concentrates on program syntax, and the second section, "Receiving Information from the Instrument," discusses how to send queries and how to retrieve query results from the instrument.
Read either chapter 2, "Programming Over GPIB," or chapter 3, "Programming Over RS-232C" for information concerning the physical connection between the 1660-series logic analyzer and your controller.
Chapter 4, "Programming and Documentation Conventions," gives an overview of all instructions and also explains the notation conventions used in the syntax definitions and examples.
Chapter 5, "Message Communication and System Functions," provides an overview of the operation of instruments that operate in compliance with the IEEE 488.2 standard.
Chapter 6 explains status reporting and how it can be used to monitor the flow of your programs and measurement process.
Chapter 7 contains error message descriptions.
Part 2 Part 2, chapters 8 through 12, explain each command in the command set for the mainframe. These chapters are organized in subsystems with each subsystem representing a front-panel menu.
The commands explained in this part give you access to common commands, mainframe commands, system level commands, disk commands, and intermodule measurement commands. This part is designed to provide a concise description of each command.
Part 3 Part 3, chapters 13 through 25 explain each command in the subsystem command set for the logic analyzer. Chapter 26 contains information on the SYSTem:DATA and SYSTem:SETup commands for the logic analyzer.
The commands explained in this part give you access to all the commands used to operate the logic analyzer portion of the 1660-series system. This part is designed to provide a concise description of each command.
Part 4 Part 4, chapters 27 through 35 explain each command in the subsystem command set for the oscilloscope.
iv
15
SFORmat Subsystem
The commands explained in this part give you access to all the commands used to operate the oscilloscope portion of the 1660-series system. This part is designed to provide a concise description of each command.
Part 5 Part 5, chapter 36 contains program examples of actual tasks that show you how to get started in programming the 1660-series logic analyzers. The complexity of your programs and the tasks they accomplish are limited only by your imagination. These examples are written in HP BASIC
6.2; however, the program concepts can be used in any other popular programming language that allows communications over GPIB or RS-232 buses.
STRigger (STRace) Subsystem
16
17
18
19
20
21
22
23
24
SLISt Subsystem
SWAVeform Subsystem
SCHart Subsystem
COMPare Subsystem
TFORmat Subsystem
TRIGger {TRACe} Subsystem
TWAVeform Subsystem
TLISt Subsystem
25
26
27
28
SYMbol Subsystem
DATA and SETup Commands
Oscilloscope Root Level
Commands
ACQuire Subsystem
v
vi
29
CHANnel Subsystem
30
31
32
33
34
35
36
DISPlay Subsystem
MARKer Subsystem
MEASure Subsystem
TIMebase Subsystem
TRIGger Subsystem
WAVeform Subsystem
Programming Examples
Index
vii
viii

Contents

Part 1 General Information
1 Introduction to Programming
Talking to the Instrument 1–3
Initialization 1–4 Instruction Syntax 1–5 Output Command 1–5 Device Address 1–6 Instructions 1–6 Instruction Terminator 1–7 Header Types 1–8 Duplicate Keywords 1–9 Query Usage 1–10 Program Header Options 1–11 Parameter Data Types 1–12 Selecting Multiple Subsystems 1–14
Receiving Information from the Instrument 1–15
Response Header Options 1–16 Response Data Formats 1–17 String Variables 1–18 Numeric Base 1–19 Numeric Variables 1–19 Definite-Length Block Response Data 1–20 Multiple Queries 1–21 Instrument Status 1–22
2 Programming Over GPIB
Interface Capabilities 2–3 Command and Data Concepts 2–3 Addressing 2–3 Communicating Over the GPIB Bus (HP 9000 Series 200/300 Controller) 2–4 Local, Remote, and Local Lockout 2–5 Bus Commands 2–6
Contents–1
Contents
3 Programming Over RS-232C
Interface Operation 3–3 RS-232C Cables 3–3 Minimum Three-Wire Interface with Software Protocol 3–4 Extended Interface with Hardware Handshake 3–4 Cable Examples 3–6 Configuring the Logic Analzer Interface 3–8 Interface Capabilities 3–9 RS-232C Bus Addressing 3–10 Lockout Command 3–11
4 Programming and Documentation Conventions
Truncation Rule 4–3 Infinity Representation 4–4 Sequential and Overlapped Commands 4–4 Response Generation 4–4 Syntax Diagrams 4–4 Notation Conventions and Definitions 4–5 The Command Tree 4–5 Tree Traversal Rules 4–6 Command Set Organization 4–14 Subsystems 4–15 Program Examples 4–16
5 Message Communication and System Functions
Protocols 5–3 Syntax Diagrams 5–5 Syntax Overview 5–7
6 Status Reporting
Event Status Register 6–4 Service Request Enable Register 6–4 Bit Definitions 6–4 Key Features 6–6 Serial Poll 6–7
Contents–2
7 Error Messages
Device Dependent Errors 7–3 Command Errors 7–3 Execution Errors 7–4 Internal Errors 7–4 Query Errors 7–5
Part 2 Mainframe Commands
8 Common Commands
*CLS (Clear Status) 8–5 *ESE (Event Status Enable) 8–6 *ESR (Event Status Register) 8–7 *IDN (Identification Number) 8–9 *IST (Individual Status) 8–9 *OPC (Operation Complete) 8–11 *OPT (Option Identification) 8–12 *PRE (Parallel Poll Enable Register Enable) 8–13 *RST (Reset) 8–14 *SRE (Service Request Enable) 8–15 *STB (Status Byte) 8–16 *TRG (Trigger) 8–17 *TST (Test) 8–18 *WAI (Wait) 8–19
Contents
9 Mainframe Commands
BEEPer 9–6 CAPability 9–7 CARDcage 9–8 CESE (Combined Event Status Enable) 9–9 CESR (Combined Event Status Register) 9–10 EOI (End Or Identify) 9–11 LER (LCL Event Register) 9–11 LOCKout 9–12 MENU 9–12
Contents–3
Contents
MESE<N> (Module Event Status Enable) 9–14 MESR<N> (Module Event Status Register) 9–16 RMODe 9–18 RTC (Real-time Clock) 9–19 SELect 9–20 SETColor 9–22 STARt 9–23 STOP 9–24
10 SYSTem Subsystem
DATA 10–5 DSP (Display) 10–6 ERRor 10–7 HEADer 10–8 LONGform 10–9 PRINt 10–10 SETup 10–11
11 MMEMory Subsystem
AUToload 11–8 CATalog 11–9 COPY 11–10 DOWNload 11–11 INITialize 11–13 LOAD [:CONFig] 11–14 LOAD :IASSembler 11–15 MSI (Mass Storage Is) 11–16 PACK 11–17 PURGe 11–17 REName 11–18 STORe [:CONFig] 11–19 UPLoad 11–20 VOLume 11–21
Contents–4
12 INTermodule Subsystem
:INTermodule 12–5 DELete 12–5 HTIMe 12–6 INPort 12–6 INSert 12–7 SKEW<N> 12–8 TREE 12–9 TTIMe 12–10
Part 3 Logic Analyzer Commands
13 MACHine Subsystem
MACHine 13–4 ARM 13–5 ASSign 13–5 LEVelarm 13–6 NAME 13–7 REName 13–8 RESource 13–9 TYPE 13–10
Contents
14 WLISt Subsystem
WLISt 14–4 DELay 14–5 INSert 14–6 LINE 14–7 OSTate 14–8 OTIMe 14–8 RANGe 14–9 REMove 14–10 XOTime 14–10 XSTate 14–11 XTIMe 14–11
Contents–5
Contents
15 SFORmat Subsystem
SFORmat 15–6 CLOCk 15–6 LABel 15–7 MASTer 15–9 MODE 15–10 MOPQual 15–11 MQUal 15–12 REMove 15–13 SETHold 15–13 SLAVe 15–15 SOPQual 15–16 SQUal 15–17 THReshold 15–18
16 STRigger (STRace) Subsystem
Qualifier 16–7 STRigger (STRace) 16–9 ACQuisition 16–9 BRANch 16–10 CLEar 16–12 FIND 16–13 RANGe 16–14 SEQuence 16–16 STORe 16–17 TAG 16–18 TAKenbranch 16–19 TCONtrol 16–20 TERM 16–21 TIMER 16–22 TPOSition 16–23
17 SLISt Subsystem
SLISt 17–7 COLumn 17–7
Contents–6
CLRPattern 17–8 DATA 17–9 LINE 17–9 MMODe 17–10 OPATtern 17–11 OSEarch 17–12 OSTate 17–13 OTAG 17–13 OVERlay 17–14 REMove 17–15 RUNTil 17–15 TAVerage 17–17 TMAXimum 17–17 TMINimum 17–18 VRUNs 17–18 XOTag 17–19 XOTime 17–19 XPATtern 17–20 XSEarch 17–21 XSTate 17–22 XTAG 17–22
Contents
18 SWAVeform Subsystem
SWAVeform 18–4 ACCumulate 18–5 ACQuisition 18–5 CENTer 18–6 CLRPattern 18–6 CLRStat 18–7 DELay 18–7 INSert 18–8 RANGe 18–8 REMove 18–9 TAKenbranch 18–9 TPOSition 18–10
Contents–7
Contents
19 SCHart Subsystem
SCHart 19–4 ACCumulate 19–4 HAXis 19–5 VAXis 19–7
20 COMPare Subsystem
COMPare 20–4 CLEar 20–5 CMASk 20–5 COPY 20–6 DATA 20–7 FIND 20–9 LINE 20–10 MENU 20–10 RANGe 20–11 RUNTil 20–12 SET 20–13
21 TFORmat Subsystem
TFORmat 21–4 ACQMode 21–5 LABel 21–6 REMove 21–7 THReshold 21–8
22 TTRigger (TTRace) Subsystem
Qualifier 22–6 TTRigger (TTRace) 22–8 ACQuisition 22–9 BRANch 22–9 CLEar 22–12 FIND 22–13 GLEDge 22–14 RANGe 22–15
Contents–8
SEQuence 22–17 SPERiod 22–18 TCONtrol 22–19 TERM 22–20 TIMER 22–21 TPOSition 22–22
23 TWAVeform Subsystem
TWAVeform 23–7 ACCumulate 23–7 ACQuisition 23–8 CENTer 23–8 CLRPattern 23–9 CLRStat 23–9 DELay 23–9 INSert 23–10 MMODe 23–11 OCONdition 23–12 OPATtern 23–13 OSEarch 23–14 OTIMe 23–15 RANGe 23–16 REMove 23–16 RUNTil 23–17 SPERiod 23–18 TAVerage 23–19 TMAXimum 23–19 TMINimum 23–20 TPOSition 23–20 VRUNs 23–21 XCONdition 23–22 XOTime 23–22 XPATtern 23–23 XSEarch 23–24 XTIMe 23–25
Contents
Contents–9
Contents
24 TLISt Subsystem
TLISt 24–7 COLumn 24–7 CLRPattern 24–8 DATA 24–9 LINE 24–9 MMODe 24–10 OCONdition 24–11 OPATtern 24–11 OSEarch 24–12 OSTate 24–13 OTAG 24–14 REMove 24–14 RUNTil 24–15 TAVerage 24–16 TMAXimum 24–16 TMINimum 24–17 VRUNs 24–17 XCONdition 24–18 XOTag 24–18 XOTime 24–19 XPATtern 24–19 XSEarch 24–20 XSTate 24–21 XTAG 24–22
25 SYMBol Subsystem
SYMBol 25–4 BASE 25–5 PATTern 25–6 RANGe 25–6 REMove 25–7 WIDTh 25–8
Contents–10
26 DATA and SETup Commands
Data Format 26–3 :SYSTem:DATA 26–4 Section Header Description 26–6 Section Data 26–6 Data Preamble Description 26–6 Acquisition Data Description 26–10 Time Tag Data Description 26–12 Glitch Data Description 26–14 SYSTem:SETup 26–15 RTC_INFO Section Description 26–17
Part 4 Oscilloscope Commands
Contents
27 Oscilloscope Root Level Commands
AUToscale 27–3 DIGitize 27–5
28 ACQuire Subsystem
COUNt 28–4 TYPE 28–4
29 CHANnel Subsystem
COUPling 29–4 ECL 29–5 OFFSet 29–6 PROBe 29–7 RANGe 29–8 TTL 29–9
30 DISPlay Subsystem
ACCumulate 30–4 CONNect 30–5 INSert 30–5
Contents–11
Contents
LABel 30–7 MINus 30–8 OVERlay 30–8 PLUS 30–9 REMove 30–9
31 MARKer Subsystem
AVOLt 31–6 ABVolt? 31–7 BVOLt 31–7 CENTer 31–8 MSTats 31–8 OAUTo 31–9 OTIMe 31–10 RUNTil 31–11 SHOW 31–12 TAVerage? 31–12 TMAXimum? 31–13 TMINimum? 31–13 TMODe 31–14 VMODe 31–15 VOTime? 31–16 VRUNs? 31–16 VXTime? 31–17 XAUTo 31–18 XOTime? 31–19 XTIMe 31–19
32 MEASure Subsystem
ALL? 32–5 FALLtime? 32–6 FREQuency? 32–6 NWIDth? 32–7 OVERshoot? 32–7 PERiod? 32–8 PREShoot? 32–8
Contents–12
PWIDth? 32–9 RISetime? 32–9 SOURce 32–10 VAMPlitude? 32–11 VBASe? 32–11 VMAX? 32–12 VMIN? 32–12 VPP? 32–13 VTOP? 32–13
33 TIMebase Subsystem
DELay 33–4 MODE 33–5 RANGe 33–6
Contents
34 TRIGger Subsystem
CONDition 34–5 DELay 34–7 LEVel 34–8 LOGic 34–10 MODE 34–11 PATH 34–12 SLOPe 34–12 SOURce 34–13
35 WAVeform Subsystem
Format for Data Transfer 35–4 Data Conversion 35–6 COUNt? 35–9 DATA? 35–9 FORMat 35–10 POINts? 35–10 PREamble? 35–11 RECord 35–12 SOURce 35–12
Contents–13
Contents
SPERiod? 35–13 TYPE? 35–13 VALid? 35–14 XINCrement? 35–15 XORigin? 35–16 XREFerence? 35–16 YINCrement? 35–17 YORigin? 35–17 YREFerence? 35–18
Part 5 Programming Examples
36 Programming Examples
Making a Timing analyzer measurement 36–3 Making a State analyzer measurement 36–5 Making a State Compare measurement 36–9 Transferring the logic analyzer configuration 36–14 Transferring the logic analyzer acquired data 36–17 Checking for measurement completion 36–21 Sending queries to the logic analyzer 36–22 Getting ASCII Data with PRINt? ALL Query 36–24 Reading the disk with the CATalog? ALL query 36–25 Reading the Disk with the CATalog? Query 36–26 Printing to the disk 36–27 Transferring waveform data in Byte format 36–28 Transferring waveform data in Word format 36–30 Using AUToscale and the MEASure:ALL? Query 36–32 Using Sub-routines in a measurement program 36–33
Contents–14
Part 1

General Information

1

Introduction to Programming

Introduction
This chapter introduces you to the basics of remote programming and is organized in two sections. The first section, "Talking to the Instrument," concentrates on initializing the bus, program syntax and the elements of a syntax instuction. The second section, "Receiving Information from the Instrument," discusses how queries are sent and how to retrieve query results from the mainframe instruments.
The programming instructions explained in this book conform to IEEE Std 488.2-1987, "IEEE Standard Codes, Formats, Protocols, and Common Commands." These programming instructions provide a means of remotely controlling the 1660-series logic analyzers. There are three general categories of use. You can:
Set up the instrument and start measurements
Retrieve setup information and measurement results
Send measurement data to the instrument
The instructions listed in this manual give you access to the measurements and front panel features of the 1660-series logic analyzers. The complexity of your programs and the tasks they accomplish are limited only by your imagination. This programming reference is designed to provide a concise description of each instruction.
1–2

Talking to the Instrument

In general, computers acting as controllers communicate with the instrument by sending and receiving messages over a remote interface, such as GPIB or RS-232C. Instructions for programming the 1660-series logic analyzers will normally appear as ASCII character strings embedded inside the output statements of a "host" language available on your controller. The host language’s input statements are used to read in responses from the 1660-series logic analyzers.
For example, HP 9000 Series 200/300 BASIC uses the OUTPUT statement for sending commands and queries to the 1660-series logic analyzers. After a query is sent, the response can be read in using the ENTER statement. All programming examples in this manual are presented in HP BASIC.
Example This Basic statement sends a command that causes the logic analyzer’s
machine 1 to be a state analyzer:
OUTPUT XXX;":MACHINE1:TYPE STATE" <terminator>
Each part of the above statement is explained in this section.
1–3
Introduction to Programming
Initialization
Initialization
To make sure the bus and all appropriate interfaces are in a known state, begin every program with an initialization statement. BASIC provides a CLEAR command that clears the interface buffer. If you are using GPIB, CLEAR will also reset the parser in the logic analyzer. The parser is the program resident in the logic analyzer that reads the instructions you send to it from the controller.
After clearing the interface, you could preset the logic analyzer to a known state by loading a predefined configuration file from the disk.
Refer to your controller manual and programming language reference manual for information on initializing the interface.
Example This BASIC statement would load the configuration file "DEFAULT " (if it
exists) into the logic analyzer.
OUTPUT XXX;":MMEMORY:LOAD:CONFIG ’DEFAULT ’"
Refer to chapter 10, "MMEMory Subsystem" for more information on the LOAD command.
Example Program This program demonstrates the basic command structure used to program
the 1660-series logic analyzers.
10 CLEAR XXX !Initialize instrument interface 20 OUTPUT XXX;":SYSTEM:HEADER ON"!Turn headers on 30 OUTPUT XXX;":SYSTEM:LONGFORM ON" !Turn longform on 40 OUTPUT XXX;":MMEM:LOAD:CONFIG ’TEST E’" !Load configuration file 50 OUTPUT XXX;":MENU FORMAT,1" !Select Format menu for machine 1 60 OUTPUT XXX;":RMODE SINGLE" !Select run mode 70 OUTPUT XXX;":START" !Run the measurement
1–4
Figure 1-1
Introduction to Programming
Instruction Syntax
Instruction Syntax
To program the logic analyzer remotely, you must have an understanding of the command format and structure. The IEEE 488.2 standard governs syntax rules pertaining to how individual elements, such as headers, separators, parameters and terminators, may be grouped together to form complete instructions. Syntax definitions are also given to show how query responses will be formatted. Figure 1-1 shows the three main syntactical parts of a typical program statement: Output Command, Device Address, and Instruction. The instruction is further broken down into three parts: Instruction header, White space, and Instruction parameters.
Program Message Syntax
Output Command
The output command depends on the language you choose to use. Throughout this guide, HP 9000 Series 200/300 BASIC 6.2 is used in the programming examples. If you use another language, you will need to find the equivalents of Basic Commands, like OUTPUT, ENTER and CLEAR in order to convert the examples. The instructions are always shown between the double quotes.
1–5
Introduction to Programming
Device Address
Device Address
The location where the device address must be specified also depends on the host language that you are using. In some languages, this could be specified outside the output command. In BASIC, this is always specified after the keyword OUTPUT. The examples in this manual use a generic address of XXX. When writing programs, the number you use will depend on the cable you use, in addition to the actual address. If you are using an GPIB, see chapter 2, "Programming over GPIB." If you are using RS-232C, see chapter 3, "Programming Over RS-232C."
Instructions
Instructions (both commands and queries) normally appear as a string embedded in a statement of your host language, such as BASIC, Pascal or C. The only time a parameter is not meant to be expressed as a string is when the instruction’s syntax definition specifies block data. There are just a few instructions which use block data.
Instructions are composed of two main parts: the header, which specifies the command or query to be sent; and the parameters, which provide additional data needed to clarify the meaning of the instruction. Many queries do not use any parameters.
Instruction Header
The instruction header is one or more keywords separated by colons (:). The command tree in figure 4-1 illustrates how all the keywords can be joined together to form a complete header (see chapter 4, "Programming and Documentation Conventions").
The example in figure 1-1 shows a command. Queries are indicated by adding a question mark (?) to the end of the header. Many instructions can be used as either commands or queries, depending on whether or not you have included the question mark. The command and query forms of an instruction usually have different parameters.
1–6
Loading...
+ 546 hidden pages