Publication number 16500-97018
First edition, December 1996
For Safety information, Warranties, and Regulatory
information, see the pages behind the Index
Copyright Hewlett-Packard Company 1987, 1990, 1993, 1994, 1996
All Rights Reserved
HP 16500C/16501A
Logic Analysis System
ii
In This Book
This programmer’s guide contains general
information, mainframe level commands,
and programming examples for
programming the HP 16500C/16501A
Logic Analysis System. This guide
focuses on how to program the system
over the HP-IB interface, but also briefly
explains how to use the RS-232-C and
LAN interfaces. The Logic Analysis
System cannot be programmed over the
16505 interface.
This guide provides a complete set of
programming information for your system.
Introduction to Programming
1
Programming Over HP-IB
2
Programming Over RS-232-C
3
Programming Over LAN
4
Programming and
5
Documentation Conventions
Message Communication
6
and System Functions
Status Reporting
7
Organization
When you received your HP 16500C
Programmer’s Guide you received two
binders, Volume 1 and Volume 2. The
Volume 2 binder gives you a place to
insert the module programmer’s guides
when the Volume 1 binder is full.
As you purchase additional measurement
modules, insert their programmer’s
guides in the back of this binder or in the
second binder.
What is in the HP 16500C/16500A
Programmer’s Guide?
The HP 16500C/16501A Programmer’s
Guide is organized in three parts.
8
9
10
11
12
13
14
15
Error Messages
Common Commands
Mainframe Commands
SYSTem Subsystem
MMEMory Subsystem
INTermodule Subsystem
TGTctrl Subsystem
Programming Examples
iii
Part 1 Part 1 consists of chapters 1 through 8 and contains general
information about programming basics, HP-IB, RS-232-C, and LAN
interface requirements, documentation conventions, status reporting,
and error messages. 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 logic analyzers 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 HP-IB," chapter 3, "Programming
Over RS-232-C," or chapter 4, "Programming over LAN" for information
concerning the physical connection between the HP 16500C/16501A Logic
Analysis System and your controller.
Chapter 5, "Programming and Documentation Conventions," gives an
overview of all instructions and also explains the notation conventions used
in the syntax definitions and examples.
Chapter 6, "Message Communication and System Functions," provides an
overview of the operation of instruments that operate in compliance with the
IEEE 488.2 standard.
Chapter 7 explains status reporting and how it can be used to monitor the
flow of your programs and measurement process.
Chapter 8 contains error message descriptions.
Part 2 Part 2, chapters 9 through 14, explain each command in the
command set for the mainframe. These chapters are organized in
subsystems with each subsystem representing a menu.
The commands explained in this part give you access to common commands,
mainframe commands, system level commands, disk commands, intermodule
measurement, and target control commands. This part is designed to provide
a concise description of each command.
Part 3 Part 3, chapter 15, contains program examples of actual tasks
that show you how to get started in programming the HP 16500C/
16501A Logic Analysis System at the mainframe level. 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, RS-232-C, or LAN.
Receiving Information from the Logic Analysis System 1–16
Response Header Options 1–17
Response Data Formats 1–18
String Variables 1–19
Numeric Base 1–20
Numeric Variables 1–20
Definite-Length Block Response Data 1–21
Multiple Queries 1–22
System Status 1–23
Contents–1
Contents
2 Programming Over HP-IB
Interface Capabilities 2–3
Command and Data Concepts 2–3
Talk/Listen Addressing 2–3
HP-IB Bus Addressing 2–4
Local, Remote, and Local Lockout 2–5
Bus Commands 2–6
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–5
Cable Examples 3–6
Configuring the Logic Analysis System Interface 3–7
Interface Capabilities 3–8
RS-232-C Bus Addressing 3–9
Lockout Command 3–10
4 Programming Over LAN
Communicating with the HP 16500C 4–3
LAN Addressing 4–3
Password Protection and File Protection 4–4
Permission Levels: Control and Data 4–4
Controlling the HP 16500C 4–5
Echoing Commands 4–6
Copying Command Files 4–7
Writing to \system\program from a Program 4–8
Sending Commands to the HP 16500C Socket 4–11
Lockout Command 4–13
Contents–2
5 Programming and Documentation Conventions
Truncation Rule 5–3
Infinity Representation 5–4
Sequential and Overlapped Commands 5–4
Response Generation 5–4
Syntax Diagrams 5–4
Notation Conventions and Definitions 5–5
The Command Tree 5–6
Tree Traversal Rules 5–8
Command Set Organization 5–10
Subsystems 5–10
Program Examples 5–12
:TGTctrl 14–5
ALL 14–6
AVAILable 14–7
BITS 14–8
CURSTate 14–9
DRIVe 14–9
LASTstate 14–10
NAMe 14–11
PULse 14–12
SIGNal 14–12
SIGSTatus 14–13
STATEs 14–14
STEP 14–15
TOGgle 14–15
TYPe 14–16
Contents–6
Part 3 Programming Examples
15 Programming Examples
Transferring the Mainframe Configuration 15–3
Checking for Intermodule Measurement Completion 15–6
Sending Queries to the Logic Analysis System 15–7
Getting ASCII Data with PRINt? ALL Query 15–9
Reading the disk with the CATalog? ALL query 15–10
Reading the Disk with the CATalog? Query 15–11
Printing to the disk 15–12
Index
Contents
Contents–7
Contents–8
Part 1
1 Introduction to Programming 1-1
2 Programming Over HP-IB 2-1
3 Programming Over RS-232-C 3-1
4 Programming Over LAN 4-1
5 Programming and Documentation Conventions 5-1
6 Message Communication and System Functions 6-1
7 Status Reporting 7-1
8 Error Messages 8-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 Logic
Analysis System," concentrates on initializing the bus, program syntax
and the elements of instruction syntax. The second section,
"Receiving Information from the Logic Analysis System," discusses
how queries are sent and how to retrieve query results from the
system.
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 16500C Logic Analysis System.
There are three general categories of use. You can:
• Set up the system and start measurements
• Retrieve setup information and measurement results from the
measurement modules
• Send measurement data to the measurement modules
The instructions listed in this manual give you access to the functions
of the mainframe. This programming reference is designed to provide
a concise description of each instruction for the mainframe.
Individual module instruction descriptions are in the Programmer’sGuide for each respective module.
1–2
Talking to the Logic Analysis System
In general, computers acting as controllers communicate with the instrument
by sending and receiving messages over a remote interface, such as HP-IB,
RS-232-C, or Ethernet LAN.
When programming the HP 16500C with the HP 16501A Expansion Frame
connected, most of the remote operation of the expansion frame is
transparent. The only time a programming command is affected by the
presence of the expansion frame is when the number of slots is specified or
returned from a query.
Instructions for programming the system 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 system. For example, HP 9000 Series 300
BASIC uses the OUTPUT statement for sending commands and queries to
the system. 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
Talking to Individual System Modules
Talking to Individual System Modules
Talking to individual system modules within the HP 16500C Logic Analysis
System is done by preceding the module commands with the SELECT
command and the number of the slot in which the desired module is installed.
The mainframe is selected in the same way as an installed module by using
the SELECT 0 command.
ExampleTo select the module in slot 3 use the following:
OUTPUT XXX;":SELECT 3"
See AlsoChapter 10, "Mainframe Commands" for more information on the SELECT
command.
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 Analysis System. The parser is
the program resident in the Logic Analysis System that reads the instructions
you send to it from the controller.
After clearing the interface, you could, for example, preset the logic analyzer
module 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.
1–4
Introduction to Programming
Initialization
ExampleThis BASIC statement would load the configuration file "DEFAULT " (if it
exists) into the system.
OUTPUT XXX;":MMEMORY:LOAD:CONFIG ’DEFAULT ’"
ExampleThis program demonstrates a simple HP BASIC command structure used to
program the Logic Analysis System.
10 CLEAR XXX !Initialize instrument interface
20 OUTPUT XXX;":SYSTEM:HEADER ON" !Turn headers on
30 OUTPUT XXX;":SYSTEM:LONGFORM ON" !Turn long form on
40 DIM Card$[100] !Reserve memory for string variable
50 OUTPUT XXX;":CARDCAGE?" !Verify which modules are loaded
60 ENTER XXX;Card$ !Enter result in a string variable
70 PRINT Card$ !Print result of query
80 OUTPUT XXX;":MMEM:LOAD:CONFIG ’TEST._E’,5" !Load configuration file
!into module in slot E
90 OUTPUT XXX;":SELECT 5" !Select module in slot E
100 OUTPUT XXX;":MENU 5,3: !Select menu for module in slot E
110 OUTPUT XXX;":RMODE SINGLE" !Select run mode
120 OUTPUT XXX;":START" !Run the measurement
See AlsoChapter 12, "MMEMory Subsystem" for more information on the LOAD
command.
1–5
Figure 1-1
Introduction to Programming
Instruction Syntax
Instruction Syntax
To program the system 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 300 BASIC 6.2 is used in the
programming examples, except where noted. 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–6
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
protocol you use, in addition to the actual address. If you are using HP-IB,
see chapter 2, "Programming Over HP-IB." If you are using RS-232-C, see
chapter 3, "Programming Over RS-232-C." If you are using Ethernet LAN, see
chapter 4, "Programming Over LAN."
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 for the mainframe in figure 5-1 illustrates how all the
keywords can be joined together to form a complete header (see chapter 5,
"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–7
Introduction to Programming
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 system.
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–8
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. 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>
Introduction to Programming
Header Types
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–9
Introduction to Programming
Duplicate Keywords
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.
Example*CLS
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–10
Introduction to Programming
Query Usage
Query Usage
Logic analysis system instructions that are immediately followed by a
question mark (?) are queries. After receiving a query, the Logic Analysis
System parser places the response in the output buffer. The output message
remains in the buffer until it is read or until another 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 system is currently
configured. They are also used to get results of measurements made by the
modules in the system.
ExampleThis instruction places the current full-screen time for machine 1 of the logic
analyzer module in slot 2 in the output buffer.
:SEL EC T 2: MACHINE1:T WAVEFORM:R ANGE?
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 :SELECT 2: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 from the Logic Analysis System."
1–11
Introduction to Programming
Program Header Options
Program Header Options
Program headers can be sent using any combination of uppercase or
lowercase ASCII characters. System responses, however, are always
returned in uppercase.
Both program command and query headers may be sent in either long form
(complete spelling), short form (abbreviated spelling), or any combination of
long form and short form.
Programs written in long form are easily read and are almost selfdocumenting. The short form syntax conserves the amount of controller
memory needed for program storage and reduces the amount of I/O activity.
The rules for short form syntax are discussed in chapter 5, "Programming and
Documentation Conventions."
ExampleEither of the following examples turns on the headers and long form.
Long form:
OUT PUT XXX;":SYSTEM:HEADER ON ;LONGFORM ON"
Short form:
OUT PUT XXX;":SYST:HEAD ON;LON G ON"
1–12
Introduction to Programming
Parameter Data Types
Parameter Data Types
There are three main types of data which are used in parameters. The types
are numeric, string, and keyword. A fourth type, block data, is used only for a
few instructions: the DATA and SETup instructions in the SYSTem subsystem
(see chapter 11); the CATalog, UPLoad, and DOWNload instructions in the
MMEMory subsystem (see chapter 12). These syntax rules also show how
data may be formatted when sent back from the system as a response.
The parameter list always follows the instruction header and is separated
from it by white space. When more than one parameter is used, they are
separated by commas. You are allowed to include one or more white spaces
around the commas, but it is not mandatory.
Numeric data
For numeric data, you have the option of using exponential notation or using
suffixes to indicate which unit is being used. However, exponential notation
is only applicable to the decimal number base. Do not combine an exponent
with a unit.
See AlsoTables 6-1 and 6-2 in chapter 6, "Message Communications and System
Functions," list all available suffixes.
ExampleThe following numbers are all equal:
28 = 0.28E2 = 280E-1 = 28000m = 0.028K.
The system will recognize binary, octal, and hexadecimal base numbers. The
base of a number is specified with a prefix. The recognized prefixes are #B
for binary, #Q for octal, and #H for hexadecimal. The absence of a prefix
indicates the number is decimal which is the default base.
ExampleThe following numbers are all equal:
#B11100 = #Q34 = #H1C = 28
1–13
Introduction to Programming
Parameter Data Types
You may not specify a base in conjunction with either exponents or unit
suffixes. Additionally, negative numbers must be expressed in decimal.
When a syntax definition specifies that a number is an integer, that means
that the number should be whole. Any fractional part would be ignored,
truncating the number. Numeric parameters that accept fractional values are
called real numbers.
All numbers are expected to be strings of ASCII characters. Thus, when
sending the number 9, you send a byte representing the ASCII code for the
character "9" (which is 57, or 0011 1001 in binary). A three-digit number,
like 102, will take up three bytes (ASCII codes 49, 48 and 50). This is taken
care of automatically when you include the entire instruction in a string.
String data
String data may be delimited with either single (’) or double (") quotes.
String parameters representing labels are case-sensitive. For instance, the
labels "Bus A" and "bus a" are unique and can not be used interchangeably.
Also pay attention to the presence of spaces, because they act as legal
characters just like any other. So, the labels "In" and " In" are also two
different labels.
Keyword data
In many cases a parameter must be a keyword. The available keywords are
always included with the instruction’s syntax definition. When sending
commands, either the long form or short form (if one exists) may be used.
Uppercase and lowercase letters may be mixed freely. When receiving
responses, uppercase letters will be used exclusively. The use of long form
or short form in a response depends on the setting you last specified via the
:SYSTem:LONGform command.
1–14
Introduction to Programming
Selecting Multip le Subsystem s
Selecting Multiple Subsystems
You can send multiple program commands and program queries for different
subsystems within the same selected module on the same line by separating
each command with a semicolon. The colon following the semicolon enables
you to enter a new subsystem. <instruction header><data>;
:<instruction header><data><terminator>
Multiple commands may be any combination of simple, compound and
common commands.
Example:SEL EC T 2; :MACHINE1: ASSIGN2;:S YSTEM:HEADERS ON
1–15
Receiving Information from the Logic Analysis
System
After receiving a query (logic analysis system instruction followed by
a question mark), the system interrogates the requested function and
places the answer in its output queue. The answer remains in the
output queue until it is read or until another command is issued.
When read, the message is transmitted across the bus to the
designated listener (typically a controller). The input statement for
receiving a response message from the system’s output queue usually
has two parameters: the device address and a format specification for
handling the response message.
All results for queries sent in a program message must be read before
another program message is sent. For example, when you send the
query :SYSTEM:LONGFORM?, you must follow that query with an
input statement. In BASIC, this is usually done with an ENTER
statement and in C with a read command.
The format for handling the response messages is dependent on both
the controller and the programming language.
ExampleTo read the result of the query command :SYSTEM:LONGFORM? you
can execute this BASIC statement to enter the current setting for the
long form command in the numeric variable Setting.
ENTER XXX; Setting
1–16
Loading...
+ 222 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.