Agilent Technologies 6632B, 66312A, 6613C, 6633B, 66332A User Manual

...
0 (0)
Programming Guide
Dynamic Measurement DC Source
Agilent Models 66312A, 66332A
System DC Power Supply
Agilent Models 6631B, 6632B, 6633B, 6634B
6611C, 6612C, 6613C, 6614C
Agilent Part No. 5962-8198 Printed in U.S.A. Microfiche No 5962-8199 January, 2000

Safety Guidelines

The beginning of the Operating Guide has a Safety Summary page. Be sure you are familiar with the information on this page before programming the dc source for operation from a controller.

Printing History

The edition and current revision of this manual are indicated below. Reprints of this guide 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 guide.
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 without notice.
Copyright 1997 Agilent Technologies Edition 1 November, 1997
Update 1 December, 1998 Update 2 January, 2000

Table of Contents

Safety Guidelines 2 Printing History 2 Table of Contents 3
1 - GENERAL INFORMATION 7
About this Guide 7 Documentation Summary 7 External References 8
GPIB References 8 SCPI References 8
2 - INTRODUCTION TO PROGRAMMING 9
VXIplug&play Power Products Instrument Drivers 9
Supported Applications 9 System Requirements 9 Downloading and Installing the Driver 9 Accessing Online Help 10
GPIB Capabilities of the DC Source 10
GPIB Address 10
RS-232 Capabilities of the DC Source 10
RS-232 Data Format 10 RS-232 Flow Control 11 RS-232 Programming Example 11 RS-232 Troubleshooting 12
Introduction to SCPI 12
Conventions Used in This Guide 12
Types of SCPI Commands 13
Multiple Commands in a Message 13 Moving Among Subsystems 14 Including Common Commands 14 Using Queries 14
Types of SCPI Messages 14
The Message Unit 15 Headers 15 Query Indicator 15 Message Unit Separator 15 Root Specifier 15 Message Terminator 15
SCPI Data Formats 16
Numerical Data Formats 16 Suffixes and Multipliers 16 Response Data Types 16
SCPI Command Completion 17 Using Device Clear 17
3 - PROGRAMMING THE DC SOURCE 19
Introduction 19 Programming the Output 19
Power-on Initialization 19 Enabling the Output 19 Output Voltage 20 Output Current 20
Triggering Output Changes 21
SCPI Triggering Nomenclature 21
Output Trigger System Model 21 Setting the Voltage or Current Trigger Levels 21 Initiating the Output Trigger System 22 Generating Triggers 22
Making Measurements 23
Voltage and Current Measurements 23
Internally Triggered Measurements 25
SCPI Triggering Nomenclature 25 Measurement Trigger System Model 25 Initiating the Measurement Trigger System (Agilent 66312A, 66332A Only) 25 Selecting the Measurement Trigger Source (Agilent 66312A, 66332A Only) 26 Generating Measurement Triggers (Agilent 66312A, 66332A Only) 26
Measuring Output Pulses (Agilent 66312A, 66332A Only) 28
Current Detector 28 Pulse Measurement Queries 28
Controlling Measurement Samples 29
Varying the Voltage or Current Sampling Rate 29 Multiple Measurements (Agilent 66312A, 66332A Only) 29 Pre-event and Post-event Triggering (Agilent 66312A, 66332A Only) 30 Pulse Measurement Example (Agilent 66312A, 66332A only) 30
Programming the Status Registers 32
Power-On Conditions 32 Operation Status Group 33 Questionable Status Group 34 Standard Event Status Group 34 Status Byte Register 34 Determining the Cause of a Service Interrupt 35 Servicing Operation Status and Questionable Status Events 35 Monitoring Both Phases of a Status Transition 36
Inhibit/Fault Indicator 36
Remote Inhibit (RI) 36 Discrete Fault Indicator (DFI) 36 Using the Inhibit/Fault Port as a Digital I/O 37 DFI Programming Example 37
4 - LANGUAGE DICTIONARY 39
Introduction 39
Subsystem Commands 39 Common Commands 43 Programming Parameters 43
Calibration Commands 44
CALibrate:CURRent 44 CALibrate:CURRent:NEGative 44 CALibrate:CURRent:MEASure:LOWRange 44 CALibrate:CURRent:MEASure:AC 44 CALibrate:DATA 45 CALibrate:LEVel 45 CALibrate:PASSword 45 CALibrate:SAVE 45 CALibrate:STATe 46 CALibrate:VOLTage 46 CALibrate:VOLTage:PROTection 46
Measurement Commands 47
MEASure:ARRay:CURRent? FETCh:ARRay:CURRent? 47 MEASure:ARRay:VOLTage? FETCh:ARRay:VOLTage? 47
MEASure:CURRent? FETCh:CURRent? 48 MEASure:CURRent:ACDC? FETCh:CURRent:ACDC? 48 MEASure:CURRent:HIGH? FETCh:CURRent:HIGH? 48 MEASure:CURRent:LOW? FETCh:CURRent:LOW? 49 MEASure:CURRent:MAXimum? FETCh:CURRent: MAXimum? 49 MEASure:CURRent:MINimum? FETCh:CURRent:MINimum? 49 MEASure:VOLTage? FETCh:VOLTage? 50 MEASure:VOLTage:ACDC? FETCh:VOLTage:ACDC? 50 MEASure:VOLTage:HIGH? FETCh:VOLTage:HIGH? 50 MEASure:VOLTage:LOW? FETCh:VOLTage:LOW? 51 MEASure:VOLTage:MAXimum? FETCh:VOLTage:MAXimum? 51 MEASure:VOLTage:MINimum? FETCh:VOLTage:MINimum? 51 SENSe:CURRent:RANGe 52 SENSe:CURRent:DETector 52 SENSe:FUNCtion 53 SENSe:SWEep:OFFSet:POINts 53 SENSe:SWEep:POINts 53 SENSe:SWEep:TINTerval 53 SENSe:WINDow 54
Output Commands 55
OUTPut 55 OUTPut:DFI 55 OUTPut:DFI:SOURce 55 OUTPut:PON:STATe 56 OUTPut:PROTection:CLEar 56 OUTPut:PROTection:DELay 56 OUTPut:RELay 57 OUTPut:RELay:POLarity 57 OUTPut:RI:MODE 57 [SOURce:]CURRent 58 [SOURce:]CURRent:TRIGger 58 [SOURce:]CURRent:PROTection:STATe 58 [SOURce:]DIGital:DATA 59 [SOURce:]DIGital:FUNCtion 59 [SOURce:]VOLTage:ALC:BANDwidth? [SOURce:]VOLTage:ALC:BWIDth? 60 [SOURce:]VOLTage:TRIGger 60 [SOURce:]VOLTage:PROTection 60
Status Commands 61
STATus:PRESet 61 STATus:OPERation? 61 STATus:OPERation:CONDition? 61 STATus:OPERation:ENABle 62 STATus:OPERation:NTR STATus:OPERation:PTR 62 STATus:QUEStionable? 63 STATus:QUEStionable:CONDition? 63 STATus:QUEStionable:ENABle 63 STATus:QUEStionable:NTR STATus:QUEStionable:PTR 64 *CLS 64 *ESE 65 *ESR? 65 *OPC 65 *PSC 66 *SRE 66 *STB? 67 *WAI 67
System Commands 68
DISPlay 68 DISPlay:MODE 68 DISPlay:TEXT 68 SYSTem:ERRor? 69 SYSTem:LANGuage 69 SYSTem:VERSion? 69 SYSTem:LOCal 70 SYSTem:REMote 70 SYSTem:RWLock 70 *IDN? 70 *OPT? 71 *RCL 71 *RST 71 *SAV 72 *TST? 72
Trigger Commands 73
ABORt 73 INITiate:SEQuence INITiate:NAME 73 INITiate:CONTinuous:SEQuence1 INITiate:CONTinuous:NAME 73 TRIGger 74 TRIGger:SOURce 74 TRIGger:SEQuence2 TRIGger:ACQuire 74 TRIGger:SEQuence2:COUNt:CURRent TRIGger:ACQuire:COUNt:CURRent 75 TRIGger:SEQuence2:COUNt:VOLTage TRIGger:ACQuire:COUNt:VOLTage 75 TRIGger:SEQuence2:HYSTeresis:CURRent TRIGger:ACQuire:HYSTeresis:CURRent 76 TRIGger:SEQuence2:HYSTeresis:VOLTage TRIGger:ACQuire:HYSTeresis:VOLTage 76 TRIGger:SEQuence2:LEVel:CURRent TRIGger:ACQuire:LEVel:CURRent 77 TRIGger:SEQuence2:LEVel:VOLTage TRIGger:ACQuire:LEVel:VOLTage 77 TRIGger:SEQuence2:SLOPe:CURRent TRIGger:ACQuire:SLOPe:CURRent 78 TRIGger:SEQuence2:SLOPe:VOLTage TRIGger:ACQuire:SLOPe:VOLTage 78 TRIGger:SEQuence2:SOURce TRIGger:ACQuire:SOURce 79 TRIGger:SEQuence1:DEFine TRIGger:SEQuence2:DEFine 79 *TRG 79
A - SCPI CONFORMANCE INFORMATION 81
SCPI Version 81
SCPI Confirmed Commands 81 Non-SCPI Commands 81
B - COMPATIBILITY LANGUAGE 83
Introduction 83
C - ERROR MESSAGES 89
Error Number List 89
D - EXAMPLE PROGRAMS 93
Introduction 93
Assigning the GPIB Address in Programs 93 Types of DOS Drivers 93 Error Handling 94 BASIC Controllers 94 Example 1. HP Vectra PC Controller Using Agilent 82335 Interface 94 Example 2. IBM Controller Using National Interface 96 Example 3. Controller Using BASIC 98
INDEX 99

