Agilent Technologies 668xA, 669xA, 667xA, 665xA, 664xA User Manual

PROGRAMMING GUIDE
GPIB DC POWER SUPPLIES
Agilent Technologies Models
664xA, 665xA, 667xA, 668xA, and 669xA
Agilent Part No. 5964-8269 Printed in Malaysia Microfiche Part No. 5964-8270 July, 2001
The beginning of the power supply Operating Manual has a Safety Summary page. Be sure you are familiar with the information on that page before programming the power supply for operation from a controller.
ENERGY HAZARD. Power supplies with high output currents (such as the Series 668xA/669xA) can provide more than 240 VA at more than 2 V. If the output connections touch, severe arcing may occur resulting in burns, ignition or welding of parts. Take proper precautions before remotely programming the output circuits.

Printing History

The edition and current revision of this guide 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. Changes to the guide occurring between revisions are covered by change sheets shipped with the guide.
Edition 1......... July, 2001
© Copyright 2001 Agilent Technologies Inc. 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.
2

Contents

Safety Guidelines 2 Printing History 2 Contents 3
GENERAL INFORMATION 7
About this Guide 7 Documentation Summary 7
User’s Guide 7 External Documents 7
Prerequisites for Using this Guide 8 VXIplug&play Power Product Instrument Drivers 8
Downloading and Installing the Driver 8 Accessing Online Help 8
REMOTE PROGRAMMING 9
GPIB Capabilities Of The Power Supply 9 Introduction To SCPI 9
Conventions 9 SCPI Messages 10 Types of SCPI Commands 10 Structure of a SCPI Message 10 Parts of a SCPI Message 11 Traversing the Command Tree 12 Including Common Commands 14 SCPI Queries 14 Value Coupling 14 SCPI Data Formats 14
Examples 15
Controlling Output 16 Saving and Recalling States 17 Writing to the Display 17 Programming Status 17 Programming the Digital I/O Port 18
System Considerations 18
The GPIB Address 18 DOS Drivers 20 Agilent BASIC Controllers 20 Sample Program Code 20
LANGUAGE DICTIONARY 25
Introduction 25
Parameters 25 Related Commands 25 Order of Presentation 25 Common Commands 25 Subsystem Commands 25
Description Of Common Commands 26
*CLS 27 *ESE 27 *ESR? 28 *IDN? 28
3
*OPC 28 *OPC? 29 *OPT? 29 *PSC 29 *RCL 30 *RST 31 *SAV 31 *SRE 32 *STB? 32 *TRG 33 *TST? 33 *WAI 33
Description of Subsystem Commands 34
ABOR 34 Calibration Commands 34
Current Subsystem 35
CURR 35 CURR:TRIG 35 CURR:PROT:STAT 35 DIG:DATA 36
Display Subsystem 36
DISP 36 DISP:MODE 37 DISP:TEXT 37
Initiate Subsystem 38
INIT 38 INIT:CONT 38
Measure Subsystem 38
MEAS:CURR? 38 MEAS:VOLT? 38
Output Subsystem 39
OUTP 39 OUTP:PROT:CLE 39 OUTP:PROT:DEL 39 OUTP:REL 40 OUTP:REL:POL 40
Status Subsystem 41
STAT:PRES 41 Status Operation Registers 41 STAT:OPER? 41 STAT:OPER:COND? 41 STAT:OPER:ENAB 42 STAT:OPER NTR 42 STAT:OPER PTR 42 Status Questionable Registers 43 STAT:OUES? 43 STAT:QUES:COND? 43 STAT:QUES:ENAB 43 STAT:QUES NTR 44 STAT:QUES PTR 44
System Commands 44
SYST:ERR? 44 SYST:LANG 45 SYST:VERS? 45
Trigger Subsystem 45
4
TRIG 45 TRIG:SOUR 46
Voltage Subsystem 46
VOLT 46 VOLT:TRIG 46 VOLT:PROT 47
Command Summary 47 Programming Parameters 49
STATUS REPORTING 51
Power Supply Status Structure 51 Operation Status Group 51
Register Functions 51 Register Commands 51
Questionable Status Group 53
Register Functions 53 Register Commands 53
Standard Event Status Group 53
Register Functions 53 Register Commands 53
Status Byte Register 54
The RQS Bit 54 The MSS Bit 54 Determining the Cause of a Service Interrupt 54
Service Request Enable Register 54 Output Queue 54 Initial Conditions At Power On 54
Status Registers 54 The PON (Power-On) Bit 55
Examples 55
Servicing an Operation Status Mode Event 55 Adding More Operation Events 56 Servicing Questionable Status Events 56 Monitoring Both Phases of a Status Transition 56
SCPI Command Completion 57 DFI (Discrete Fault Indicator) 57 RI (Remote Inhibit) 57
ERROR MESSAGES 59
Power Supply Hardware Error Messages 59 Calibration Error Messages 59 System Error Messages 59
SCPI CONFORMANCE INFORMATION 61
SCPI Version 61 SCPI Confirmed Commands 61 SCPI Approved Commands 61 NON-SCPI Commands 62
COMPATIBILITY LANGUAGE 63
INDEX 67
5

