Keysight (Agilent) 8164A Programmers Guide

Agilent 8163A Lightwave Multimeter,
Agilent 8164A Lightwave Measurement System, &
Agilent 8166A Lightwave Multichannel System
Programming Guide
1RWLFHV
7KLVGRFXPHQWFRQWDLQVSURSULHWDU\LQIRUPDWLRQWKDWLVSURWHFWHGE\FRS\ULJKW $OOULJKWVDUHUHVHUYHG
1RSDUWRIWKLVGRFXPHQWPD\UHSURGXFHGLQLQFOXGLQJHOHFWURQLFVWRUDJHDQG UHWULHYDORUWUDQVODWLRQLQWRDIRUHLJQODQJXDJHZLWKRXWSULRUDJUHHPHQWDQG ZULWWHQFRQVHQWIURP$JLOHQW7HFKQRORJLHV'HXWVFKODQG*PE+DVJRYHUQHGE\ 8QLWHG6WDWHVDQGLQWHUQDWLRQDOFRS\ZULJKWODZV
&RS\ULJKWE\ $JLOHQW7HFKQRORJLHV'HXWVFKODQG*PE+ +HUUHQEHUJHU6WU %|EOLQJHQ *HUPDQ\
$JLOHQW7HFKQRORJLHV,QFFHUWLILHVWKDWWKLVSURGXFWPHWLWVSXEOLVKHG VSHFLILFDWLRQVDWWKHWLPHRIVKLSPHQWIURPWKHIDFWRU\
$JLOHQW7HFKQRORJLHVIXUWKHUFHUWLILHVWKDWLWVFDOLEUDWLRQPHDVXUHPHQWVDUH WUDFHDEOHWRWKH8QLWHG6WDWHV1DWLRQDO,QVWLWXWHRI6WDQGDUGVDQG7HFKQRORJ\ 1,67IRUPHUO\WKH8QLWHG6WDWHV1DWLRQDO%XUHDXRI6WDQGDUGV1%6WRWKH H[WHQWDOORZHGE\WKH,QVWLWXWHV·VFDOLEUDWLRQIDFLOLW\DQGWRWKHFDOLEUDWLRQ IDFLOLWLHVRIRWKHU,QWHUQDWLRQDO6WDQGDUGV2UJDQL]DWLRQPHPEHUV
,62&HUWLILFDWLRQ
3URGXFHGWR,62LQWHUQDWLRQDOTXDOLW\V\VWHPVWDQGDUGDVSDUWRIRXU REMHFWLYHRIFRQWLQXDOO\LQFUHDVLQJFXVWRP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ODU 3XUSRVH
([FOXVLYH5HPHGLHV
7KHUHPHGLHVSURYLGHGKHUHLQDUH%X\HU·VVROHDQGH[FOXVLYHUHPHGLHV$JLOHQW 7HFKQRORJLHVVKDOOQRWEHOLDEOHIRUDQ\GLUHFWLQGLUHFWVSHFLDOLQFLGHQWDORU FRQVHTXHQWLDOGDPDJHVZKHWKHUEDVHGRQFRQWUDFWWRUWRUDQ\RWKHUOHJDO WKHRU\
$VVLVWDQFH
3URGXFWPDLQWHQDQFHDJUHHPHQWVDQGRWKHUFXVWRPHUDVVLVWDQFHDJUHHPHQWVDUH DYDLODEOHIRU$JLOHQW7HFKQRORJLHVSURGXFWV)RUDQ\DVVLVWDQFHFRQWDFW\RXU QHDUHVW$JLOHQW7HFKQRORJLHV6DOHVDQG6HUYLFH2IILFH
&HUWLILFDWLRQ
2 Agilent 8163A Lightwave Multimeter, Agilent 8164A Lightwave Measurement System,
& Agilent 8166A Lightwave Multichannel System, Third Edition

In this Manual

This manual contains information about SCPI commands which can be used to program the following instruments:
• Agilent 8163A Lightwave Multimeter
• Agilent 8164A Lightwave Measurement System
• Agilent 8166A Lightwave Multichannel System

The Structure of this Manual

This manual is divided into 5 parts:
“Introduction to Programming” on page 15 gives a general introduction to SCPI programming with the Agilent 8163A Lightwave Multimeter, the Agilent 8164A Lightwave Measurement System, and the Agilent 8166A Lightwave Multichannel System.
Specific Commands on page 35 lists all instrument specific
commands.
“Instrument Setup and Status on page 45, “Measurement Operations & Settings on page 67, and “Mass Storage, Display, and Print Functions on page 129 give fuller explanations of all
instrument specific commands.
VISA Programming Examples on page 133 gives some example programs showing how the SCPI commands can be used with the Agilent 8163A Lightwave Multimeter, the Agilent 8164A Lightwave Measurement System, and the Agilent 8166A Lightwave Multichannel System.
The Agilent 816x VXIplug&play Instrument Driver” on page 155, GPIB Command Compatibility List” on page 183, and Error
Codes on page 191 give information about the Agilent 816x VXIplug&play Instrument Driver, compatibility issues, and error codes.

Conventions used in this Manual

All commands and typed text is written in Courier font, for example
INIT[:IMM].
Agilent 8163A Lightwave Multimeter, Agilent 8164A Lightwave Measurement System, & Agilent 8166A Lightwave Multichannel System, Third Edition
3
SCPI commands are written in mixed case: text that you MUST print is written in capitals; text which is helpful but nor necessary is written in lower case.
So, the command INITiate[:IMMediate] can be entered either as init[:imm], or as initiate[:immediate]. It does not matter whether you enter text using capitals or lower-case letters.
SCPI commands often contain extra arguments in square brackets. These arguments may be helpful, but they need not be entered.
So, the command INITiate[:IMMediate] can be entered as init or initiate:imm.
A SCPI command which can be either a command or a query is appended with the text /?.
So, DISPlay:ENABle/? refers to both the command DISPlay:ENABle and the query DISPlay:ENABle?.

Related Manuals

You can find more information about the instruments covered by this manual in the following manuals:
Agilent 8163A Lightwave Multimeter, Agilent 8164A Lightwave Measurement System, & Agilent 8166A Lightwave Multichannel System User’s Guide (Agilent Product Number 08164-91011).
NOTE Please note that User Guides no longer contain programming
information, and must now be used in conjunction with this manual.
If you are not familiar with the General Purpose Interface Bus, GPIB, then refer to the following books:
ANSI/IEEE-488.1-1978, IEEE Standard Digital Interface for Programmable Instrumentation, and ANSI/IEEE-488.2-1987, IEEE Standard Codes, Formats, and Common Commands, published by
the Institute of Electrical and Electronic Engineers.
In addition, the commands not from the IEEE 488.2 standard are defined according to the Standard Commands for Programmable Instruments (SCPI). For an introduction to SCPI and SCPI programming techniques, refer to the following documents:
Hewlett-Packard Press (Addison-Wesley Publishing Company, Inc.): A Beginners Guide to SCPI by Barry Eppler.
4 Agilent 8163A Lightwave Multimeter, Agilent 8164A Lightwave Measurement System,
& Agilent 8166A Lightwave Multichannel System, Third Edition
The SCPI Consortium: Standard Commands for Programmable Instruments. To obtain a copy of this manual, contact the following
address:
SCPI Consortium Office Bode Enterprise 2515 Camino del Rio South, Suite 340 San Diego, CA, 92108 USA
Web: http://www.scpiconsortium.org
Agilent 8163A Lightwave Multimeter, Agilent 8164A Lightwave Measurement System, & Agilent 8166A Lightwave Multichannel System, Third Edition
5
6 Agilent 8163A Lightwave Multimeter, Agilent 8164A Lightwave Measurement System,
& Agilent 8166A Lightwave Multichannel System, Third Edition

Contents

Contents
In this Manual 3 The Structure of this Manual 3 Conventions used in this Manual 3 Related Manuals 4
Contents 7
Figures 11
Tables 13
Introduction to Programming 15
GPIB Interface 17
Setting the GPIB Address 18 Returning the Instrument to Local Control 19
Message Queues 19
How the Input Queue Works 19
Clearing the Input Queue 20
The Output Queue 20 The Error Queue 20
Programming and Syntax Diagram Conventions 21
Short Form and Long Form 21 Command and Query Syntax 22
Units 22 Data Types 23 Slot and Channel Numbers 23 Laser Selection Numbers 24
Common Commands 25
Common Command Summary 25 Common Status Information 25
The Status Model 27
Status Registers 27 Status System for 8163A & 8164A 30 Status System for 8166A 30
Agilent 8163A Lightwave Multimeter, Agilent 8164A Lightwave Measurement System, & Agilent 8166A Lightwave Multichannel System, Third Edition
7
Contents
Annotations 32
Status Byte Register 32 Standard Event Status Register 32 Operation/Questionable Status Summary 32 Operation/Questionable Status Summary Register 32 Operation/Questionable Slot Status 33 Operation Slot Status Register 33 Questionable Slot Status Register 33
Status Command Summary 34 Other Commands 34
Specific Commands 35
Specific Command Summary 37
Instrument Setup and Status 45
IEEE-Common Commands 47 Status Reporting – The STATus Subsystem 54 Interface/Instrument Behaviour Settings – The SYSTem
Subsystem
64
Measurement Operations & Settings 67
Root Layer Command 69 Measurement Functions – The SENSe Subsystem 72
Agilent 81635A and Agilent 81619A- Master and Slave Channels
72
Signal Generation – The SOURce Subsystem 92 Triggering - The TRIGger Subsystem 117
Extended Trigger Configuration 123
Extended Trigger Configuration Example 127
Mass Storage, Display, and Print Functions 129
Display Operations – The DISPlay Subsystem 131
VISA Programming Examples 133
How to Use VISA Calls 135 How to Set up a Fixed Laser Source 137 How to Measure Power using FETCh and READ 139
8 Agilent 8163A Lightwave Multimeter, Agilent 8164A Lightwave Measurement System,
& Agilent 8166A Lightwave Multichannel System, Third Edition
Contents
How to Co-ordinate Two Modules
143
How Power Varies with Wavelength 147 How to Log Results 150
The Agilent 816x VXIplug&play Instrument Driver 155
Installing the Agilent 816x Instrument Driver 157 Using Visual Programming Environments 160
Getting Started with HP VEE 160
GPIB Interfacing in HP VEE 161
Getting Started with LabView 162 Getting Started with LabWindows 165
Features of the Agilent 816x Instrument Driver 165 Directory Structure 167 Opening an Instrument Session 167 Closing an Instrument Session 168 VISA Data Types and Selected Constant Definitions 168 Error Handling 169 Introduction to Programming 170
Example Programs 170 VISA-Specific Information 171
Instrument Addresses 171 Callbacks 171
Development Environments 171
Microsoft Visual C++ 4.0 (or higher) and Borland C++ 4.5 (or higher) 171
Microsoft Visual Basic 4.0 (or higher) 171 HP VEE 5.01 (or higher) 172 LabWindows CVI/ (R) 4.0 (or higher) 172
Online Information 172 Lambda Scan Applications 173
Equally Spaced Datapoints 174
How to Perform a Lambda Scan Application 176
The Prepare Lambda Scan Function 176 The Get Lambda Scan Parameters Function 177 The Execute Lambda Scan Function 177
How to Perform a Multi-Frame Lambda Scan Application 178
The Equally Spaced Datapoints Function 179 The Register Mainframe Function 179
Agilent 8163A Lightwave Multimeter, Agilent 8164A Lightwave Measurement System, & Agilent 8166A Lightwave Multichannel System, Third Edition
9
Contents
The Unregister Mainframe Function 179 The Prepare Multi Frame Lambda Scan Function 180 The Get MF Lambda Scan Parameters Function 181 The Execute Multi Frame Lambda Scan Function 181 The Get Lambda Scan Result Function 181 The Get Number of PWM Channels Function 182 The Get Channel Location Function 182
GPIB Command Compatibility List 183
Compatibility Issues 185
GPIB Bus Compatibility 185
Status Model 185 Preset Defaults 185 Removed Command 186 Obsolete Commands 187 Changed Parameter Syntax and Semantics 187 Changed Query Result Values 188 Timing Behavior 189 Error Handling 189 Command Order 190 Instrument Status Settings 190
Error Codes 191
GPIB Error Strings 193
Index 199
10 Agilent 8163A Lightwave Multimeter, Agilent 8164A Lightwave Measurement System,
& Agilent 8166A Lightwave Multichannel System, Third Edition

Figures

Figures
Figure 1 Remote Control . . . . . . . . . . . . . . . . 19
Figure 2 The Event Status Bit . . . . . . . . . . . . . . . 26
Figure 3 The Registers and Filters for a Node . . . . . . . . . . . 28
Figure 4 The Operational/Questionable Status System for 8163A & 8164A . . . . 30
Figure 5 The Operational/Questionable Status System for 8166A . . . . . . 31
Figure 6 Extended Trigger Configuration . . . . . . . . . . . 125
Figure 7 Setup for Extended Trigger Configuration Example . . . . . . 127
Figure 8 Non-Administrator Installation Pop-Up Box . . . . . . . . 157
Figure 9 Message Screen. . . . . . . . . . . . . . . 158
Figure 10 Customizing Your Setup . . . . . . . . . . . . . 159
Figure 11 Program Folder Item Options . . . . . . . . . . . . 159
Figure 12 Device Configuration. . . . . . . . . . . . . . 161
Figure 13 Advanced Device Configuration - Plug&play Driver . . . . . . 162
Figure 14 Search for GPIB Instruments . . . . . . . . . . . . 163
Figure 15 FP Conversion Options Box . . . . . . . . . . . . 164
Figure 16 Windows 95 and Windows NT VXIPNP Directory Structure . . . . 167
Figure 17 Equally Spaced Datapoints . . . . . . . . . . . . 175
Figure 18 Lambda Scan Operation Setup . . . . . . . . . . . 176
Figure 19 Multi Frame Lambda Scan Operation Setup . . . . . . . . 178
Agilent 8163A Lightwave Multimeter, Agilent 8164A Lightwave Measurement System, & Agilent 8166A Lightwave Multichannel System, Third Edition
11
Figures
12 Agilent 8163A Lightwave Multimeter, Agilent 8164A Lightwave Measurement System,
& Agilent 8166A Lightwave Multichannel System, Third Edition

Tables

Tables
Table 1 GPIB Capabilities . . . . . . . . . . . . . . . 18
Table 2 Units and allowed Mnemonics . . . . . . . . . . . . 22
Table 3 Common Command Summary . . . . . . . . . . . . 25
Table 4 Specific Command Summary. . . . . . . . . . . . . 37
Table 5 Commands that can only be configured using the master channel . . . 73 Table 6 Commands that are independent for both master and slave channels . . 73
Table 7 Triggering and Power Measurements . . . . . . . . . 117
Table 8 Generating Output Triggers from Power Measurements . . . . . 118
Table 9 Incompatible GPIB Bus Commands . . . . . . . . . . 185
Table 10 Removed Commands. . . . . . . . . . . . . . 186
Table 11 Obsolete Commands . . . . . . . . . . . . . . 187
Table 12 Commands with Different Parameters or Syntax . . . . . . . 187
Table 13 Queries with Different Result Values . . . . . . . . . . 188
Table 14 Timing Behavior Changes . . . . . . . . . . . . 189
Table 15 Error Handling Changes . . . . . . . . . . . . . 189
Table 16 Specific Errors . . . . . . . . . . . . . . . 189
Table 17 Overview for Supported Strings . . . . . . . . . . . 193
Table 18 Overview for Unsupported Strings . . . . . . . . . . 196
Agilent 8163A Lightwave Multimeter, Agilent 8164A Lightwave Measurement System, & Agilent 8166A Lightwave Multichannel System, Third Edition
13
Tabl es
14 Agilent 8163A Lightwave Multimeter, Agilent 8164A Lightwave Measurement System,
& Agilent 8166A Lightwave Multichannel System, Third Edition

Introduction to Programming

Agilent 8163A Lightwave Multimeter, Agilent 8164A Lightwave Measurement System, & Agilent 8166A Lightwave Multichannel System, Third Edition
15
Introduction to Programming
This chapter gives general information on how to control your instrument remotely.
Descriptions for the actual commands for the instruments are given in the following chapters. The information in these chapters is specific to the Agilent 8163A Lightwave Multimeter, Agilent 8164A Lightwave Measurement System, and Agilent 8166A Lightwave Multichannel System and assumes that you are already familiar with programming the GPIB.
16 Agilent 8163A Lightwave Multimeter, Agilent 8164A Lightwave Measurement System,
& Agilent 8166A Lightwave Multichannel System, Third Edition
GPIB Interface Introduction to Programming

GPIB Interface

The interface used by your instrument is the GPIB (General Purpose Interface Bus).
GPIB is the interface used for communication between a controller and an external device, such as the tunable laser source. The GPIB conforms to IEEE standard 488-1978, ANSI standard MC 1.1 and IEC recommendation 625-1.
If you are not familiar with the GPIB, then refer to the following books:
The International Institute of Electrical and Electronics Engineers.
IEEE Standard 488.1-1987, IEEE Standard Digital Interface for Programmable Instrumentation. New York, NY, 1987
The International Institute of Electrical and Electronics Engineers.
IEEE Standard 488.2-1987, IEEE Standard Codes, Formats, Protocols and Common Commands For Use with ANSI/IEEE Std
488.1-1987. New York, NY, 1987
To obtain a copy of either of these last two documents, write to:
The Institute of Electrical and Electronics Engineers, Inc. 345 East 47th Street New York, NY 10017 USA.
In addition, the commands not from the IEEE-488.2 standard, are defined according to the Standard Commands for Programmable Instruments (SCPI).
For an introduction to SCPI, and SCPI programming techniques, please refer to the following documents:
Hewlett-Packard Press (Addison-Wesley Publishing Company, Inc.). A Beginners Guide to SCPI. Barry Eppler. 1991.
The SCPI Consortium: Standard Commands for Programmable Instruments. To obtain a copy of this manual, contact the following
address:
SCPI Consortium Office Bode Enterprise 2515 Camino del Rio South, Suite 340 San Diego, CA, 92108 USA
Web: http://www.scpiconsortium.org
Agilent 8163A Lightwave Multimeter, Agilent 8164A Lightwave Measurement System, & Agilent 8166A Lightwave Multichannel System, Third Edition
17
Introduction to Programming GPIB Interface
The interface of the Agilent 8163A Lightwave Multimeter and of the Agilent 8164A Lightwave Measurement System to the GPIB is defined by the IEEE Standards 488.1 and 488.2.
Table 1 shows the interface functional subset that the instruments implement.
Table 1 GPIB Capabilities
Mnemonic Function
SH1 Complete source handshake capability AH1 Complete acceptor handshake capability T6 Basic talker; serial poll; unaddressed to talk if addressed to
listen
L4 Basic listener; unaddressed to listen if addressed to talk; no
listen only SR1 Complete service request capability RL1 Complete remote/local capability PP0 No parallel poll capability DC1 Device clear capability DT0 No device trigger capability C0 No controller capability (Controller capability to be imple-
mented)

Setting the GPIB Address

There are two ways to set the GPIB address:
You can set the GPIB address by using the command :SYSTem:COMMunicate:GPIB[:SELF]:ADDRess on page 66.
You can set the GPIB address from the front panel. See your instruments Users Guide for more information.
The default GPIB address is 20.
18 Agilent 8163A Lightwave Multimeter, Agilent 8164A Lightwave Measurement System,
& Agilent 8166A Lightwave Multichannel System, Third Edition
Message Queues Introduction to Programming

Returning the Instrument to Local Control

If the instrument is in remote control, a screen resembling Figure 1 will appear. Press [Local] if you wish to return the instrument to local control.
Figure 1 Remote Control

Message Queues

The instrument exchanges messages using an input and an output queue. Error messages are kept in a separate error queue.

How the Input Queue Works

The input queue is a FIFO queue (first-in first-out). Incoming bytes are stored in the input queue as follows:
1 Receiving a byte:
Clears the output queue.
Clears Bit 7 (MSB).
Agilent 8163A Lightwave Multimeter, Agilent 8164A Lightwave Measurement System, & Agilent 8166A Lightwave Multichannel System, Third Edition
19
Introduction to Programming Message Queues
2 No modification is made inside strings or binary blocks. Outside
strings and binary blocks, the following modifications are made:
Lower-case characters are converted to upper-case.
The characters 00
).
(20
16
– Two or more blanks are truncated to one.
3 An EOI (End Or Identify) sent with any character is put into the input
queue as the character followed by a line feed (LF, 0A with a LF, only one LF is put into the input queue.
4 The parser starts if the LF character is received or if the input queue is
full.
to 0916 and 0B16 to 1F16 are converted to spaces
16
). If EOI is sent
16
Clearing the Input Queue
Switching the power off, or sending a Device Interface Clear signal, causes commands that are in the input queue, but have not been executed to be lost.

The Output Queue

The output queue contains responses to query messages. The instrument transmits any data from the output queue when a controller addresses the instrument as a talker.
Each response message ends with a carriage return (CR, 0D
), with EOI=TRUE. If no query is received, or if the query has an
(0A
16
error, the output queue remains empty.
The Message Available bit (MAV, bit 4) is set in the Status Byte register whenever there is data in the output queue.
) and a LF
16

The Error Queue

The error queue is 30 errors long. It is a FIFO queue (first-in first-out). That is, the first error read is the oldest error to have occurred. A new error is only put into the queue if it is not already in it.
If more than 29 errors are put into the queue, the message:
-350 <Queue Overflow>
is placed as the last message in the queue.
20 Agilent 8163A Lightwave Multimeter, Agilent 8164A Lightwave Measurement System,
& Agilent 8166A Lightwave Multichannel System, Third Edition
Programming and Syntax Diagram Conventions Introduction to Programming

Programming and Syntax Diagram Conventions

A program message is a message containing commands or queries that you send to the instruments. The following are a few points about program messages:
You can use either upper-case or lower-case characters.
You can send several commands in a single message. Each command
must be separated from the next one by a semicolon (;).
A command message is ended by a line feed character (LF) or
<CR><LF>.
You can use any valid number/unit combination.
In other words, 1500NM,1.5UM and 1.5E-6M are all equivalent.
If you do not specify a unit, then the default unit is assumed. The default unit for the commands are given with command description in the next chapter.

Short Form and Long Form

The instrument accepts messages in short or long forms.
For example, the message
:STATUS:OPERATION:ENABLE 768
is in long form.
The short form of this message is
:STAT:OPER:ENAB 768
In this manual, the messages are written in a combination of upper and lower case. Upper case characters are used for the short form of the message.
For example, the above command would be written
:STATus:OPERation:ENABle
The first colon can be left out for the first command or query in your message. That is, the example given above could also be sent as
STAT:OPER:ENAB 768
Agilent 8163A Lightwave Multimeter, Agilent 8164A Lightwave Measurement System, & Agilent 8166A Lightwave Multichannel System, Third Edition
21
Introduction to Programming Programming and Syntax Diagram Conventions

Command and Query Syntax

All characters not between angled brackets must be sent exactly as shown.
The characters between angled brackets (<...>) indicate the kind of data that you should send, or that you get in a response. You do not type the angled brackets in the actual message.
Descriptions of these items follow the syntax description. The following types of data are most commonly used:
string is ascii data. A string is contained between double
quotes ("...") or single quotes (‘...’).
value is numeric data in integer (12), decimal (34.5) or ex-
ponential format (67.8E-9).
wsp is a white space.
Other kinds of data are described as required.
The characters between square brackets ([...]) show optional information that you can include with the message.
The bar (|) shows an either-or choice of data, for example, a|b means either a or b, but not both simultaneously.
Extra spaces are ignored, so spaces can be inserted to improve readability.
Units
Where units are given with a command, usually only the base units are specified. The full sets of units are given in the table below.
Table 2 Units and allowed Mnemonics
Unit Default Allowed Mnemonics
meters M PM, NM, UM, MM, M decibel DB MDB, DB second S NS, US, MS, S decibel/1mW DBM MDBM, DBM Hertz HZ HZ, KHZ, MHZ, GHZ, THZ Watt Watt PW, NW, UW, MW, Watt meters per second M/S NM/S, UM/S, MM/S, M/S
22 Agilent 8163A Lightwave Multimeter, Agilent 8164A Lightwave Measurement System,
& Agilent 8166A Lightwave Multichannel System, Third Edition
Programming and Syntax Diagram Conventions Introduction to Programming
Data Types
With the commands you give parameters to the instrument and receive response values from the instrument. Unless explicitly specified these data are given in ASCII format. The following types of data are used:
Boolean data may only have the values 0 or 1.
Integer range is given for each individual command.
Float variables may be given in decimal or exponential writing (0.123
or 123E-3). All Float values conform to the 32 bit IEEE Standard, that is, all Float values are returned as 32-bit real values.
A string is contained between double quotes ("...") or single quotes (‘...’). When the instrument returns a string, it is always included in " " and terminated by <END>.
When a register value is given or returned (for example *ESE), the decimal values for the single bits are added. For example, a value of
nine means that bit 0 and bit 3 are set.
Larger blocks of data are given as Binary Blocks, preceded by #<H><Len><Block>, terminated by <END>; <H> represents the
number of digits, <Len> represents the number of bytes, and <Block> is the data block. For example, for a Binary Block with 1 digit and 6 bytes this is: #16TRACES<END>.
Slot and Channel Numbers
Each module is identified by a slot number and a channel number. For commands that require you to specify a channel, the slot number is represented by [n] in a command and the channel number is represented by [m].
The slot number represents the modules position in the mainframe. These are:
from one to two for the Agilent 8163A,
from zero to four for the Agilent 8164A, and
from one to seventeen for the Agilent 8166A.
These numbers are displayed on the front panel beside each module slot.
NOTE The Agilent 8164A slot for back-loadable tunable laser modules is
numbered zero.
Agilent 8163A Lightwave Multimeter, Agilent 8164A Lightwave Measurement System, & Agilent 8166A Lightwave Multichannel System, Third Edition
23
Introduction to Programming Programming and Syntax Diagram Conventions
Channel numbers apply to modules that have two inputs/outputs, for example, the Agilent 81635A Dual Power Sensor.
Modules with two channels, for example, the Agilent 81635A Dual Power Sensor, use the channel number to distinguish between these channels.
NOTE The channel number of single channel modules is always one.
For example, if you want to query slot 1, channel 2 with the command, :SENSe[n]:[CHANnel[m]]:POWer:WAVelength? on page 89, you should send the command:
:sens1:chan2:pow:wav?
NOTE If you do not specify a slot or channel number, the lowest possible
number is used as the default value. This means:
Slot 1 for the Agilent 8163A and Agilent 8166A mainframes.
Slot 0 for the Agilent 8164A mainframe.
Channel 1 for all channels.
Laser Selection Numbers
The laser selection number, [l], identifies the upper or lower wavelength laser source for dual wavelength Laser Source modules and Return Loss modules with two internal laser sources. The lower wavelength source is denoted by 1. The upper wavelength source is denoted by 2.
NOTE For Return Loss modules, 0 denotes the use of an external laser source
as the input to your Return Loss module for the following commands:
“:SENSe[n]:[CHANnel[m]]:RETurnloss:CORRection:FPDelta[l] on page 90,
“:SENSe[n]:[CHANnel[m]]:RETurnloss:CORRection:FPDelta[l]? on page 90,
“:SENSe[n]:[CHANnel[m]]:RETurnloss:CORRection:REFLectance[l] on page 91, and
“:SENSe[n]:[CHANnel[m]]:RETurnloss:CORRection:REFLectance[l] ? on page 91.
24 Agilent 8163A Lightwave Multimeter, Agilent 8164A Lightwave Measurement System,
& Agilent 8166A Lightwave Multichannel System, Third Edition
Common Commands Introduction to Programming

Common Commands

The IEEE 488.2 standard has a list of reserved commands, called common commands. Some of these commands must be implemented by any instrument using the standard, others are optional.
Your instrument implements all the necessary commands, and some optional ones. This section describes the implemented commands.

Common Command Summary

Table 3 gives a summary of the common commands.
Table 3 Common Command Summary
Command Parameter Function Page
*CLS Clear Status Command page 47 *ESE Standard Event Status Enable Command page 48 *ESE? Standard Event Status Enable Query page 48 *ESR? Standard Event Status Register Query page 49 *IDN? Identification Query page 49 *OPC Operation Complete Command page 50 *OPC? Operation Complete Query page 50 *OPT? Options Query page 51 *RST Reset Command page 51 *STB? Read Status Byte Query page 52 *TST? Self Test Query page 53 *WAI Wait Command page 53
NO T E These commands are described in more detail in “IEEE-Common Commands” on page 47.

Common Status Information

There are three registers for the status information. Two of these are status-registers and one is an enable-registers. These registers conform to the IEEE Standard 488.2-1987. You can find further descriptions of these registers under *ESE, *ESR?, and *STB?.
Agilent 8163A Lightwave Multimeter, Agilent 8164A Lightwave Measurement System, & Agilent 8166A Lightwave Multichannel System, Third Edition
25
Introduction to Programming Common Commands
Figure 2 shows how the Standard Event Status Enable Mask (SESEM) and the Standard Event Status Register (SESR) determine the Event Status Bit (ESB) of the Status Byte.
*ESE
sets the Standard Event Status Enable Mask
*STB?
returns the Status Byte Register
OSB ESB QSB
Status
Byte
001
All bits shown as are unused
Figure 2 The Event Status Bit
The SESR contains the information about events that are not slot specific. For details of the function of each bit of the SESR, see Standard Event Status Register on page 32.
01234567
*ESR?
Event Status
Enable
Mask
&
&
&
&
OR
Event
Status
Register
returns the Standard Event Status Register
&
&
01234567
111111
&
&
01234567
100000
The SESEM allows you to choose the event that may affect the ESB of the Status Byte. If you set a bit of the SESEM to zero, the corresponding event cannot affect the ESB. The default is for all the bits of the SESEM to be set to 0.
The questionable and operation status systems set the Operational Status Bit (OSB) and the Questionable Status Bit (QSB). These status systems are described in The Status Model on page 27 and Status Reporting The STATus Subsystem on page 54.
NOTE Unused bits in any of the registers change to 0 when you read them.
26 Agilent 8163A Lightwave Multimeter, Agilent 8164A Lightwave Measurement System,
& Agilent 8166A Lightwave Multichannel System, Third Edition
The Status Model Introduction to Programming

The Status Model

Status Registers

Each node of the status circuitry has three registers:
A condition register (CONDition), which contains the current status. This register is updated continuously. It is not changed by having its contents read.
The event register (EVENt), which contains details of any positive transitions in the corresponding condition register, that is, when a bit changes from 0 1. The contents of this register are cleared when it is read. The contents of any higher-level registers are affected with regard to the appropriate bit.
The enable register (ENABle), which enables changes in the event register to affect the next stage of registers.
NOTE The event register is the only kind of register that can affect the next
stage of registers.
Agilent 8163A Lightwave Multimeter, Agilent 8164A Lightwave Measurement System, & Agilent 8166A Lightwave Multichannel System, Third Edition
27
Introduction to Programming The Status Model
The structures of the Operational and Questionable Status Systems are similar. Figure 4 describe how the Questionable Status Bit (QSB) and the Operational Status Bit (OSB) of the Status Byte Register are determined.
Enable Registers
To th e
OR
Event Registers
Condition Register of the Next Node
A positive transition in the condition
11111
Figure 3 The Registers and Filters for a Node
The Operational/Questionable Slot Status Event Register (OSSER/QSSER) contains the status of a particular module slot. A bit changes from 0 1 when an event occurs, for example, when a laser is switched on. For details of the function of each bit of these registers, see
Operation/Questionable Status Summary Register” on page 32 and Operation/Questionable Status Summary Register” on page 32.
The Operational/Questionable Slot Enable Status Mask (OSESM/QSESM) allows you to choose the events for each module slot that may affect the Operational/Questionable Status Event Register (see below). If you set a bit of the OSESM/QSESM to zero, the occurence of the corresponding event for this particular module slot cannot affect the Operational/Questionable Status Event Register. The default is for all the bits of the OSESM/QSESM to be set to 0.
register, when a bit changes from 0 → 1, causes the corresponding bit of the corresponding event register to change from 0 → 1.
Condition Registers
28 Agilent 8163A Lightwave Multimeter, Agilent 8164A Lightwave Measurement System,
& Agilent 8166A Lightwave Multichannel System, Third Edition
The Status Model Introduction to Programming
The Operational/Questionable Status Event Summary Register (OSESR/QSESR) summarizes the status of every module slot of your instrument. If, for any slot, any bit of the QSSER goes from 0 1 AND the corresponding bit of the QSSEM is 1at the same time, the QSESR bit representing that slot is set to 1.
The Operational/Questionable Status Enable Summary Mask (OSESM/QSESM) allows you to choose the module slots that may affect the OSB/QSB of the Status Byte. If any bit of the QSESR goes from 0 → 1 AND the corresponding bit of the QSESM is 1at the same time, the QSB of the Status Byte is set to 1. If you set a bit of the OSESM/QSESM to zero, the corresponding module slot cannot affect the OSB/QSB. The default is for all the bits of the OSESM/QSESM to be set to 0.
The Operational/Questionable Status Enable Summary Mask for the Agilent 8163A Lightwave Multimeter and the Agilent 8164A Lightwave Measurement System consists of one level. These are described in Status System for 8163A & 8164A on page 30.
As the Agilent 8166A Lightwave Multichannel System has 17 module slots, the Operational/Questionable Status Enable Summary Mask consists of two levels. This is described in Status System for 8166A on page 30.
Agilent 8163A Lightwave Multimeter, Agilent 8164A Lightwave Measurement System, & Agilent 8166A Lightwave Multichannel System, Third Edition
29
Introduction to Programming The Status Model

Status System for 8163A & 8164A

The status system for the Agilent 8163A Lightwave Multimeter and the Agilent 8164A Lightwave Measurement System returns the status of 2 and 5 module slots respectively. The Operational/Questionable Status Summary Registers consist of one level and are described by Figure 4. Any commands that require LEVel1 do not apply to these mainframes.
Status Byte Register
Status Summary
Slot 1
Operational/Questionable Status Enable Summary Mask Register
Operational/Questionable Status Event Summary Register
Operational/Questionable Status Condition Summary Register
Operational/Questionable Slot Status Enable Mask Register
Operational/Questionable Slot Status Event Register
Operational/Questionable Slot Status Condition Register
Status Byte
to next
&
&
&
&
&
&
OR
for a positive
transition
&
&
to next
level
OR
for a positive
transition
level
Figure 4 The Operational/Questionable Status System for 8163A & 8164A

Status System for 8166A

The status system for the Agilent 8166A Lightwave Multichannel System returns the status of 17 module slots. The Operational/Questionable Status Summary Registers consists of two levels, as described by Figure
5.
30 Agilent 8163A Lightwave Multimeter, Agilent 8164A Lightwave Measurement System,
& Agilent 8166A Lightwave Multichannel System, Third Edition
Loading...
+ 171 hidden pages