General Information

About this Guide

This guide provides remote programming information for the following series of GPIB programmable dc power supplies:
Agilent 66312A
Agilent 66332A
Agilent 6631B/6632B/6633B/6634B
Agilent 6611C/6612C/6613C/6614C You will find the following information in the rest of this guide: Chapter 1 Introduction to this guide.
Chapter 2 Introduction to SCPI messages structure, syntax, and data formats. Examples of SCPI
programs Chapter 3 Introducton to Programming the dc source with SCPI commands. Chapter 4 Dictionary of SCPI commands. Appendix A SCPI conformance information.
1
Appendix B Use of the alternate Comptibility programming language. Appendix C Error messages

Documentation Summary

The following documents that are related to this Programming Guide have additional helpful information for using the dc source.
User’s Guide for Agilent 66312A and Agilent 6611C/6612C/6613C/3314C. Includes specifications and supplemental characteristics, how to use the front panel, how to connect to the instrument, and calibration procedures.
User’s Guide for Agilent 66332A and Agilent 6631B/6632B/6633B/6634B. Includes specifications and supplemental characteristics, how to use the front panel, how to connect to the instrument, and calibration procedures.
1 - General Information

External References

GPIB References
The most important GPIB documents are your controller programming manuals - 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
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 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. The WEB address is www.ieee.org.
. Recommended as a reference only if you intend to do fairly sophisticated
.
SCPI References
The following documents will assist you with programming in SCPI:
Standard Commands for Programmable Instruments Volume 1, Syntax and Style
Standard Commands for Programmable Instruments Volume 2, Command References
Standard Commands for Programmable Instruments Volume 3, Data Interchange Format
Standard Commands for Programmable Instruments Volume 4, Instrument Classes
To obtain a copy of the above documents, contact: Fred Bode, Executive Director, SCPI Consortium, 8380 Hercules Drive, Suite P3, Ls Mesa, CA 91942, USA