General Information

About this Guide

This guide provides remote programming information for the following series of GPIB programmable power supplies:
AGILENT Series 664xA, 665xA, 667xA, 668xA, and 669xA
You will find the following information in the rest of this guide: Chapter 2 Introduction to SCPI messages structure, syntax, and data formats. Examples of SCPI programs. Chapter 3 Dictionary of SCPI commands. Table of programming parameters. Chapter 4 Description of the status registers. Chapter 5 Error messages. Appendix A SCPI conformance information. Appendix B Use of the alternate Compatibility programming language.

Documentation Summary

User’s Guide

The Operating Guide, shipped with the power supply, has information helpful to programming the power supply and explains the SCPI commands used for remote calibration. Sample calibration and verification programs are included.
1

External Documents

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
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:
a 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.
a ANSI/IEEE Std. 488.2-1987 IEEE Standard Codes, Formats, Protocols, and Common Commands. Recommended as a reference only if you intend to do fairly sophisticated programming. Helpful for finding precise definitions of certain types of SCPI message formats, data types, or common commands.
The previous 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.
Introduction 7

Prerequisites for Using this Guide

This organization of this guide assumes that you know or can learn the following information:
1. How to program in your controller language (Agilent BASIC, QUICKBASIC, C, etc.).
2. The basics of the GPIB (IEEE 488).
3. How to program I/O statements for an IEEE 488 bus instrument. From a programming aspect, the power supply is simply a bus instrument.
4. How to format ASCII statements within you I/O programming statements. SCPI commands are nothing more than ASCII data strings incorporated within those I/O statements.
5. The basic operating principles of the power supply as explained in “Chapter 5 – Front Panel Operation” of the Operating Guide.
6. How to set the GPIB address of the power supply. This cannot be done remotely, but only from the supply’s front panel (see System Considerations in “Chapter 2 – Remote Programming”).

VXIplug&play Power Product Instrument Drivers

VXIplug&play instrument drivers for Microsoft Windows 95 and Windows NT are now available on the Web at http://www.agilent.com/find/drivers. These instrument drivers provide a high-level programming interface to your Agilent Technologies instrument. VXIplug&play instrument 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.
Supported Applications System Requirements
a Agilent VEE a Microsoft Visual BASIC a Microsoft Visual C/C++ a Borland C/C++ a National Instruments LabVIEW a National Instruments LabWindows/CVI
The VXIplug&play Power Products instrument driver complies with the following:
a Microsoft Windows 95 a Microsoft Windows NT a HP VISA revision F.01.02 a National Instruments VISA 1.1

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.
6. To use the VXIplug&play instrument driver, follow the directions in the VXIplug&play online help under
“Introduction to Programming”.

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. a 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.
8 Introduction
2

Remote Programming

GPIB Capabilities Of The Power Supply

All power supply functions except for setting the GPIB address are programmable over the IEEE 488 bus (also known as the General Purpose Interface Bus or "GPIB"). The IEEE 488.1 capabilities of the power supply are listed in the Supplemental Characteristics of the Operating Guide. The power supply operates from a GPIB address that is set from the front panel (see System Considerations at the end of this chapter).

Introduction To SCPI

lmportant Learn the basics of power supply operation (see "Chapter 5 - Front Panel Operation" in the power supply
Operating Guide) before using SCPI.
SCPI (Standard Commands for Programmable Instruments) is a programming language for controlling instrument functions over the GPIB (IEEE 488) instrument bus. SCPI is intended to function with standard GPIB hardware and conforms to the IEEE Standard Digital Interface for Programmable Instrumentation. 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 power supply display state and the display state of a SCPI-compatible multimeter.
Note HPSL and TMSL (Test and Measurement System Language) were earlier versions of SCPI. If you have
programmed in either, then you probably can go directly to "Chapter 3 - Language Dictionary".

