This programmer’s guide contains general
information, instrument level commands,
logic analyzer commands, and
programming examples for programming
the HP 1670D-series logic analyzers. This
guide focuses on how to program the
instrument over the HP-IB and the
RS-232-C interfaces. For information on
using Ethernet refer to the LAN User’s
Guide.
What is in the HP1670D-Series
Programmer’s Guide?
The HP1670D-Series Programmer’s
Guide is organized in four parts.
Part 1 Part 1 consists of chapters 1
through 7 and contains general
information about programming basics,
HP-IB and RS-232-C interface
requirements, documentation
conventions, status reporting, and error
messages.
2
3
4
5
6
7
8
9
10
Programming Over HP-IB
Programming Over RS-232-C
Programming and
Document ation Conventions
Message Communica ti on
and System Functions
Status Reporting
Error Messages
Common Commands
Instrument Commands
Module Level Commands
If you are already familiar with IEEE
488.2 programming and HP-IB or
RS-232-C, you may want to just scan
these chapters. If you are new to
programming the system, you should
read part 1.
11
12
13
14
SYSTem Subsystem
MMEMory Subsystem
MACHine Subsystem
WLISt Subsystem
iii
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 HP-IB," or chapter 3,
"Programming Over RS-232-C" for information concerning the physical
connection between the HP 1670D-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, explains each command in the
command set for the entire logic analyzer. 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,
instrument commands, system level commands, disk commands,
intermodule measurement, and module level commands. This part is
designed to provide a concise description of each command.
Part 3 Part 3, chapters 13 through 27, explains each command in the
subsystem command set for the logic analyzer. Chapter 27 contains
information on the SYSTem:DATA and SYSTem:SETup commands for
the logic analyzer.
Part 4 Part 4 , chapter 28, contains program examples of actual tasks
that show you how to get started in programming the HP 1670D-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 HP-IB or RS-232 buses.
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 HP-IB
Interface Capabilities 2–3
Command and Data Concepts 2–3
Addressing 2–3
Communicating Over the HP-IB Bus 2–4
Local, Remote, and Local Lockout 2–5
Bus Commands 2–6
Contents–1
Contents
3 Programming Over RS-232-C
Interface Operation 3–3
RS-232-C 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 Analyzer Interface 3–8
Interface Capabilities 3–9
RS-232-C 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–12
Subsystems 4–12
Program Examples 4–13
SYMBol 26–5
BASE 26–5
PATTern 26–6
RANGe 26–7
REMove 26–8
WIDTh 26–8
27 DATA and SETup Commands
Introduction 27–2
Data Format 27–3
SYSTem:DATA 27–4
Section Header Description 27–6
Contents–11
Contents
Section Data 27–6
Data Preamble Description 27–6
Acquisition Data Description 27–10
Tag Data Description 27–12
SYSTem:SETup 27–12
Part 4 Programming Examples
28 Programming Examples
Making a Timing Analyzer Measurement 28–3
Making a State Analyzer Measurement 28–5
Making a State Compare Measurement 28–9
Transferring the Logic Analyzer Configuration 28–14
Checking for Measurement Completion 28–17
Sending Queries to the Logic Analyzer 28–18
Index
Contents–12
Part 1
General Information
1
Introduction to Programming
the HP 1670D
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 HP 1670D-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 HP 1670D-series. 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 HP-IB or RS-232-C. Instructions for programming
the HP 1670D-series 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 HP 1670D-series.
For example, HP 9000 Series 200/300 BASIC uses the OUTPUT
statement for sending commands and queries to the HP 1670D-series.
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.
ExampleThis 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 the HP 1670D
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 HP-IB,
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.
ExampleThis BASIC statement would load the configuration file "DEFAULT " (if it
exists) into the logic analyzer.
OUTPUT XXX;":MMEMORY:LOAD:CONFIG ’DEFAULT ’"
Refer to chapter 12, "MMEMory Subsystem" for more information on the
LOAD command.
Example This program demonstrates the basic command structure used to program
the HP 1670D-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 OU TPUT XXX;":START"!Ru n the measurement
1–4
Figure 1-1
Introduction to Programming t he HP 1670D
Instr uction 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 the HP 1670D
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 HP-IB, see
chapter 2, "Programming over HP-IB." If you are using RS-232-C, see
chapter 3, "Programming Over RS-232-C."
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
Introduction to Programming t he HP 1670D
Instruction Terminator
When you look up a query in this programmer’s reference, you’ll find a
paragraph labeled "Returned Format" under the one labeled "Query." The
syntax definition by "Returned format" will always show the instruction
header in square brackets, like [:SYSTem:MENU], which means the text
between the brackets is optional. It is also a quick way to see what the
header looks like.
White Space
White space is used to separate the instruction header from the instruction
parameters. If the instruction does not use any parameters, white space
does not need to be included. White space is defined as one or more spaces.
ASCII defines a space to be a character, represented by a byte, that has a
decimal value of 32. Tabs can be used only if your controller first converts
them to space characters before sending the string to the instrument.
Instruction Parameters
Instruction parameters are used to clarify the meaning of the command or
query. They provide necessary data, such as: whether a function should be
on or off, which waveform is to be displayed, or which pattern is to be looked
for. Each instruction’s syntax definition shows the parameters, as well as the
range of acceptable values they accept. This chapter’s "Parameter Data
Types" section has all of the general rules about acceptable values.
When there is more than one parameter, they are separated by commas (,).
White space surrounding the commas is optional.
Instruction Terminator
An instruction is executed after the instruction terminator is received. The
terminator is the NL (New Line) character. The NL character is an ASCII
linefeed character (decimal 10).
The NL (New Line) terminator has the same function as an EOS (End Of
String) and EOT (End Of Text) terminator.
1–7
Introduction to Programming the HP 1670D
Header Types
Header Types
There are three types of headers: Simple Command, Compound Command,
and Common Command.
Simple Command Header
Simple command headers contain a single keyword. START and STOP are
examples of simple command headers typically used in this logic analyzer.
The syntax is: <function><terminator>
When parameters (indicated by <data>) must be included with the simple
command header, the syntax is: <function><white_space><data>
<terminator>
Example:RM ODE SINGLE<terminator>
Compound Command Header
Compound command headers are a combination of two or more program
keywords. The first keyword selects the subsystem, and the last keyword
selects the function within that subsystem. Sometimes you may need to list
more than one subsystem before being allowed to specify the function. The
keywords within the compound header are separated by colons. For
example, to execute a single function within a subsystem, use the following:
To traverse down one level of a subsystem to execute a subsystem within
that subsystem, use the following:
<subsystem>:<subsystem>:<function><white_space>
<data><terminator>
Example:MMEMORY:LOAD:CONFIG "FILE "
1–8
Common Command Header
Common command headers control IEEE 488.2 functions within the logic
analyzer, such as, clear status. The syntax is:
*<command header><terminator>
No white space or separator is allowed between the asterisk and the
command header. *CLS is an example of a common command header.
Combined Commands in the Same Subsystem
To execute more than one function within the same subsystem, a semicolon
(;) is used to separate the functions:
Identical function keywords can be used for more than one subsystem. For
example, the function keyword MMODE may be used to specify the marker
mode in the subsystem for state listing or the timing waveforms:
• :SLIST:MMODE PATTERN - sets the marker mode to pattern in
the state listing.
• :TWAVEFORM:MMODE TIME - sets the marker mode to time in the
timing waveforms.
SLIST and TWAVEFORM are subsystem selectors, and they determine which
marker mode is being modified.
1–9
Introduction to Programming the HP 1670D
Query Usage
Query Usage
Logic analyzer instructions that are immediately followed by a question mark
(?) are queries. After receiving a query, the logic analyzer parser places the
response in the output buffer. The output message remains in the buffer
until it is read or until another logic analyzer instruction is issued. When
read, the message is transmitted across the bus to the designated listener
(typically a controller).
Query commands are used to find out how the logic analyzer is currently
configured. They are also used to get results of measurements made by the
logic analyzer.
ExampleThis instruction places the current full-screen time for machine 1 in the
output buffer.
:MAC HINE1:TWAVEFORM:RA NGE?
In order to prevent the loss of data in the output buffer, the output buffer
must be read before the next program message is sent. Sending another
command before reading the result of the query will cause the output buffer
to be cleared and the current response to be lost. This will also generate a
"QUERY UNTERMINATED" error in the error queue. For example, when you
send the query :TWAVEFORM:RANGE? you must follow that with an input
statement. In BASIC, this is usually done with an ENTER statement.
In BASIC, the input statement, ENTER XXX; Range, passes the value
across the bus to the controller and places it in the variable Range.
Additional details on how to use queries is in the next section of this chapter,
"Receiving Information for the Instrument."
1–10
Loading...
+ 426 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.