Introduction to Programming

VXI
plug&play
VXI
plug&play
Web at http://www.agilent.com/find/drivers. These instrument drivers provide a high-level programming interface to your Agilent Technologies instrument. VXI 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.
Supported Applications
ñ Agilent VEE ñ Microsoft Visual BASIC ñ Microsoft Visual C/C++ ñ Borland C/C++ ñ National Instruments LabVIEW ñ National Instruments LabWindows/CVI
instrument drivers for Microsoft Windows 95 and Windows NT are now available on the
Power Products Instrument Drivers
plug&play
instrument drivers are an alternative to
2
System Requirements
The VXI
ñ 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 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.agilent.com/find/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.
2 - Introduction to Programming
6.To use the VXI
under “Introduction to Programming”.
plug&play
instrument driver, follow the directions in the VXI
plug&play
online help
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.

GPIB Capabilities of the DC Source

All dc source functions except for setting the GPIB address are programmable over the GPIB. The IEEE
488.2 capabilities of the dc source are listed in the Specifications Table of the User's Guide.
GPIB Address
The dc source operates from an 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. The GPIB address is stored in non-volatile memory.

RS-232 Capabilities of the DC Source

The dc source provides an RS-232 programming interface, which is activated by commands located under the front panel Address key. All SCPI and COMPatibility 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 dc 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 10-bit word with one start bit and one stop bit. The number of start and stop bits is not programmable. However, the following parity options are selectable using the front panel Address key:
EVEN Seven data bits with even parity ODD Seven data bits with odd parity MARK Seven data bits with mark parity (parity is always true) SPACE Seven data bits with space parity (parity is always false) NONE Eight data bits without parity
Parity options are stored in non-volatile memory.
10
Introduction to Programming - 2
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
RS-232 Flow Control
The RS-232 interface supports several flow control options that are selected using the front panel Address key. For each case, the dc source will send a maximum of five characters after holdoff is asserted by the controller. The dc source is capable of receiving as many as fifteen additional characters after it asserts holdoff.
XON-XOFF A software handshake that uses the ASCII control code DC3 (decimal code
19) to assert hold-off, and control code DC1 (decimal code 17) to release hold-off.
RTS-CTS The dc source asserts its Request to Send (RTS) line to signal hold-off
when its input buffer is almost full, and it interprets its Clear to Send (CTS) line as a hold-off signal from the controller.
DTR-DSR The dc source asserts its Data Terminal Ready (DTR) line to signal hold-off
when its input buffer is almost full, and it interprets its Data Set Ready (DSR) line as a hold-off signal from the controller.
NONE There is no flow control. Flow control options are stored in non-volatile memory.
RS-232 Programming Example
The following program illustrates how to program the power supply using RS-232 to set the output voltage and current and to readback the model number and output voltage. The program was written to run on any controller using Microsoft QBasic.
NOTE: The power supply must be configured for RS232 and the same baud rate and parity as
the controller.
‘ Program to write and read via RS232. ‘ Configure the power supply for 9600 baud, even parity and 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$ () CLS ‘ Clears screen LOCATE 1, 1 ‘ Position curser at top left ‘ Configure Com Port OPEN “com1:9600,e,7,2,rs,cd,pe,lf” FOR RANDOM AS #1 LEN = 1000 PRINT #1, “OUTPUT ON” ‘ Turn on output then set voltage and current PRINT #1, “VOLT 6” ‘ Set voltage to 6 volts PRINT #1, “CURR .5” ‘ Set current to 0.5 amps PRINT #1, “*IDN?” ‘ Query the power supply identification string PRINT gets$ ‘ Go to gets$ Function and print data returned PRINT #1, MEAS”VOLT?”; volt ‘ Query the power supply voltage Volt = VAL (gets$) ‘ Convert gets$ string to a value PRINT gets$ ‘ Print the value of the voltage END ‘ End of main program
11
2 - Introduction to Programming
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$ ‘ Concantenate 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 dc source must be configured for the same baud rate, parity, number of data bits, and flow control options. Note that the dc source is configured for 1 start bit and 1 stop bit (these values are fixed).
The correct interface cables or adaptors must be used, as described under RS-232 Connector. 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.).

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 dc 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:].
VOLTage 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.
Boldface font
Computer font Computer font is used to show program lines in text.
Boldface font is used to emphasize syntax in command definitions. TRIGger:COUNt:CURRent <NRf> shows command definition.
TRIGger:COUNt:CURRent 10 shows a program line.
12

Types of SCPI Commands