Conventions

The following conventions are used throughout this chapter:
Angle brackets < > Items within angle brackets are parameter abbreviations. For example,
<NR1> indicates a specific form of numerical data.
Vertical bar | Vertical bars separate one of two or more alternative parameters. For
example, 0|OFF indicates that you may enter either "0" or "OFF" for the required parameter.
Square Brackets
Braces { } Braces indicate parameters that may be repeated zero or more times. It is
Boldface font
[ ] Items within square brackets are optional. The representation
[SOURce]:CURRent means that SOURce may be omitted.
used especially for showing arrays. The notation<A>{<,B>} shows that "A" is a required parameter, while "B" may be omitted or may be entered one or more times.
Boldface font is used to emphasize syntax in command definitions. TRIGger:DELay <NRf> shows a command syntax.
Computer font Computer font is used to show program text within normal text.
TRIGger:DELay .5 represents program text.
Remote Programming 9

SCPI Messages

There are two types of SCPI messages, program and response.
A program message consists of one or more properly formatted SCPI commands sent from the controller to
the power supply. The message, which may be sent at any time, requests the power supply to perform some action.
A response message consists of data in a specific SCPI format sent from the power supply to the controller.
The power supply sends the message only when commanded by a special program message called a "query."

Types of SCPI Commands

SCPI has two types of commands, common and subsystem.
Common Commands Common commands (see Figure 3-1) generally are not related to specific operation but to controlling overall power supply
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 Subsystem commands (see Figure 3-2) perform specific power supply functions. They are organized into an inverted tree
structure with the "root" at the top. Some are single commands while others are grouped under other subsystems.

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.
ABOR VOLT?
The message unit may include a parameter after the header. The parameter usually is numeric, but it can be a string:
VOLT 20 VOLT MAX
Combining Message Units
The following command message (see Figure 2-1) is briefly described here, with more details in subsequent paragraphs.
VOLT:LEV 4.5;PROT 4.8;:CURR?<NL>
10 Remote Programming
The basic parts of the message in Figure 2-1 are:
Message Component Example Headers VOLT LEV PROT CURR Header Separator The colon in VOLT:LEV Data 4.5 4.8 Data Separator The space in VOLT 4. 5 and PROT 4. 8 Message Units VOLT:LEV 4.5 PROT 4.8 CURR? Message Unit Separator Root Specifier The colon in PROT 4. 8; : CURR? Query Indicator The question mark in CURR? Message Terminator The <NL> (newline) indicator. Terminators are not part of the SCPI syntax.
Figure 2-1. Command Message Structure
The semicolons in VOLT: LEV 4. 5; and PROT 4. 8;

Parts of a SCPI Message

