Agilent Technologies 6812B, 6814B, 6813B, 6834B, 6843A, AC Power Solutions 6811B User Manual
Programming Guide
AC Power Solutions
Agilent Models 6811B, 6812B, 6813B
6814B, 6834B, and 6843A
Agilent Part No. 5962-0889 Printed in U.S.A.
Microfiche No 6962-0890December, 1998
Update April 2000
Safety Summary
The beginning of the ac source User’s Guide has a Safety Summary page. Be sure you are familiar with
the information on this page before programming the ac source from a controller.
WARNING:
ENERGY HAZARD.
contact may result if the output terminals or circuits connected to the output are
touched when power is applied.
Ac sources can supply 425 V peak at their output. DEATH on
Printing History
The edition and current revision of this manual are indicated below. Reprints of this manual containing
minor corrections and updates may have the same printing date. Revised editions are identified by a new
printing date. A revised edition incorporates all new or corrected material since the previous printing date.
Changes to the manual occurring between revisions are covered by change sheets shipped with the
manual.
This document contains proprietary information protected by copyright. All rights are reserved. No part of
this document may be photocopied, reproduced, or translated into another language without the prior
consent of Agilent Technologies. The information contained in this document is subject to change withoutnotice.
Safety Summary 2
Printing History 2
Table of Contents 3
1 - GENERAL INFORMATION 11
About this Guide 11
Earlier AC Source Models 11
Documentation Summary 11
External References 12
SCPI References 12
GPIB References 12
Agilent VXIplug&play Power Products Instrument Drivers 12
Supported Applications 12
System Requirements 13
Downloading and Installing the Driver 13
Accessing Online Help 13
2 - INTRODUCTION TO PROGRAMMING 15
GPIB Capabilities of the AC Source 15
GPIB Address 15
RS-232 Capabilities of the AC Source 15
RS-232 Data Format 15
Baud Rate 15
RS-232 Programming Example 16
RS-232 Troubleshooting 16
Introduction to SCPI 17
Conventions Used in This Guide 17
Types of SCPI Commands 17
Types of SCPI Messages 17
The SCPI Command Tree 18
The Root Level 18
Active Header Path 18
The Effect of Optional Headers 19
Moving Among Subsystems 19
Including Common Commands 20
Using Queries 20
Coupled Commands 20
Structure of a SCPI Message 20
The Message Unit 20
Combining Message Units 21
Headers 21
Query Indicator 22
Message Unit Separator 22
Root Specifier 22
Message Terminator 22
SCPI Data Formats 23
Numerical Data Formats 23
Suffixes and Multipliers 23
Character Data 23
3
System Considerations 24
Assigning the GPIB Address in Programs 24
Types of DOS Drivers 24
Error Handling 25
Agilent BASIC Controllers 25
Subsystem Syntax94
STATus:PRESet94
Bit Configuration of Operation Status Registers95
STATus:OPERation?95
STATus:OPERation:CONDition?95
STATus:OPERation:ENABle95
STATus:OPERation:NTRansition STATus:OPERation:PTRansition96
Bit Configuration of Questionable Status Registers97
STATus:QUEStionable?97
STATus:QUEStionable:CONDition?97
STATus:QUEStionable:ENABle98
STATus:QUEStionable:NTRansition STATus:QUEStionable:PTRansition98
Bit Configuration of Questionable Instrument Summary Registers99
STATus:QUEStionable:INSTrument:ISUMmary?99
STATus:QUEStionable:INSTrument:ISUMmary:CONDition?100
STATus:QUEStionable:INSTrument:ISUMmary:ENABle100
STATus:QUEStionable:INSTrument:ISUMmary:NTR STATus:QUEStionable:INSTrument:ISUMmary:PTR101
Common Commands Syntax113
*CLS114
*ESE114
Bit Configuration of Standard Event Status Enable Register114
*ESR?115
*IDN?115
*OPC115
*OPT?116
*PSC116
*RCL116
*RST117
*SAV118
*SRE118
*STB?119
Bit Configuration of Status Byte Register119
*TRG119
*TST?119
*WAI120
4 - PROGRAMMING EXAMPLES121
Introduction121
Programming the Output121
Power-on Initialization121
Enabling the Output121
AC Voltage and Frequency122
Voltage and Frequency Slew Rates123
Waveform Shapes123
Individual Phases (Agilent 6834B only)124
Current Limit125
DC Output (Agilent 6811B/6812B/6813B only)126
Coupled Commands127
Programming Output Transients128
Transient System Model129
Step and Pulse Transients130
List Transients130
Triggering Output Changes132
SCPI Triggering Nomenclature132
Output Trigger System Model132
Initiating the Output Trigger System134
Selecting the Output Trigger Source134
8
Specifying a Trigger Delay135
Synchronizing Output Changes to a Reference Phase Angle135
Generating Output Triggers136
Specifying a Dwell Time for Each List Point136
Making Measurements137
Voltage and Current Measurements137
Power Measurements138
Harmonic Measurements138
Simultaneous Output Phase Measurements (Agilent 6834B only)138
Returning Voltage and Current Data From the Data Buffer139
Regulatory-Compliant Measurement of Quasi-Stationary Harmonics139
Triggering Measurements139
SCPI Triggering Nomenclature139
Measurement Trigger System Model139
Initiating the Measurement Trigger System140
Selecting the Measurement Trigger Source140
Generating Measurement Triggers141
Controlling the Instantaneous Voltage and Current Data Buffers141
Programming the Status Registers142
Power-On Conditions142
Operation Status Group142
Questionable Status Group144
Questionable Instrument Isummary Status Group145
Standard Event Status Group146
Status Byte Register147
Examples147
Programming the Trigger In and Trigger Out BNC Connectors148
Elgar Model 9012 Plug-in Programmer Compatibility161
Main Board W1 Jumper Option Emulation161
Syntax Compatibility161
Status Model162
Power-on State162
Protection163
Front Panel Operation163
System Keys163
9
Function Keys163
Entry Keys164
E9012 Language Command Summary164
E - IEC MODE COMMAND SUMMARY167
Introduction167
Using the SENSe:CURRent:ACDC:RANGe command167
Command Syntax168
CALCulate:INTegral:TIME169
CALCulate:SMOothing169
CALCulate:LIMit:UPPer170
FORMat171
FORMat:BORDer172
MEASure:ARRay:CURRent:HARMonic?173
MEASure:ARRay:VOLTage:FLUCtuations:ALL?174
MEASure:ARRay:VOLTage:FLUCtuations:FLICker?176
MEASure:ARRay:VOLTage:FLUCtuations:PST?177
SENSe:CURRent:PREFerence178
SENSe:WINDow178
SYSTem:CONFigure179
INDEX181
10
General Information
About this Guide
This manual contains programming information for the Agilent 6811B, 6812B, 6813B, 6814B, 6834B,
6843A AC Power Solutions. These units will be referred to as "ac sources" throughout this manual. You
will find the following information in the rest of this guide:
Chapter 1Introduction to this guide.
Chapter 2Introduction to SCPI messages structure, syntax, and data formats.
Chapter 3Dictionary of SCPI commands.
Chapter 4Introduction to programming the ac source with SCPI commands.
Appendix ASCPI command tree.
Appendix BSCPI conformance information.
Appendix CError messages
Appendix DElgar Model 9012 plug-in programmer compatibility
Appendix EIEC mode SCPI commands
Earlier AC Source Models
With the exception of some minor readback specification differences, information in this manual also
applies to the following earlier ac source models:
1
Information about this
current model
Agilent 6811BAgilent 6811A AC Power Source/Analyzer
Agilent 6812BAgilent 6812A AC Power Source/Analyzer
Agilent 6813BAgilent 6813A AC Power Source/Analyzer
also applies to the following earlier
models:
Agilent 6841A Harmonic/Flicker Test System
in normal mode
Agilent 6842A Harmonic/Flicker Test System
in normal mode
Documentation Summary
The following documents that are related to this Programming Guide have additional helpful information
for using the ac source.
Quick Start Guide
u
u
User’s Guide
panel, how to connect to the instrument, and calibration procedures.
u
Quick Reference Card
u
Agilent 14761A, 14762A, 14763A User’s Guides
application and with Agilent 6843A units only.
. Information on how to quickly get started using the ac source.
. Includes specifications and supplemental characteristics, how to use the front
. Designed as a memory jogger for front panel and GPIB operation.
are shipped along with the specific software
11
1 - General Information
External References
SCPI References
The following documents will assist you with programming in SCPI:
Beginner’s Guide to SCPI
u
has not had previous experience programming with SCPI.
u
Tutorial Description of the General Purpose Interface Bus
recommended for those not familiar with the IEEE 488.1 and 488.2 standards.
To obtain a copy of the above documents, contact your local Agilent Sales and Support Office.
. Agilent Part No. H2325-90001. Highly recommended for anyone who
. Agilent Part No. 5952-0156. Highly
GPIB References
The most important GPIB documents are your controller programming manuals - Agilent BASIC, GPIB
Command Library for MS DOS, etc. Refer to these for all non-SCPI commands (for example: Local
Lockout).
The following are two formal documents concerning the GPIB interface:
ANSI/IEEE Std. 488.1-1987 IEEE Standard Digital Interface for Programmable Instrumentation
u
Defines the technical details of the GPIB interface. While much of the information is beyond the
need of most programmers, it can serve to clarify terms used in this guide and in related
documents.
ANSI/IEEE Std. 488.2-1987 IEEE Standard Codes, Formats, Protocols, and Common
u
Commands
programming. Helpful for finding precise definitions of certain types of SCPI message formats,
data types, or common commands.
The above two documents are available from the IEEE (Institute of Electrical and Electronics Engineers),
345 East 47th Street, New York, NY 10017, USA.
. Recommended as a reference only if you intend to do fairly sophisticated
.
Agilent VXI
Agilent VXI
now available on the Web at http://www.ag.com/go/drivers. These instrument drivers provide a highlevel programming interface to your Agilent Power Products instrument. Agilent VXI
drivers are an alternative to programming your instrument with SCPI command strings. Because the
instrument driver’s function calls work together on top of the VISA I/O library, a single instrument driver
can be used with multiple application environments.
plug&play
plug&play
Power Products instrument drivers for Microsoft Windows 95 and Windows NT are
ñMicrosoft Windows 95
ñMicrosoft Windows NT 4.0
ñHP VISA revision F.01.02
ñNational Instruments VISA 1.1
plug&play
Power Products instrument driver complies with the following:
Downloading and Installing the Driver
NOTE: Before installing the Agilent VXIplug&play instrument driver, make sure that you have one
of the supported applications installed and running on your computer.
1. Access Agilent Technologies’ Web site at http://www.ag.com/go/drivers.
2. Select the instrument for which you need the driver.
3. Click on the driver, either Windows 95 or Windows NT, and download the executable file to your
PC.
4. Locate the file that you downloaded from the Web. From the Start menu select Run
<path>:\agxxxx.exe - where <path> is the directory path where the file is located, and agxxxx is
the instrument driver that you downloaded .
5. Follow the directions on the screen to install the software. The default installation selections will
work in most cases. The readme.txt file contains product updates or corrections that are not
documented in the on-line help. If you decide to install this file, use any text editor to open and
read it.
6. To use the VXI
help under “Introduction to Programming”.
plug&play
instrument driver, follow the directions in the Agilent VXI
plug&play
online
Accessing Online Help
A comprehensive online programming reference is provided with the driver. It describes how to get
started using the instrument driver with Agilent VEE, LabVIEW, and LabWindows. It includes complete
descriptions of all function calls as well as example programs in C/C++ and Visual BASIC.
ñTo access the online help when you have chosen the default Vxipnp start folder, click on the Start
button and select Programs | Vxipnp | agxxxx Help (32-bit).
- where agxxxx is the instrument driver.
13
2
Introduction to Programming
GPIB Capabilities of the AC Source
All ac source functions except for setting the GPIB address are programmable over the GPIB. The IEEE
488.2 capabilities of the ac source are listed in the appendix A of the User’s Guide.
GPIB Address
The ac source operates from a GPIB address that is set from the front panel. To set the GPIB address,
press the Address key on the front panel and enter the address using the Entry keys.
RS-232 Capabilities of the AC Source
The ac source provides an RS-232 programming interface, which is activated by commands located under
the front panel Address key. All SCPI and E9012 commands are available through RS-232 programming.
When the RS-232 interface is selected, the GPIB interface is disabled.
The EIA RS-232 Standard defines the interconnections between Data Terminal Equipment (DTE) and
Data Communications Equipment (DCE). The ac source is designed to be a DTE. It can be connected to
another DTE such as a PC COM port through a null modem cable.
NOTE:The RS-232 settings in your program must match the settings specified in the front panel
Address menu. Press the front panel Address key if you need to change the settings.
RS-232 Data Format
The RS-232 data is a 11-bit word with one start bit and two stop bits. The number of start and stop bits is
not programmable. The following parity options are selectable using the front panel Address key:
EVENSeven data bits with even parity
ODDSeven data bits with odd parity
MARKSeven data bits with mark parity (parity is always true)
SPACESeven data bits with space parity (parity is always false)
NONEEight data bits without parity
Parity options are stored in non-volatile memory.
Baud Rate
The front panel Address key lets you select one of the following baud rates, which is stored in non-volatile
memory: 300 600 1200 2400 4800 9600
15
2 - Introduction to Programming
RS-232 Programming Example
The following program illustrates how to program the ac source using RS-232 to set the output voltage
and frequency and to read back the model number and output voltage. The program was written to run on
any controller using Microsoft QBasic.
NOTE:The ac source must be configured for RS232 and the same baud rate and parity as the
controller.
‘ Program to write and read via RS232
‘ Configure serial port for:
‘9600 baud
‘7 bit data
‘2 stop bits
‘Ignore request to send
‘Ignore carrier detect
‘Even parity‘ Needed with Vectra basic, ignored with QBasic
‘Send line feed
‘Reserve 1000 character buffer for serial I/O
‘
DECLARE FUNCTION gets$ ()‘ Function to read string from ac source
CLS‘ Clears screen
LOCATE 1, 1‘ Position cursor at top left
‘ Configure Com1 Port
OPEN “com1:9600,e,7,2,rs,cd,pe,lf” FOR RANDOM AS #1 LEN = 1000
PRINT #1, “*RST” ‘ Resets the ac source
PRINT #1, “VOLT 60”‘ Set voltage to 60 volts
PRINT #1, “FREQ 50”‘ Set frequency to 50 hertz
PRINT #1, “OUTPUT ON” ‘ Turn on the output
PRINT #1, “*IDN?” ‘ Query the ac source identification string
PRINT gets$‘ Go to gets$ Function and print data returned
PRINT #1, MEAS”VOLT?”; volt‘ Query the ac source voltage
Volt = VAL (gets$)‘ Convert gets$ string to a value
PRINT gets$‘ Print the value of the voltage
END‘ End of main program
FUNCTION gets$‘ Get a new line feed terminated string from device #1
C$ = “”‘ Set C$ to null
WHILE c$ <> CHR$ (10)‘ Set loop to stop at Line Feed
C$ = INPUT$ (1, #1)‘ Read 1 bit into file #1
Resp$ = resp$ + c$‘ Concatenate bit with previous bits
WEND‘ End of WHILE loop
gets$ = resp$‘ Assign response to gets$
END FUNCTION
RS-232 Troubleshooting
If you are having trouble communicating over the RS-232 interface, check the following:
♦
The computer and the ac source must be configured for the same baud rate, parity, and number
of data bits. Note that the ac source is configured for 1 start bit and 2 stop bits (these values are
fixed).
♦ The correct interface cables or adaptors must be used, as described under "RS-232 Connector" in
the User’s Guide. Note that even if the cable has the proper connectors for your system, the
internal wiring may be incorrect.
♦ The interface cable must be connected to the correct serial port on your computer (COM1, COM2,
etc.).
16
Introduction to Programming - 2
Introduction to SCPI
SCPI (Standard Commands for Programmable Instruments) is a programming language for controlling
instrument functions over the GPIB. SCPI is layered on top of the hardware-portion of IEEE 488.2. The
same SCPI commands and parameters control the same functions in different classes of instruments. For
example, you would use the same DISPlay command to control the ac source display and the display of a
SCPI-compatible multimeter.
Conventions Used in This Guide
Angle brackets<>Items within angle brackets are parameter abbreviations. For example,
<NR1> indicates a specific form of numerical data.
Vertical bar|Vertical bars separate alternative parameters. For example, NORM | TEXT
indicates that either "TEXT" or "NORM" can be used as a parameter.
Square Brackets[]Items within square brackets are optional. The representation
[SOURce:]LIST means that SOURce: may be omitted.
Braces{}Braces indicate parameters that may be repeated zero or more times. It is
used especially for showing arrays. The notation <A>{<,B>} shows that
parameter "A" must be entered, while parameter "B" may be omitted or
may be entered one or more times.
Computer fontComputer font is used to show program lines in text. TRIGger:DELay .5
shows a program line.
Types of SCPI Commands
SCPI has two types of commands, common and subsystem.
u Common commands generally are not related to specific operation but to controlling overall ac
source functions, such as reset, status, and synchronization. All common commands consist of a
three-letter mnemonic preceded by an asterisk:*RST*IDN?*SRE 8
u Subsystem commands perform specific ac source functions. They are organized into an inverted
tree structure with the "root" at the top. Some are single commands while others are grouped
within specific subsystems.
Refer to appendix A for the ac source SCPI tree structure.
Types of SCPI Messages
There are two types of SCPI messages, program and response.
u A program message consists of one or more properly formatted SCPI commands sent from the
controller to the ac source. The message, which may be sent at any time, requests the ac source
to perform some action.
u A response message consists of data in a specific SCPI format sent from the ac source to the
controller. The ac source sends the message only when commanded by a program message
called a "query."
17
2 - Introduction to Programming
T
g
The SCPI Command Tree
As previously explained, the basic SCPI communication method involves sending one or more properly
formatted commands from the SCPI command tree to the instrument as program messages. The
following figure shows a portion of a subsystem command tree, from which you access the commands
located along the various paths (you can see the complete tree in appendix A).
ROO
:OUTPut
:STATus
[:STATe]
:COUPlin
:DFI
:PROTection
:OPERation
[:STATe]
:SOURce
:CLEar
:DELay
[:EVEN]
:CONDition?
?
Figure 2-1. Partial Command Tree
The Root Level
Note the location of the ROOT node at the top of the tree. Commands at the root level are at the top level
of the command tree. The SCPI interface is at this location when:
u the ac source is powered on
u a device clear (DCL) is sent to the ac source
u the SCPI interface encounters a message terminator
u the SCPI interface encounters a root specifier
Active Header Path
In order to properly traverse the command tree, you must understand the concept of the active header
path. When the ac source is turned on (or under any of the other conditions listed above), the active path
is at the root. That means the SCPI interface is ready to accept any command at the root level, such as
OUTPut or STATe.
If you enter OUTPut, the active header path moves one colon to the right . The interface is now ready to
accept :STATe, :COUPling, :DFI, or :PROTection as the next header. You must include the colon,
because it is required between headers.
If you now enter :PROTection, the active path again moves one colon to the right. The interface is now
ready to accept either :CLEar or :DELay as the next header.
18
Introduction to Programming - 2
If you now enter :CLEar, you have reached the end of the command string. The active header path
remains at :CLEar. If you wished, you could have entered :CLEar;DELay 20 and it would be accepted as
a compound message consisting of:
The message terminator after DELay 20 returns the path to the root.
The Effect of Optional Headers
If a command includes optional headers, the interface assumes they are there. For example, if you enter
OUTPut OFF, the interface recognizes it as OUTPut:STATe OFF. This returns the active path to the root
(:OUTPut). But if you enter |OUTPut:STATe OFF,| then the active path remains at :STATe. This allows
you to send
OUTPut:STATe OFF;PROTection:CLEar
in one message. If you tried to send
OUTPut OFF;PROTection:CLEar
the header path would return to :OUTPut instead of :PROTection.
The optional header [SOURce] precedes the current, frequency, function, phase, pulse, list, and voltage
subsystems. This effectively makes :CURRent, :FREQuency, :FUNCtion, :PHASe, :PULse, :LIST, and
:VOLTage root-level commands.
Moving Among Subsystems
In order to combine commands from different subsystems, you need to be able to restore the active path
to the root. You do this with the root specifier (:). For example, you could clear the output protection and
check the status of the Operation Condition register as follows:
The following message shows how to combine commands from different subsystems as well as within the
same subsystem:
VOLTage:LEVel 70;PROTection 80;:CURRent:LEVel 3;PROTection:STATe ON
Note the use of the optional header LEVel to maintain the correct path within the voltage and current
subsystems and the use of the root specifier to move between subsytems.
NOTE:The "Enhanced Tree Walking Implementation" given in appendix A of the IEEE 488.2
standard is not implemented in the ac source.
19
2 - Introduction to Programming
Including Common Commands
You can combine common commands with system commands in the same message. Treat the common
command as a message unit by separating it with a semicolon (the message unit separator). Common
commands do not affect the active header path; you may insert them anywhere in the message.
VOLTage:TRIGger 7.5;INITialize;*TRG
OUTPut OFF;*RCL 2;OUTPut ON
Using Queries
Observe the following precautions with queries:
u Set up the proper number of variables for the returned data.
u Read back all the results of a query before sending another command to the ac source. Otherwise
a Query Interrupted error will occur and the unreturned data will be lost.
Coupled Commands
When commands are coupled it means that the value sent by one command is affected by the settings of
the other commands. The following commands are coupled in the ac source:
u the voltage, voltage offset, and function shape commands
u the step, pulse, and list commands that control output voltages, voltage offsets, and function
shapes
u the pulse commands that program the width, duty cycle, period, and the hold parameter
u the voltage range and current limit commands in some ac source models
As explained later in Chapter 4, the order in which data is sent by these coupled commands can be
important when more than one parameter is changed.
Structure of a SCPI Message
SCPI messages consist of one or more message units ending in a message terminator. The terminator is
not part of the syntax, but implicit in the way your programming language indicates the end of a line (such
as a newline or end-of-line character).
The Message Unit
The simplest SCPI command is a single message unit consisting of a command header (or keyword)
followed by a message terminator.
ABORt<newline>
VOLTage?<newline>
The message unit may include a parameter after the header. The parameter usually is numeric, but it can
be a string:
VOLTage 20<newline>
VOLTage MAX<newline>
20
Introduction to Programming - 2
g
y
Message Terminator
CURR?
Combining Message Units
The following command message is briefly described here, with details in subsequent paragraphs.
Data
Message Unit
Headers
VOLT:LEV 80
Header Separator
Messa
e Unit Separators
Figure 2-2. Command Message Structure
The basic parts of the above message are:
Message ComponentExample
Headers
Header Separator
Data
Data Separator
Message Units
Message Unit Separator
Root Specifier
Query Indicator
Message Terminator
VOLT LEV PROT CURR
The colon in VOLT:LEV
8088
The space in VOLT 80 and PROT 88
VOLT:LEV 80 PROT 88 CURR?
The semicolons in VOLT:LEV 80; and PROT 88;
The colon in PROT 88;:CURR?
The question mark in CURR?
The <NL> (newline) indicator. Terminators are not part of the SCPI syntax
;
PROT 88
Root Specifier
Indicator
Quer
;
:
<NL>
Headers
Headers are instructions recognized by the ac source. Headers (which are sometimes known as
"keywords") may be either in the long form or the short form.
Long Form
Short Form
The SCPI interface is not sensitive to case. It will recognize any case mixture, such as TRIGGER, Trigger,
TRIGger.
NOTE:Short form headers result in faster program execution.
The header is completely spelled out, such as VOLTAGE, STATUS, and DELAY.
The header has only the first three or four letters, such as VOLT, STAT, and DEL.
21
2 - Introduction to Programming
Header
Convention
Header
Separator
Optional
Headers
In the command descriptions in Chapter 3 of this manual, headers are emphasized with
boldface type. The proper short form is shown in upper-case letters, such as DELay.
If a command has more than one header, you must separate them with a colon
(VOLT:PROT OUTPut:RELay:POLarity).
The use of some headers is optional. Optional headers are shown in brackets, such as
OUTPut[:STATe] ON. As previously explained under "The Effect of Optional Headers", if
you combine two or more message units into a compound message, you may need to
enter the optional header.
Query Indicator
Following a header with a question mark turns it into a query (VOLTage?, VOLTage:PROTection?). If a
query contains a parameter, place the query indicator at the end of the last header
(VOLTage:PROTection? MAX).
Message Unit Separator
When two or more message units are combined into a compound message, separate the units with a
semicolon (STATus:OPERation?;QUEStionable?).
Root Specifier
When it precedes the first header of a message unit, the colon becomes the root specifier. It tells the
command parser that this is the root or the top node of the command tree. Note the difference between
root specifiers and header separators in the following examples:
All colons are header separators
Only the first colon is a root specifier
Only the third colon is a root specifier
NOTE:You do not have to precede root-level commands with a colon; there is an implied colon in
front of every root-level command.
Message Terminator
A terminator informs SCPI that it has reached the end of a message. Three permitted messages
terminators are:
u newline (<NL>), which is ASCII decimal 10 or hex 0A.
u end or identify (<END>)
u both of the above (<NL><END>).
In the examples of this guide, there is an assumed message terminator at the end of each message. If the
terminator needs to be shown, it is indicated as <NL> regardless of the actual terminator character.
22
Introduction to Programming - 2
SCPI Data Formats
All data programmed to or returned from the ac source is ASCII. The data may be numerical or character
string.
Numerical Data Formats
SymbolData Form
Talking Formats
<NR1>
<NR2>
<NR3>
<Bool>
<Nrf>
<Nrf+>
<Bool>
Digits with an implied decimal point assumed at the right of the least-significant digit.
Examples: 273
Digits with an explicit decimal point. Example: .0273
Digits with an explicit decimal point and an exponent. Example: 2.73E+2
Boolean Data. Example: 0 | 1 or OFF | ON (0 = OFF; 1 = ON)
Listening Formats
Extended format that includes <NR1>, <NR2> and <NR3>. Examples: 273273. 2.73E2
Expanded decimal format that includes <NRf> and MINMAX. Examples: 273 73.2 .73E2
MAX. MIN and MAX are the minimum and maximum limit values that are implicit in the
range specification for the parameter.
Boolean Data. Example: 0 | 1
Suffixes and Multipliers
ClassSuffixUnitUnit with Multiplier
CurrentAampereMA (milliampere)
AmplitudeVvoltMV (millivolt)
TimeSsecondMS (millisecond)
FrequencyHZHertzKHZ (kilohertz)
Common Multipliers
1E3Kkilo
1E-3Mmilli
1E-6Umicro
Character Data
Character strings returned by query statements may take either of the following forms, depending on the
length of the returned string:
<CRD>
<AARD>
<SRD>
Character Response Data. Permits the return of character strings.
Arbitrary ASCII Response Data. Permits the return of undelimited 7-bit ASCII. This data type
has an implied message terminator.
String Response Data. Returns string parameters enclosed in double quotes.
23
2 - Introduction to Programming
System Considerations
The remainder of this chapter addresses some system issues concerning programming. These are ac
source addressing and the use of the following types of GPIB system interfaces:
u HP Vectra PC controller with Agilent 82335A GPIB Interface Command Library
u IBM PC controller with National Instruments GPIB-PCII Interface/Handler
u Agilent controller with Agilent BASIC Language System
Assigning the GPIB Address in Programs
The ac source address cannot be set remotely. It must be set from the front panel. Once the address is
set, you can assign it inside programs. The following examples assume that the GPIB select code is 7,
and the ac source will be assigned to the variable ACS.
For systems using the National Instruments DOS driver, the address is specified in the software
configuration program (IBCONFIG.EXE) and assigned a symbolic name. The address then is referenced
only by this name within the application program (see the National Instruments GPIB documentation).
Types of DOS Drivers
The Agilent 82335A and National Instruments GPIB are two popular DOS drivers. Each is briefly
described here. See the software documentation supplied with the driver for more details.
Agilent 82335A Driver
For GW-BASIC programming, the GPIB library is implemented as a series of subroutine calls. To access
these subroutines, your application program must include the header file SETUP.BAS, which is part of the
DOS driver software.
SETUP.BAS starts at program line 5 and can run up to line 999. Your application programs must begin at
line 1000. SETUP.BAS has built-in error checking routines that provide a method to check for GPIB errors
during program execution. You can use the error-trapping code in these routines or write your own code
using the same variables as used by SETUP.BAS.
National Instruments GPIB Driver
Your program must include the National Instruments header file DECL.BAS. This contains the initialization
code for the interface. Prior to running any applications programs, you must set up the interface with the
configuration program (IBCONF.EXE).
Your application program will not include the ac source symbolic name and GPIB address. These must
be specified during configuration (when you run IBCONF.EXE). Note that the primary address range is
from 0 to 30 but any secondary address must be specified in the address range of 96 to 126. The
instrument expects a message termination on EOI or line feed, so set EOI w/last byte of Write. It is also
recommended that you set Disable Auto Serial Polling.
All function calls return the status word IBSTA%, which contains a bit (ERR) that is set if the call results in
an error. When ERR is set, an appropriate code is placed in variable IBERR%. Be sure to check IBSTA%
after every function call. If it is not equal to zero, branch to an error handler that reads IBERR% to extract
the specific error.
24
Introduction to Programming - 2
Error Handling
If there is no error-handling code in your program, undetected errors can cause unpredictable results. This
includes "hanging up" the controller and forcing you to reset the system. Both of the above DOS drivers
have routines for detecting program execution errors.
ImportantUse error detection after every call to a subroutine.
Agilent BASIC Controllers
The Agilent BASIC Programming Language provides access to GPIB functions at the operating system
level. This makes it unnecessary to have the header files required in front of DOS applications programs.
Also, you do not have to be concerned about controller "hangups" as long as your program includes a
timeout statement. Because the ac source can be programmed to generate SRQ on errors, your program
can use an SRQ service routine for decoding detected errors. The detectable errors are listed in Appendix
C.
25
3
Language Dictionary
Introduction
This section gives the syntax and parameters for all the IEEE 488.2 SCPI commands and the Common
commands used by the ac sources when operating in Normal mode. It is assumed that you are familiar
with the material in Chapter 2 "Introduction to Programming". Because the SCPI syntax remains the same
for all programming languages, the examples given for each command are generic.
Syntax Forms
Parameters
Models
Phases
Related
Commands
Order of
Presentation
Syntax definitions use the long form, but only short form headers (or "keywords")
appear in the examples. Use the long form to help make your program selfdocumenting.
Most commands require a parameter and all queries will return a parameter.The range
for a parameter may vary according to the model of ac source. Parameters for all
models are listed in the Specifications table in the User’s Guide.
If a command only applies to specific models, those models are listed in the <Model>
Only entry. If there is no <Model> Only entry, the command applies to all models.
If a command can apply to individual phases of an , the entry Phase Selectable will
appear in the command description.
Where appropriate, related commands or queries are included. These are listed
because they are either directly related by function, or because reading about them will
clarify or enhance your understanding of the original command or query.
The dictionary is organized as follows:
uSubsystem commands, arranged by subsystem
uIEEE 488.2 common commands
27
3 - Language Dictionary
Subsystem Commands
Subsystem commands are specific to functions. They can be a single command or a group of
commands. The groups are comprised of commands that extend one or more levels below the root. The
description of common commands follows the description of the subsystem commands.
The subsystem command groups are listed in alphabetical order and the commands within each
subsystem are grouped alphabetically under the subsystem. Commands followed by a question mark (?)
take only the query form. When commands take both the command and query form, this is noted in the
syntax descriptions.
You will find the subsystem command groups discussed on the following pages:
The commands in this subsystem allow you to do the following:
u Enable and disable the calibration mode
u Change the calibration password
u Calibrate the current and voltage output levels, and store new calibration constants in nonvolatile
memory.
Subsystem Syntax
CALibrate
:CURRent
:ACBegin ac current programming calibration sequence
:MEASureBegin current measurement calibration sequence
:DATA <n>Input a calibration measurement
:IMPedanceBegin output impedance calibration sequence
:LEVel <level>Advance to next calibration step (P1 | P2 | P3 | P4)
:PASSword <n>Set calibration password
:PWM
:FREQuency <n> Trim pulse width modulator frequency
:RAMP <n>Trim pulse width modulator ramp
:SAVESave new cal constants in non-volatile memory
:STATE <bool> [,<n>]Enable or disable calibration mode
:VOLTage
:ACBegin ac voltage calibration sequence
:DCBegin dc voltage calibration sequence
:OFFSetBegin offset voltage calibration sequence
:PROTectionBegin voltage protection calibration sequence
:RTIMeBegin realtime voltage calibration sequence
CALibrate:CURRent:AC
Phase Selectable
This command can only be used in the calibration mode. It initiates the calibration of the ac current limit
and metering circuits.
Command Syntax
Parameters
Examples
Related Commands
CALibrate:CURRent:AC
None
CAL:CURR:AC
CAL:STAT CAL:SAV CAL:LEV
29
3 - Language Dictionary
CALibrate:CURRent:MEASure
Agilent 6811B, 6812B, 6813B, 6843A Only
This command is used to initiate the calibration of the current metering circuits and the peak current limit
circuits. It can only be used in the calibration mode.
Command Syntax
Parameters
Examples
Related Commands
CALibrate:CURRent:MEASure
None
CAL:CURR:MEAS
CAL:STAT CAL:SAV CAL:LEV
CALibrate:DATA
Phase Selectable
This command is only used in calibration mode. It enters a calibration value that you obtain by reading an
external meter. You must first select a calibration level (with CALibrate:LEVel) for the value being entered.
These constants are not stored in nonvolatile memory until they are saved with CALibrate:SAVE. If
CALibrate:STATE OFF is programmed without a CALibrate:SAVE, the previous calibration constants are
restored.
Command Syntax
Parameters
Examples
Related Commands
CALibrate:DATA <NRf>
<external reading>
A
Unit
(amperes)
CAL:DATA 3222.3 MA CAL:DATA 5.000
CAL:STAT CAL:SAV
CALibrate:IMPedance
Agilent 6811B, 6812B, 6813B, 6843A Only
This command can only be used in calibration mode. It calibrates the output impedance circuits. The
automatically performs the calibration and stores the impedance constant in nonvolatile memory.
CALibrate:IMPedance is a sequential command that takes several seconds to complete.
Command Syntax
Parameters
Examples
Related Commands
CALibrate:IMPedance
None
CAL:IMP
CAL:STAT CAL:SAV
CALibrate:LEVel
Phase Selectable
This command can only be used in calibration mode. It is used to advance to the next state in the
calibration sequence.
Command Syntax
Parameters
Examples
Related Commands
CALibrate:LEVel <level>
P1 | P2 | P3 | P4
CAL:LEV P2
CAL:STAT CAL:SAV
30
Loading...
+ 157 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.