SCPI has two types of commands, common and subsystem.
Common commands generally are not related to specfic operation but to controlling overall dc source functions, such as reset, status, and synchronization. All common commands consist of a three-letter nmemonic preceded by an asterisk: *RST *IDN? *SRE 8
Subsystem commands perform specific dc source functions. They are organized into an inverted tree structure with the "root" at the top. 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 Table 4-1.
ROOT
Introduction to Programming - 2
:OUTPut
:STATus
[:STATe] :DFI
:PON
:PROTection
:OPERation
[:STATe] :SOURce
:STATe
:CLEar :DELay
?
[:EVEN]
:CONDition?
Figure 2-1. Partial Command Tree
Multiple Commands in a Message
Multiple SCPI commands can be combined and sent as a single message with one message terminator. There are two important considerations when sending several commands within a single message:
Use a semicolon to separate commands within a message.
There is an implied header path that affects how commands are interpreted by the dc source.
The header path can be thought of as a string that gets inserted before each command within a message. For the first command in a message, the header path is a null string. For each subsequent command the header path is defined as the characters that make up the headers of the previous command in the message up to and including the last colon seperator. An example of a message with two commands is:
CURR:LEV 3;PROT:STAT OFF
which shows the use of the semicolon separating the two commands, and also illustrates the header path concept. Note that with the second command, the leading header "CURR" was omitted because after the "CURR:LEV 3" command, the header path was became defined as "CURR" and thus the instrument interpreted the second command as:
CURR:PROT:STAT OFF
In fact, it would have been syntactically incorrect to include the "CURR" explicitly in the second command, since the result after combining it with the header path would be:
CURR:CURR:PROT:STAT OFF
which is incorrect.
13
2 - Introduction to Programming
Moving Among Subsystems
In order to combine commands from different subsystems, you need to be able to reset the header path to a null string within a message. You do this by beginning the command with a colon (:), which discards any previous header path. For example, you could clear the output protection and check the status of the Operation Condition register in one message by using a root specifier as follows:
OUTPut:PROTection:CLEAr;:STATus:OPERation:CONDition?
The following message shows how to combine commands from different subsystems as well as within the same subsystem:
VOLTage:LEVel 20;PROTection 28; :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.
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
VOLTage:TRIGgered 17.5;:INITialize;*TRG OUTPut OFF;*RCL 2;OUTPut ON
do not affect the header path
; you may insert them anywhere in the message.
Using Queries
Observe the following precautions with queries:
Set up the proper number of variables for the returned data.
Read back all the results of a query before sending another command to the dc source. Otherwise a
Query Interrupted
error will occur and the unreturned data will be lost.

Types of SCPI Messages

There are two types of SCPI messages, program and response.
program message
A controller to the dc source. The message, which may be sent at any time, requests the dc source to perform some action.
response message
A controller. The dc source sends the message only when commanded by a program message called a "query."
The following figure illustrates SCPI message structure:
consists of one or more properly formatted SCPI commands sent from the
consists of data in a specific SCPI format sent from the dc source to the
14
Ke
y
y
g
g
Query Indicator
Root Specifier
Data
words
Messa
Introduction to Programming - 2
e Unit
VOLT
word Separator
Ke
:LEV 20
Messa
e Unit Separators
PROT 21;; : CURR?
Message Terminator
<NL>
Figure 2-2. Command Message Structure
The Message Unit
The simplest SCPI command is a single message unit consisting of a command header (or keyword) followed by a message terminator. The message unit may include a parameter after the header. The parameter can be numeric or a string.
ABORt<NL> VOLTage 20<NL>
Headers
Headers, also referred to as keywords, are instructions recognized by the dc source. Headers may be either in the long form or the short form. In the long form, the header is completely spelled out, such as VOLTAGE, STATUS, and DELAY. In the short form, the header has only the first three or four letters, such as VOLT, STAT, and DEL.
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.
Message Terminator
A terminator informs SCPI that it has reached the end of a message. Three permitted messages terminators are:
newline (<NL>), which is ASCII decimal 10 or hex 0A.end or identify (<END>)both of the above (<NL><END>).
In the examples of this guide, there is an assumed message terminator at the end of each message.
15
2 - Introduction to Programming
NOTE:
All RS-232 response data sent by the dc source is terminated by the ASCII character pair <carriage return><newline>. This differs from GPIB response data which is terminated by the single character <newline> with EOI asserted.

SCPI Data Formats

All data programmed to or returned from the dc source is ASCII. The data may be numerical or character string.
Numerical Data Formats
Symbol Data Form
Talking Formats <NR1> Digits with an implied decimal point assumed at the right of the least-significant digit.
Examples: 273 <NR2> <NR3> Listening Formats <Nrf>
Digits with an explicit decimal point. Example: .0273
Digits with an explicit decimal point and an exponent. Example: 2.73E+2
Extended format that includes <NR1>, <NR2> and <NR3>. Examples: 273 273. 2.73E2 <Nrf+>
<Bool>
Expanded decimal format that includes <NRf> and MIN MAX. Examples: 273 273.
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 or ON | OFF
Suffixes and Multipliers
Class Suffix Unit Unit with Multiplier
Current A ampere MA (milliampere)
Amplitude V volt MV (millivolt)
Time S second MS (millisecond)
Common Multipliers
1E3 K kilo 1E-3 M milli 1E-6 U micro
Response Data Types
Character strings returned by query statements may take either of the the following forms, depending on the length of the returned string:
<CRD> Character Response Data. Permits the return of character strings. <AARD> Arbitrary ASCII Response Data. Permits the return of undelimited 7-bit ASCII. This data type
has an implied message terminator.
<SRD> String Response Data. Returns string parameters enclosed in double quotes.
16
Introduction to Programming - 2