Headers Headers (which are sometimes known as "keywords") are instructions recognized by the power supply interface. Headers
may be either in the long form or the short form.
Long Form The header is completely spelled out, such as VOLTAGE STATUS DELAY. Short Form The header has only the first three or four letters, such as VOLT STAT DEL.
Short form headers are constructed according to the following rules:
If the header consists of four or fewer letters, use all the letters. (DFI DATA)
If the header consists of five or more letters and the fourth letter is not a vowel (a,e,i,o,u), use the first four
letters. (VOLTage STATus)
If the header consists of five or more letters and the fourth letter is a vowel (a,e,i,o,u), use the first three letters. (DELay CLEar)
You must follow the above rules when entering headers. Creating an arbitrary form, such as QUEST for QUESTIONABLE, will result in an error. The SCPI interface is not sensitive to case. It will recognize any case mixture, such as VOLTAGE,
Voltage, Volt, volt.
Note Shortform headers result in faster program execution.
Remote Programming 11
Header Convention. In this manual, headers are emphasized with boldface type. The proper short form is shown in upper-case letters, such as DELay.
Header Separator. If a command has more than one header, you must separate them with a colon. (VOLT:PROT OUTPut:PROTection:CLEar)
Optional Headers. The use of some headers is optional. Optional headers are shown in brackets, such as
OUTPut[:STATe] ON. However, if you combine two or more message units into a compound message, you may need to enter the optional header. This is explained under "Traversing the Command Tree."
Query Indicator Following a header with a question mark turns it into a query (VOLT? VOLT:PROT?). If a query contains a parameter,
place the query indicator at the end of the last header (VOLT:PROT? 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?).
Important You can combine message units only at the current path of the command tree (see "Traversing the
Command Tree").
Root Specifier When it precedes the first header of a message unit, the colon becomes a "root specifier". This indicates that the command
path is at the root or top node of the command tree. Note the difference between root specifiers and header separators in the following examples:
OUTP:PROT:DEL .1 All colons are header separators OUTP:PROT:DEL .1 The first colon is a root specifier OUTP:PROT:DEL .l;:VOLT 12.5 The third colon is a root specifier
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 manual, 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.

Traversing the Command Tree

Figure 2-2 shows a portion of the subsystem command tree (you can see the complete tree in Figure 3-2). Note the location of the ROOT node at the top of the tree. The SCPI interface is at this location when:
The power supply is powered on.
A device clear (DCL) is sent to the power supply.
The interface encounters a message terminator.
The interface encounters a root specifier.
12 Remote Programming
Active Header Path In order to properly traverse the command tree, you must understand the concept of the active header path. When the power
supply is turned on (or under any of the other conditions listed above), the active path is at the root. That means the interface is ready to accept any command at the root level, such as TRIGger or STATus in Figure 2-2. Note that you do not have to precede either command with a colon; there is an implied colon in front of every root-level command.
If you enter STATUS, the active header path moves one colon to the right. The interface is now ready to accept : OPERATION, :PRESET, or QUESTIONABLE as the next header. Note that you must include the colon, because it is required
between headers.
If you next enter :OPERATION, the active path again moves one colon to the right. The interface is now ready to accept :EVENT?, CONDITON?, ENABLE, NTRANSITION, or PTRANSITION as the next header.
If you now enter :ENABLE, you have reached the end of the command string. The active header path remains at :ENABLE. If you wished, you could have entered :ENABLE 18;PTRANSITION 18 and it would be accepted. The entire message would be STATUS:OPERATION:ENABLE 18;PTRANSITION 18. The message terminator after PTRANSITION 18 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 STATUS:
OPERATION?, the interface recognizes it as STATUS: OPERATION: EVENT? (see Figure 2-2). This returns the active path to the root (:STATUS). But if you enter STATUS: OPERATION: EVENT?, then the active path remains at :EVENT. This allows you to send STATUS: OPERATION: EVENT?; CONDITION? in one message. If you tried to send
STATUS:OPERATION?;CONDITION? the command path would send STATUS:OPERATION:EVENT? and then return to :STATUS instead of to :CONDITION.
The optional header SOURCE precedes the current, digital, and voltage subsystems (see Figure 3-2). This effectively makes :CURRENT, :DIGITAL, 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 (see Figure 3-2):
OUTPUT:PROTECTION:CLEAR STATUS:OPERATION:CONDITION?
By using the root specifier, you could do the same thing in one message:
OUTPUT:PROTECTION:CLEAR;:STATUS:OPERATION:CONDITION?
Figure 2-2. Partial Command Tree
Remote Programming 13
Note The SCPI parser traverses the command tree as described in Appendix A of the IEEE 488.2 standard. The
"Enhanced Tree Walking Implementation" given in that appendix is not implemented in the power supply.
The following message shows how to combine commands from different subsystems as well as within the same subsystem (see Figure 3-2):
VOLTAGE:LEVEL 7;PROTECTION 8;:CURRENT:LEVEL 50;PROTECTION 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 the message unit separator. Common commands do not affect the active header path; you may insert them anywhere in the message.
VOLT:TRIG 7.5;INIT;*TRG OUTP OFF;*RCL 2;OUTP ON

SCPI Queries

Observe the following precautions with queries:
Remember to set up the proper number of variables for the returned data.
Set the program to read back all the results of a query before sending another command to the power supply.
Otherwise, a Query Interrupted error will occur and the unreturned data will be lost.

Value Coupling

Value coupling results when a command directed to send one parameter also changes the value of a second parameter. There is no direct coupling among any power supply SCPI commands. However, be aware that until they are programmed, uninitialized trigger levels will assume their corresponding immediate levels. For example, if a power supply is powered up and VOLT:LEV is programmed to 6, then VOLT:LEV:TRIG will also be 6 until you program it to another value. Once you program VOLT:LEV:TRIG to another value, it will remain at that value regardless of how you subsequently reprogram VOLT:LEVEL.

SCPI Data Formats

All data programmed to or returned from the power supply is ASCII. The data may be numerical or character string.
Numerical Data Table 2-1 and Table 2-2 summarize the numerical formats.
Table 2-1. 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 0273
<NR2> <NR3>
Digits with an explicit decimal point. Example: 273. .0273 Digits with an explicit decimal point and an exponent. Example: 2.73E+2 273.0E-2
14 Remote Programming
<NRf>
<NRf+>
Class Suffix Unit Unit with Multiplier
Current A Ampere MA (milliampere) Amplitude V Volt MV (millivolt) Time S second MS (millisecond)
lE3 K kilo 1E-3 M milli 1E-6 U micro
Boolean Data Either form {1|0} or {ON|OFF} may be sent with commands. Queries always return 1 or 0.
OUTPut OFF CURRent:PROTection 1
Character Data For query statements, character strings may be returned in either of the forms shown in Table 2-3, depending on the length
of the returned string.
<CRD> <AARD>
Note:
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.
The IEEE 488.2 format for a string parameter requires that the string be enclosed within either single (' ') or double (" ") quotes. Be certain that your program statements comply with this requirement.
Extended format that includes <NR1>, <NR2> and <NR3>. Examples: 273 273.
2.73E2 Expanded decimal format that includes <NRf>, MIN and 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.
Table 2-2. Suffixes and Multipliers
Common Multipliers
Table 2-3. Character Data Formats
Listening Formats

Examples

The examples given here are generic, without regard to the programming language or type of GPIB interface. Because SCPI commands are sent as ASCII output strings within the programming language statements, the SCPI syntax is independent of both programming language and interface.
Note The examples are followed by sample program code written for three popular types of BASIC-
controlled GPIB interfaces.
Remote Programming 15

Controlling the Output

Important The power supply responds simultaneously to both digital and analog programming inputs. If it
is receiving an input over the GPIB and a corresponding input from the front panel (and/or from the analog programming port), the power supply output will be the algebraic sum of the inputs.
Programming Voltage and Current The following statements program both voltage and current and return the actual output from the sense terminals:
OUTP OFF Disable the output. VOLT 4.5;CURR 255 Program the voltage and current. VOLT?;CURR? Read back the programmed levels. OUTP ON Enable the output. MEAS:VOLT?;MEAS:CURR? Read back the outputs from the sense terminals.
Programming Protection Circuits This example programs the voltage and current, programs an overvoltage protection value, and turns on the overcurrent
protection. It then reads back all the programmed values.
VOLT:LEV 4.5;PROT 4.75 Program the voltage and overvoltage protection. CURR:LEV 255;PROT:STAT ON Program the current and overcurrent protection. VOLT:LEV?;PROT?;:CURR:LEV?;PROT:STAT? Read back the programmed values.
Note the required use of the optional LEVel header in the above example (see "The Effect of Optional Headers", given
previously).
Changing Outputs by Trigger If you do not program pending triggered levels, they default to the programmed (immediate) output levels. The following
statements shows some basic trigger commands.
OUTP OFF Disable the output. VOLT:LEV:IMM 2.2;TRIG 2.5 Program the (immediate) voltage level to 2.2V and the pending
triggered level to 2.5 V.
CURR:LEV:IMM I5O;TRIG 250 Program the (immediate) current level to 150 A and the pending
triggered level to 250 A.
VOLT:LEV:IMM?;TRIG?;:CURR:LEV:IMM?;TRIG? Check all the programmed values. OUTP ON Enable the output. MEAS:VOLT?;CURR? Read back the immediate levels from the sense terminals. INTIT;TRIG Arm the trigger circuit and send a single trigger. INIT;*TRG Same as above, except using a common command. MEAS:VOLT?;CURR? Read back the triggered levels from the sense terminals.
If you need to send two or more triggers, program the trigger circuit for continuous arming.
OUTP OFF Disable the output. VOLT:LEV:IMM 5.O;TRIG 2.5 Program the (immediate) voltage level to 5 V and the pending
triggered level to 2.5 V.
INTIT:CONT ON Program the trigger circuit for continuous arming. OUTP ON Enable the output to 5 V. TRIG Trigger the output voltage to 2.5 V. VOLT:TRIG 5;:TRIG Set the pending trigger level to 5 V and trigger the output voltage
back to 5 V.
INTIT:CONT OFF Remove the continuous trigger arming.
16 Remote Programming

Saving and Recalling States

You can remotely save and recall operating states. See *SAV and *RCL in "Chapter 3 - Language Dictionary" for the parameters that are saved and recalled.
Note When you turn the power supply on, it automatically retrieves the state stored in location 0.
When a power supply is delivered, this location contains the factory defaults (see *RST in "Chapter 3 - Language Dictionary").
OUTP OFF;VOLT:LEV 6.5;PROT 6.8 Program a desired operating state. CURR:LEV 335;PROT:STAT ON *SAV 2 Save this state to location 2. *RCL 2 (Later) recall this same state.

Writing to the Display

You can include messages to the front panel LCD in your programs. The description of DISP:TEXT in "Chapter 3 - Language Dictionary" shows the number and types of permitted display characters. In order to write to the display, you must first change it to text mode as shown in the following example:
DIS:MODE TEXT Switch display to text mode. RECALLED 2 Write “Recalled 2” to the display. DIS:MODE NORM Return display to its normal mode.

Programming Status

You can use status programming to make your program react to events within the power supply. "Chapter 4 - Status Reporting" explains the functions and bit configurations of all status registers. Refer to Figure 4-1 in that chapter while examining the examples given here.
Detecting Events via SRO Usually you will want the power supply to generate interrupts (assert SRQ) upon particular events. For this you must
selectively enable the appropriate status register bits. The following examples allow the power supply to assert SRQ under selected conditions.
1. STAT:OPER:ENAB 1280;PTR 1280;*SRE 128 Assert SRQ when the supply switches between CV and CC
modes.
2. STAT:OPER:ENAB 1;PTR 1;NTR 1;*SRE 128 Assert SRQ when the supply enters or leaves calibration mode.
3. STAT:QUES 3;PTR 3;*SRE 128 Assert SRQ when the supply goes into overvoltage or
overcurrent condition.
4. STAT:OPER:ENAB 1280;PTR 1280; STAT:QUES 3;PTR 3;*SRE 136
Reading Specific Registers You can exercise program control without interrupts by reading specific registers.
STAT:OPER:1280;EVEN? STAT:OPER:ENAB 1313;PTR 1313;EVEN?
STAT:OPER:ENAB?;EVENT?;:STAT:QUES:ENAB?;EVEN?;:*ESE?;*ESR? Read which events are active and which events are enabled in
Assert SRQ under any event occurring in 1. or 3., above.
Enable only the CV and CC events and read their status. Enable all conditions of the Operation Status register and read
any events.
the Operation, Questionable, and Standard Event status
registers.
Remote Programming 17
Note The last query string can be handled without difficulty. However, should you request too many
queries, the system may return a "Query DEADLOCKED” error (-430). In that case, break the long string into smaller parts.

Programming the Digital I/O Port

Digital control ports 1 and 2 are TTL outputs that can be programmed either high or low. Control port 3 can be programmed to be either a TTL input or a TTL output. Send a decimal parameter that translates into the desired straight binary code for these ports. (See DIG:DATA[:VAL] in "Chapter 3 - Language Dictionary" for the port bit configurations.)
DIG:DATA 3 Set ports 1 and 2 high and make 3 another output port. DIG:DATA 7 Set ports 1 and 2 high and make 3 an input port. DIG:DATA? Read back the present port configuration.

System Considerations

The remainder of this chapter addresses some system issues concerning programming. These are power supply addressing and the use of the following types of GPIB system interfaces:
1. HP Vectra PC controller with Agilent 82335A GPIB Interface Command Library.
2. IBM PC controller with National Instruments GPIB-PCII Interface/Handler.
3. Agilent controller with Agilent BASIC Language System.

The GPIB Address

The power supply address cannot be set remotely; it must be set from the front panel. Once the address is set, you can assign it inside programs.
Setting the GPIB Address Figure 4-6 in the power supply Operating Guide shows the ways the power supply can be connected to the GPIB bus. You
can set up the GPIB address in one of three ways:
1. As a stand-alone supply (the only supply at the address). It has a primary address in the range of 0 to 30. For example:
5 or 7
2. As the direct supply in a serial link. It is the only supply connected directly to the GPIB bus. The primary address is
unique and can be from 0 to 30. It is entered as an integer followed by a decimal separator. The secondary address always is 0, which may be added after the primary address. If the secondary address is omitted, it is assumed to be 0. For example:
5.0 or 7.
3. As a linked supply in serial link. It gets its primary address from the direct supply. It has a unique secondary address
that can be from 1 to 15. It is entered as an integer preceded by a decimal separator. For example:
.1 or .12
When you enter a secondary address, leading zeros between the decimal separator and the first digit are ignored. For
example, .1, .01, and .001 are accepted as secondary address 1 and displayed as 0.01. Zeros following a digit are not ignored. Thus, .10 and .010 are both accepted as secondary address 10 and displayed as 0. 10.
Changing the Power Supply GPIB Address Use the
address as the default. The general procedure for setting an address is:
key and numerical keypad for entering addresses. The power supply is shipped with a 5 stand-alone
18 Remote Programming
Action Display Shows Press Press new address keys New address replaces numbers on the display
Press
If you try to enter a forbidden number, ADDR ERROR is displayed. The following examples show how to set addresses:
To set stand-along primary address 6, press
To set direct supply primary address 6, press
To set linked secondary address 1, press
To set linked secondary address 12, press
Display returns to meter mode
Current address
Note The power supply display will reset (recall the state in location 0) whenever you change between
the following types of GPIB addresses:
A stand-alone primary address and a direct primary address.
A direct primary address and a secondary address.
Assigning the GPIB Address In Programs
The following examples assume that the GPIB select code is 7, the the power supply is 6, and that the power supply address will be assigned to the variable @PS.
1000 !Stand-alone address. The power supply will respond if it is set to 6 1010 PS=706 !Statement for Agilent 82335A Interface 1010 ASSIGN @PS TO 706 ! Statement for Agilent BASIC Interface 1020 !Direct address. The power supply will respond if it is set to 6. or 6.0 1030 PS-70600 ! Statement for Agilent 82335A Interface 1030 ASSIGN @PS TO 70600 ! Statement for Agilent BASIC Interface 1040 !Linked address 1. The power supply will respond if it is set to address .1 and is serially connected to a
supply at direct address 6.0 1050 PS=706.01 !Agilent 82335A Interface 1090 ASSIGN @PS TO 706.01 !Agilent BASIC Interface
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 GP-IB documentation).
Remote Programming 19

DOS Drivers

Types of Drivers
The Agilent 82335A and National Instruments GP-IB 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 GP-IB 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 power supply 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 power supply 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.
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.
Important Use 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 power supply 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 Table 5-1 of "Chapter 5 - Error Messages".

Sample Program Code

The following programs are intended only to show how some of the same power supply functions can be programmed to each of the three previously mentioned GPIB interfaces. The first two are for the DOS interfaces and the third for the Agilent BASIC interface.
20 Remote Programming
Programming Some Power Supply Functions
SAMPLE FOR POWER SUPPLY AT STAND-ALONE ADDRESS 6. SEQUENCE SETS UP CV MODE OPERATION, FORCES SUPPLY TO SWITCH TO CC MODE, AND DETECTS AND REPORTS MODE CHANGE. ************************************************************************** Controller Using Agilent 82335A Interface ************************************************************************** 5 ‘ < --------------- Merge SETUP.BAS here -------------------- >
1000 MAX.ELEMENTS=2 : ACTUAL.ELEMENTS=O :MAX.LENGTH=80 :ACT.LENGTH=O 1005 DIM OUTPUTS(2) :CDDES$=SPACE$(40) 1010 ISC=7 :PS=706 1015 ‘ 1020 'Set up the Power Supply Interface for DOS driver 1025 CALL IORESET (ISC) 'Reset the interface 1030 IF PCIB.ERR < > NOERR THEN ERROR PCIB.BASERR 1035 TIMEOUT=3 1040 CALL IOTIMEOUT (ISC, TIMEOUT) 'Set timeout to 3 seconds 1045 IF PCIB.ERR < > NOERR THEN ERROR PCIB.BASERR 1050 CALL IOCLEAR (ISC) 'Clear the interface 1055 IF PCIB.ERR <> NOERR THEN ERROR PCIB.BASERR 1060 CALL IOREMOTE (ISC) 'Set Power Supply to remote mode 1065 IF PCIB.ERR <> NOERR THEN ERROR PCIB.BASERR 1070 ‘ 1075 'Program power supply to CV mode with following voltage and current 1080 CODES$ = "VOLTAGE 7.8;CURRENT 480" :GOSUB 2000 1085 ‘ 1090 'Query power supply outputs & print to screen 1095 CODES$ = "MEASURE:VOLTAGE?;CURRENT?" :GOSUB 2000 :GOSUB 3000 1100 VOUT = OUTPUTS(I) 1105 IOUT = OUTPUTS(2) 1110 PRINT "The output levels are "VOUT" Volts and "IOUT" Amps" 1115 ‘ 1120 'Program triggered current level to value insufficient to maintain 1125 'supply within its CV operating characteristic 1130 CODES$ = "CURR:TRIG 50" :GOSUB 2000 1135 ‘ 1140 'Set operation status mask to detect mode change from CV to CC 1145 CODES$ = "STAT:OPER:ENAB 1024;PTR 1024" :GOSUB 2000 1150 ‘ 1155 'Enable Status Byte OPER summary bit 1160 CODES$ = "*SRE 128" :GOSUB 2000 1165 ‘ 1170 'Arm trigger circuit and send trigger to power supply 1175 CODES$ = "INITIATE;TRIGGER" :GOSUB 2000 1180 ‘ 1185 'Wait for supply to respond to trigger 1190 FOR I= 1 to 100 :NEXT I 1195 ‘ 1200 'Poll for interrupt caused by change to CC mode and print to screen 1205 CALL IOSPOLL (PS,RESPONSE) 1210 IF (RESPONSE AND 128)< >128 THEN GOTO 1240 'No OPER event to report 1215 CODES$ = "STATUS:OPER:EVEN?" :GOSUB 2000 'Query status oper register
Remote Programming 21
Programming Some Power Supply Functions (continued)
1220 CALL IOENTER (PS,OEVENT) 'Read back event bit 1225 IF PCIB.ERR < > NOERR THEN ERROR PCIB.BASERR 1230 IF (OEVENT AND 1024) = 1024 THEN PRINT "Supply switched to CC mode." 1240 'Clear the status circuit 1245 CODES$ = "*CLS" :GOSUB 2000 1260 FOR I = 1 TO 100 :NEXT I 'Wait for supply to clear 1265 ‘ 1260 'Disable output and save present state in location 2 1265 CODES$ = "OUTPUT OFF;*SAV 2" :GOSUB 2000 1270 END 1275 ‘ 2000 'Send command to power supply 2005 LENGTH = LEN(CODES$) 2010 CALL IOOUTPUTS (PS,CODES$,LENGTH) 'Send command to interface 2015 IF PCIB.ERR < > NOERR THEN ERROR PCIB.BASERR ISETUP.BAS error trap 2020 RETURN 2025 ‘ 3000 'Get data from power supply 3005 CALL IOENTERA (PS,OUTPUTS(1),MAX.ELEMENTS,ACTUAL.ELEMENTS) 3010 IF PCIB.ERR < > NOERR THEN ERROR PCIB.BASERR 3015 RETURN ****************************************************************************************************** IBM Controller Using National Interface ****************************************************************************************************** 990 ‘ --------------------- Merge DECL.BAS here -----------------------­1000 'Power Supply Variable = PS% ; Stand-Alone Address = 706 1005 CODES$=SPACE$(50):MODE$=SPACE$(5):OEVENT$=SPACE$(20) 1010 D$=SPACE$(60):OUTPUT$=SPACE$(40):BDNAME$=“PS%" 1015 DIM OUTPUT(2) 1020 ‘ 1025 'Set up power supply interface for DOS driver 1030 CALL IBFIND(BDNAME$,PS%) 1035 IF PS%<O THEN PRINT "IBFIND Failed." 1040 CALL IBCLR(PS%) 1045 ‘ 1050 'Program power supply to CV mode with following voltage and current 1055 CODES$ = "VOLTAGE 7.8;CURRENT 480” :GOSUB 2000 1060 ‘ 1065 'Query power supply outputs and print to screen 1070 CODES$ = "MEASURE:VOLTAGE?;CURRENT?" :GOSUB 2000 :GOSUB 3000 1075 VOUT = OUTPUT(1) 1080 IOUT = OUTPUT(2) 1085 PRINT "The programmed levels are "VOUT" Volts and "IOUT" Amps" 1090 ‘ 1095 'Program triggered current level to value insufficient to maintain 1100 'supply within its CV operating characteristic 1105 CODES$ = "CURR:TRIG 50" :GOSUB 200 1110 ‘ 1115 'Set operation status mask to detect mode change from CV to CC 1120 CODES$ = "STAT:OPER:ENAB 1024;PTR 1024" :GOSUB 2000 1125
22 Remote Programming
Loading...
+ 46 hidden pages