SCPI Command Completion

SCPI commands sent to the dc source are processed either sequentially or in parallel. Sequential commands finish execution before a subsequent command begins. Parallel commands allow other commands to begin executing while the parallel command is still executing. Commands that affect trigger actions are among the parallel commands.
The *WAI, *OPC, and *OPC? common commands provide different ways of indicating when all transmitted commands, including any parallel ones, have completed their operations. The syntax and parameters for these commands are described in chapter 4. Some practical considerations for using these commands are as follows:
*WAI
*OPC?
*OPC
This prevents the dc source from processing subsequent commands until all pending operations are completed.
This places a 1 in the Output Queue when all pending operations have completed. Because it requires your program to read the returned value before executing the next program statement, *OPC? can be used to cause the controller to wait for commands to complete before proceeding with its program.
This sets the OPC status bit when all pending operations have completed. Since your program can read this status bit on an interrupt basis, *OPC allows subsequent commands to be executed.
NOTE: The trigger subsystem must be in the Idle state in order for the status OPC bit to be true.
Therefore, as far as triggers are concerned, OPC is false whenever the trigger subsystem is in the Initiated state.

Using Device Clear

You can send a device clear at any time abort a SCPI command that may be hanging up the GPIB interface. The status registers, the error queue, and all configuration states are left unchanged when a device clear message is received. Device clear performs the following actions:
The input and output buffers of the dc source are cleared.
The dc source is prepared to accept a new command string.
The following statement shows how to send a device clear over the GPIB interface using
CLEAR 705
The following statement shows how to send a device clear over the GPIB interface using the GPIB command library for
IOCLEAR (705)
C
IEEE-488 Device Clear
or
QuickBASIC
:
Agilent BASIC:
NOTE: For RS-232 operation, sending a Break will perform the same operation as the IEE-488
device clear message.
17

Programming the DC Source

Introduction
This chapter contains examples on how to program your dc source. Simple examples show you how to program:
u output functions such as voltage and current u internal and external triggers u measurement functions u the status and protection functions
NOTE: These examples in this chapter show which commands are used to perform a particular
function, but do not show the commands being used in any particular programming environment. Refer to Appendix D for some examples of SCPI commands in a specific programming environment.
3

Programming the Output

Power-on Initialization
When the dc source is first turned on, it wakes up with the output state set OFF. In this state the output voltage is set to 0. The following commands are given implicitly at power-on:
*RST *CLS STATus:PRESet *SRE 0 *ESE 0
*RST is a convenient way to program all parameters to a known state. Refer to the *RST command in chapter 4 to see how each programmable parameter is set by *RST. Refer to the *PSC command in chapter 4 for more information on the power-on initialization of the *ESE and the *SRE registers.
Enabling the Output
To enable the output, use the command:
OUTPut ON
19
3 - Programming the DC Source
Output Voltage
The output voltage is controlled with the VOLTage command. For example, to set the output voltage to 25 volts, use:
VOLTage 125
The dc source can be programmed to turn off its output if the output voltage exceeds a preset peak voltage limit. This protection feature is implemented with the VOLTage:PROTection command as explained in chapter 4.
Maximum Voltage
The maximum rms output voltage that can be programmed can be queried with:
VOLTage? MAX
Output Current
All models have a programmable current function. The command to program the current is:
CURRent <n>
where <n> is the current limit in amperes. If the load attempts to draw more current than the programmed limit, the output voltage is reduced to keep
the current within the limit.
Maximum Current
The maximum output current that can be programmed can be queried with:
CURRent? MAX
Overcurrent Protection
The dc source can also be programmed to turn off its output if the current limit is reached. As explained in chapter 4, this protection feature is implemented the following command:
CURRent:PROTection:STATe ON | OFF
NOTE: Use OUTP:PROT:DEL to prevent momentary current limit conditions caused by
programmed output changes from tripping the overcurrent protection.
20
Programming the DC Source - 3
INITIATED STATE
IDLE STATE
TRIGGER RECEIVED
INITiate[:IMMediate]

Triggering Output Changes

The dc source has two independent trigger systems. One is used for generating output changes, and the other is used for triggering measurements. This section describes the output trigger system. The measurement trigger system is described under "Triggering Measurements".
SCPI Triggering Nomenclature
In SCPI terms, trigger systems are called sequences. When more than one trigger system exists, they are differentiated by naming them SEQuence1 and SEQuence2. SEQuence1 is the transient trigger system and SEQuence2 is the measurement trigger system. The dc source uses aliases with more descriptive names for these sequences. These aliases can be used instead of the sequence forms.
Sequence Form Alias
SEQuence1 TRANsient SEQuence2 ACQuire
Output Trigger System Model
Figure 3-1 is a model of the output trigger system. The rectangular boxes represent states. The arrows show the transitions between states. These are labeled with the input or event that causes the transition to occur.
ABORt
INITiate:CONTinuous OFF
INITiate:CONTinuous ON
OUTPUT
LEVEL
CHANGE
*RST *RCL
Figure 3-1. Model of Output Triggers
Setting the Voltage or Current Trigger Levels
To program output trigger levels, you must first specify a voltage or current trigger level that the output will go to once a trigger signal is received. Use the following commands to set the output trigger level:
VOLTage:TRIGgered <n> or CURRent:TRIGgered <n>
NOTE: Until they are programmed, uninitialized trigger levels will assume their corresponding
immediate levels. For example, if a dc source is powered up and VOLTage:LEVel is programmed to 6, then VOLTage:LEVel:TRIGger will also be 6 until you program it to another value. Once you program VOLTage:LEVel:TRIGger to a value, it will remain at that value regardless of how you subsequently reprogram VOLTage:LEVel.
21
3 - Programming the DC Source
Initiating the Output Trigger System
When the dc source is turned on, the trigger subsystem is in the idle state. In this state, the trigger subsystem ignores all triggers. Sending the following commands at any time returns the trigger system to the Idle state:
ABORt *RST *RCL
The INITiate commands move the trigger system from the Idle state to the Initiated state. This enables the dc source to receive triggers. To initiate for a single triggered action, use:
INITiate:SEQuence1or INITiate:NAME TRANsient
After a trigger is received and the action completes, the trigger system will return to the Idle state. Thus it will be necessary to initiate the system each time a triggered action is desired.
To keep a trigger system initiated for multiple actions without having to send an initiate command for each trigger, use:
INITiate:CONTinuous:SEQuence1 ON or INITiate:CONTinuous:NAME TRANsient, ON
Generating Triggers
You can only program output triggers over the GPIB bus. Since BUS is the only trigger source for output triggers, the following command is provided for completeness only:
TRIGger:SOURce BUS
After you have specified the appropriate trigger source, you can generate triggers as follows: Single Triggers Send one of the following commands over the GPIB:
TRIGger:IMMediate *TRG
a group execute trigger
Continuous Triggers Send the following command over the GPIB:
INITiate:CONTinuous:SEQuence1 ON
When the trigger system enters the Output Change state upon receipt of a trigger (see figure 3-1), the triggered functions are set to their programmed trigger levels. When the triggered actions are completed, the trigger system returns to the Idle state.
22
Programming the DC Source - 3

Making Measurements

The dc source has the ability to make several types of voltage or current measurements. The measurement capabilities of the Agilent 66312A and Agilent 66332A models are particulary useful for loads that draw current in pulses.
NOTE: You cannot measure output voltage and current simultaneously. All measurements are performed by digitizing the instantaneous output voltage or current for a defined
number of samples and sample interval, storing the results in a buffer, and then calculating the measured result. Many parameters of the measurement are programmable. These include the number of samples, the time interval between samples, the bandwidth, and the method of triggering. Note that there is a tradeoff between these parameters and the speed, accuracy, and stability of the measurement in the presence of noise.
There are two ways to make measurements:
Use the MEASure commands to immediately start acquiring new voltage or current data, and return measurement calculations from this data as soon as the buffer is full. This is the easiest way to make measurements, since it requires no explicit trigger programming.
Use an acquisition trigger to acquire the data. Then use the FETCh commands to return calculations from the data that was retrieved by the acquisition trigger. This method gives you the flexibility to synchronize the data acquisition with a transition in the output voltage or current. FETCh commands do not trigger the acquisition of new measurement data, but they can be used to return many different calculations from the data that was retrieved by the acquisition trigger. Note that if you take a voltage measurement, you can fetch only voltage data.
Making triggered measurements with the acquisition trigger system is discussed under "Triggering Measurements".
NOTE: For each MEASure form of the query, there is a corresponding query that begins with the
header FETCh. FETCh queries perform the same calculation as their MEASure counterparts, but do not cause new data to be acquired. Data acquired by an explicit trigger or a previously programmed MEASure command are used.
Voltage and Current Measurements The SCPI language provides a number of MEASure and FETCh queries which return various
measurement parameters of voltage and current waveforms.
DC Measurements
To measure the dc output voltage or current, use:
MEASure:VOLTage? or MEASure:CURRent?
Dc voltage and current is measured by acquiring a number of readings at the selected time interval, applying a Hanning window function to the readings, and averaging the readings. Windowing is a signal conditioning process that reduces the error in dc measurements made in the presence of periodic signals such as line ripple. At power-on and after a *RST command, the following parameters are set:
SENSe:SWEep:TINTerval 15.6E-6 SENSe:SWEep:POINts 2048
23
3 - Programming the DC Source This results in a data acquisition time of 32 milliseconds. Adding a command processing overhead of
about 20 milliseconds results in a total measurement time of about 50 milliseconds per measurement sample.
Ripple rejection is a function of the number of cycles of the ripple frequency contained in the acquisition window. More cycles in the aquisition window results in better ripple rejection. If you increase the time interval for each measurement to 45 microseconds for example, this results in 5.53 cycles in the acquisition window at 60 Hz, for a ripple rejection of about 70 dB.
Note that the speed of the measurement can be increased by reducing the number of sample points. For example, the commands
SENSe:SWEep:TINTerval 15E-6 SENSe:SWEep:POINts 1024
speeds up the acquisition period to 16 milliseconds; however, the tradeoff is reduced measurement accuracy.
RMS Measurements (Agilent 66312A, 66332A Only)
To read the rms content of a voltage or current waveform, use:
MEASure:VOLTage:ACDC? or MEASure:CURRent:ACDC?
This returns the total rms measurement, including the dc portion. Making rms measurements on ac waveforms for which a non-integral number of cycles of data has been
acquired may result in measurement errors due to the last partial cycle of acquired data. The instrument reduces this error by using a Hanning window function when making the measurement.
Minimum and Maximum Measurements (Agilent 66312A, 66332A Only)
To measure the maximum or minimum voltage or current of a pulse or ac waveform, use:
MEASure:VOLTage:MAXimum? MEASure:VOLTage:MINimum? MEASure:CURRent:MAXimum? MEASure:CURRent:MINimum?
Current Ranges The dc source has two current measurement ranges. The command that controls the ranges is:
SENSe:CURRent:RANGe MIN | MAX
When the range is set to MIN, the maximum current that can be measured is 20 milliamperes.
Returning Measurement Data From the Data Buffer (Agilent 66312A, 66332A Only)
The MEASure and FETCh queries can also return all data values of the instantaneous voltage or current buffer. The commands are:
MEASure:ARRay:CURRent? MEASure:ARRay:VOLTage?
24
Programming the DC Source - 3
[
]

Internally Triggered Measurements

You can use the data acquisition trigger system to synchronize the timing of the voltage and current data acquisition with a BUS or internal trigger source. Then use the FETCh commands to return different calculations from the data acquired by the measurement trigger.
SCPI Triggering Nomenclature
As previously explained under "Triggering Output Changes", the dc source uses the following sequence name and alias for the measurement trigger system. This alias can be used instead of the sequence form.
Sequence Form Alias
SEQuence2 ACQuire
Measurement Trigger System Model
Figure 3-2 is a model of the measurement trigger system. The rectangular boxes represent states. The arrows show the transitions between states. These are labeled with the input or event that causes the transition to occur.
IDLE STATE
INITIATED STATE
SENSe:SWEep:POINts
ACQUIRED
NO
TRIGger:COUNt
COMPLETE?
YES
INITiate
:IMMediate
TRIGGER RECEIVED
ABORt
*RST *RCL
Figure 3-2. Model of Measurement Triggers
Initiating the Measurement Trigger System (Agilent 66312A, 66332A Only)
When the dc source is turned on, the trigger system is in the idle state. In this state, the trigger system ignores all triggers. Sending the following commands at any time returns the trigger system to the Idle state:
ABORt *RST *RCL
The INITiate commands move the trigger system from the Idle state to the Initiated state. This enables the dc source to receive triggers. To initiate for a measurement trigger, use:
25
3 - Programming the DC Source
INITiate:SEQuence2 or INITiate:NAME ACQuire
After a trigger is received and the data acquisition completes, the trigger system will return to the Idle state (unless multiple measurements are desired). Thus it will be necessary to initiate the system each time a triggered acquisition is desired.
NOTE: You cannot initiate measurement triggers continuously. Otherwise, the measurement data
in the data buffer would continuously be overwritten by each triggered measurement.
Selecting the Measurement Trigger Source (Agilent 66312A, 66332A Only)
The trigger system is waiting for a trigger signal in the Initiated state. Before you generate a trigger, you must select a trigger source. The following measurement trigger sources can be selected:
BUS - selects GPIB bus triggers. INTernal - selects the dc source’s output as the measurement trigger.
To select GPIB bus triggers (group execute trigger, device trigger, or *TRG command), use:
TRIGger:SEQuence2:SOURce BUS or TRIGger:ACQuire:SOURce BUS
To select internal triggers (measurements triggered off the output signal) use:
TRIGger:SEQuence2:SOURce INTernal or TRIGger:ACQuire:SOURce INTernal
Generating Measurement Triggers (Agilent 66312A, 66332A Only)
There is only one measurement converter in the dc source. Before you generate a measurement trigger, you must specify a measurement acquistion of either voltage or current. To specify a measurement acquisition use:
SENSe:FUNCtion "CURRent" or SENSe:FUNCtion "VOLTage"
Providing that you have specified the appropriate trigger source and a measurement acquisition, you can generate triggers as follows:
GPIB Triggers Send one of the following commands over the GPIB:
TRIGger:IMMediate (not affected by the trigger source setting) *TRG a group execute trigger
Internal Triggers To trigger off of the output signal, you must specify the output level that generates
the trigger, the rising or falling edge of the slope, and a hysteresis to qualify trigger conditions. This is illustrated in figure 3-3.
26
Q
>
TRIG:ACQ:HYST:CURR <value>
Trigger occurs on rising edge
g
TRIG :AC Q :HYST:V O LT
Trigger occu rs on falling edg e
when signal crosses negative
nal crosses positive
when si hysteresis band limit
Programming the DC Source - 3
hysteresis band limit
TRIG:A C TRIG:ACQ:LEV:VOLT
TRIG:ACQ:SLOP:CURR
TRIG:ACQ:SLOP:VOLT
:LEV:CURR <level
TRIG:ACQ:SLOP:CURR NEG
TRIG:ACQ:SLOP:VOLT
Figure 3-3. Trigger Commands Used to Measure Output Pulses
To specify the output level that will generate triggers for both positive- and negative-going signals use:
TRIGger:SEQuence2:LEVel:CURRent <value> or TRIGger:ACQuire:LEVel:CURRent <value>
To specify the slope on which triggering occurs use the following commands. You can specify a POSitive, a NEGative, or EITHer type of slope.
TRIGger:SEQuence2:SLOPe:CURRent <slope> or TRIGger:ACQuire:SLOPe:CURRent <slope>
To specify a hysteresis band to qualify the positive- or negative-going signal use:
TRIGger:SEQuence2:HYSTeresis:CURRent <value> or TRIGger:ACQuire:HYSTeresis:CURRent <value>
NOTE: When using internal triggers, do not INITiate the measurement until after you have
specified the slope, level, and hysteresis.
When the acquisition finishes, any of the FETCh queries can be used to return the results. Once the measurement trigger is initiated, if a FETCh query is sent before the data acquisition is triggered or before it is finished, the response data will be delayed until the trigger occurs and the acquisition completes. This may tie up the controller if the trigger condition does not occur immediately.
One way to wait for results without tying up the controller is to use the SCPI command completion commands. For example, you can send the *OPC command after INITialize, then occasionally poll the OPC status bit in the standard event status register for status completion while doing other tasks. You can also set up an SRQ condition on the OPC status bit going true, and do other tasks until an SRQ interrupt occurs.
27
3 - Programming the DC Source
Measuring Output Pulses (Agilent 66312A, 66332A Only)
Current Detector
Check that the current detector is set to ACDC when measuring current pulses or other waveforms with a frequency content greater than a few kilohertz.
SENSe:CURRent:DETect ACDC
Only select DC as the measurement detector if you are making only DC current measurements and you require a measurement offset better than 2mA on the High current measurement range. Note that this selection gives inaccurate results on current waveforms that have ac content.
SENSe:CURRent:DETect DC
Pulse Measurement Queries
The dc source has several measurement queries that return key parameters of pulsewaveforms as shown in Figure 3-4.
FETC:CURR:MAX? FETC:VOLT:MAX?
FETC:CURR:HIGH? FETC:VOLT:HIGH?
FETC:CURR:LOW?
DATA POINTS
FETC:VOLT:LOW?
FETC:CURR:MIN? FETC:VOLT:MIN?
Figure 3-4. Measurement Commands Used to Return Pulse Data
To return the maximum or minimum value of a pulse waveform use the following commands. Note that the data points of the measurement sample may not coincide with the actual maximum or minimum point on the waveform.
FETCh:VOLTage:MAXimum? or FETCh:VOLTage:MINimum? FETCh:CURRent:MAXimum? or FETCh:CURRent:MINimum?
The average value of the high level or low level of a pulse can also be measured. To return the average value of the high level, use:
FETCh:CURRent:HIGH? or FETCh:VOLTage:HIGH?
To return the average value of the low level, use:
FETCh:CURRent:LOW? or FETCh:VOLTage:LOW?
28
Programming the DC Source - 3

Controlling Measurement Samples

Varying the Voltage or Current Sampling Rate
You can vary both the number of data points in a measurement sample, as well as the time between samples. This is illustrated in Figure 3-5.
<
p
>
<
p
>
Figure 3-5. Sense Commands Used to Vary the Sampling Rate
At *RST, the output voltage or current sampling rate is 15.6 microseconds. This means that it takes about 32 milliseconds to fill up 2048 data points in the data buffer. You can vary this data sampling rate with:
SENSe:SWEep:TINTerval <sample_period> SENSe:SWEep:POINts <points>
For example, to set the time interval to 46.8 microseconds per sample with 1500 samples, use SENSe:SWEep:TINTerval 46.8E-6;POINts 1500.
Multiple Measurements (Agilent 66312A, 66332A Only)
The instrument also has the ability to set up several acquisition triggers in succession and average the results from each acquisition in the returned measurement. To set up the trigger system for a number of sequential aquisitions use:
TRIGger:ACQuire:COUNt:CURRent <number> or TRIGger:ACQuire:COUNt:VOLTage <number>
With this setup, the instrument performs each acquisition sequentially, storing the digitized readings in the internal measurement buffer. It is only necessary to initialize the measurement once at the start; after each completed aquisition the instrument will wait for the next valid trigger condition to start another. The results returned by MEASure or FETCh will be the average of the total data acquired.
NOTE: The total number of data points cannot exceed 4096. This means that the product of the
trigger count multiplied by the sweep points cannot exceed 4096; otherwise an error will occur.
29
3 - Programming the DC Source
Pre-event and Post-event Triggering (Agilent 66312A, 66332A Only)
When a measurement is initiated, the dc source continuously samples either the instantaneous output voltage or current. As shown in figure 3-6, you can move the block of data being read into the acquisition buffer with reference to the acquisition trigger. This permits pre-event or post-event data sampling.
=-
=-
=
=
Figure 3-6. Pre-event and Post-event Triggering
To offset the beginning of the acquisition buffer relative to the acquisition trigger, use:
SENSe:SWEep:OFFSet:POINts <offset>
The range for the offset is -4096 to 2,000,000,000 points. As shown in the figure, when the offset is negative, the values at the beginning of the data record represent samples taken prior to the trigger. When the value is 0, all of the values are taken after the trigger. Values greater than zero can be used to program a delay time from the receipt of the trigger until the data points that are entered into the buffer are valid. (Delay time = Offset X Sample period)
Pulse Measurement Example (Agilent 66312A, 66332A only)
The following program illustrates how to make a pulse measurement over the GPIB. The measurement function is set to ACDC, which gives the best results for current waveforms that have ac content. The measurement incorporates 100 readings taken at time intervals of 20 microseconds, for a total measurement time of 2 milliseconds. The trigger point for the pulse measurement occurs at 0.1 amperes on the positive slope of the current pulse. The measurement offset is programmed so that 20 measurement points prior to the trigger are also returned as part of the measurement sample.
Because measurement triggers are initiated by the current pulse, a FETCh command is used to return the measurement data. FETCh commands are also used to return the MAXimum, MINimum, HIGH, and LOW values of the measurement.
NOTE: MEASure commands cannot be used to return data in this example because they always
acquire NEW measurement data each time they are used.
The program can be run on any controller operating under Agilent BASIC. To generate output pulses, an electronic load is programmed to generate 3-ampere pulses with a duty cycle of 100 microseconds at 1000 Hz. The power supply address is 705, and the load address is 706. If required, change these parameters in the appropriate statements.
30
Loading...
+ 73 hidden pages