Agilent Technologies 6812B, 6814B, 6813B, 6834B, 6843A User Manual

...
Programming Guide
AC Power Solutions
Agilent Models 6811B, 6812B, 6813B
6814B, 6834B, and 6843A
Agilent Part No. 5962-0889 Printed in U.S.A. Microfiche No 6962-0890 December, 1998
Update April 2000

Safety Summary

The beginning of the ac source User’s Guide has a Safety Summary page. Be sure you are familiar with the information on this page before programming the ac source from a controller.
WARNING:
ENERGY HAZARD.
contact may result if the output terminals or circuits connected to the output are touched when power is applied.
Ac sources can supply 425 V peak at their output. DEATH on

Printing History

The edition and current revision of this manual are indicated below. Reprints of this manual containing minor corrections and updates may have the same printing date. Revised editions are identified by a new printing date. A revised edition incorporates all new or corrected material since the previous printing date. Changes to the manual occurring between revisions are covered by change sheets shipped with the manual.
This document contains proprietary information protected by copyright. All rights are reserved. No part of this document may be photocopied, reproduced, or translated into another language without the prior consent of Agilent Technologies. The information contained in this document is subject to change without notice.
Copyright 1996-1998, 2000 Agilent Technologies, Inc. Edition 1 __________August, 1996
Edition 2 __________March, 1997 Edition 3 __________December, 1998 Update __________April, 2000

Table of Contents

Safety Summary 2 Printing History 2 Table of Contents 3
1 - GENERAL INFORMATION 11
About this Guide 11
Earlier AC Source Models 11 Documentation Summary 11
External References 12
SCPI References 12 GPIB References 12
Agilent VXIplug&play Power Products Instrument Drivers 12
Supported Applications 12 System Requirements 13 Downloading and Installing the Driver 13 Accessing Online Help 13
2 - INTRODUCTION TO PROGRAMMING 15
GPIB Capabilities of the AC Source 15
GPIB Address 15
RS-232 Capabilities of the AC Source 15
RS-232 Data Format 15 Baud Rate 15 RS-232 Programming Example 16 RS-232 Troubleshooting 16
Introduction to SCPI 17
Conventions Used in This Guide 17 Types of SCPI Commands 17 Types of SCPI Messages 17
The SCPI Command Tree 18
The Root Level 18 Active Header Path 18 The Effect of Optional Headers 19 Moving Among Subsystems 19 Including Common Commands 20 Using Queries 20 Coupled Commands 20
Structure of a SCPI Message 20
The Message Unit 20 Combining Message Units 21 Headers 21 Query Indicator 22 Message Unit Separator 22 Root Specifier 22 Message Terminator 22
SCPI Data Formats 23
Numerical Data Formats 23 Suffixes and Multipliers 23 Character Data 23
System Considerations 24
Assigning the GPIB Address in Programs 24 Types of DOS Drivers 24 Error Handling 25 Agilent BASIC Controllers 25
3 - LANGUAGE DICTIONARY 27
Introduction 27 Subsystem Commands 28 Calibration Subsystem Commands 29
Subsystem Syntax 29 CALibrate:CURRent:AC 29 CALibrate:CURRent:MEASure 30 CALibrate:DATA 30 CALibrate:IMPedance 30 CALibrate:LEVel 30 CALibrate:PASSword 31 CALibrate:PWM:FREQuency 31 CALibrate:PWM:RAMP 31 CALibrate:SAVE 31 CALibrate:STATe 32 CALibrate:VOLTage:AC 32 CALibrate:VOLTage:DC 32 CALibrate:VOLTage:OFFSet 33 CALibrate:VOLTage:PROTection 33 CALibrate:VOLTage:RTIMe 33
Display Subsystem Commands 34
Subsystem Syntax 34 DISPlay 34 DISPlay:MODE 34 DISPlay:TEXT 34
Instrument Subsystem 35
Subsystem Syntax 35 INSTrument:COUPle 35 INSTrument:NSELect INSTrument:SELect 36
Measurement Subsystem (Arrays) 37
Subsystem Syntax 37 MEASure:ARRay:CURRent? FETCh:ARRay:CURRent? 37 MEASure:ARRay:CURRent:HARMonic? FETCh:ARRay:CURRent:HARMonic? 38 MEASure:ARRay:CURRent:HARMonic:PHASe? FETCh:ARRay:CURRent:HARMonic:PHASe? 38 MEASure:ARRay:CURRent:NEUTral? FETCh:ARRay:CURRent:NEUTral? 39 MEASure:ARRay:CURRent:NEUTral:HARMonic? FETCh:ARRay:CURRent:NEUTral:HARMonic? 39 MEASure:ARRay:CURRent:NEUTral:HARMonic:PHASe? FETCh:ARRay:CURRent:NEUTral:HARMonic:PHASe? 40 MEASure:ARRay:VOLTage? FETCh:ARRay:VOLTage? 40 MEASure:ARRay:VOLTage:HARMonic? FETCh:ARRay:VOLTage:HARMonic? 41 MEASure:ARRay:VOLTage:HARMonic:PHASe? FETCh:ARRay:VOLTage:HARMonic:PHASe? 41
Measurement Subsystem (Current) 42
Subsystem Syntax 42 MEASure:CURRent? FETCh:CURRent? 42 MEASure:CURRent:AC? FETCh:CURRent:AC? 43 MEASure:CURRent:ACDC? FETCh:CURRent:ACDC? 43 MEASure:CURRent:AMPLitude:MAXimum? FETCh:CURRent:AMPLitude:MAXimum? 43 MEASure:CURRent:CREStfactor? FETCh:CURRent:CREStfactor? 44
MEASure:CURRent:HARMonic? FETCh:CURRent:HARMonic? 44 MEASure:CURRent:HARMonic:PHASe? FETCh:CURRent:HARMonic:PHASe? 45 MEASure:CURRent:HARMonic:THD? FETCh:CURRent:HARMonic:THD? 45 MEASure:CURRent:NEUTral? FETCh:CURRent:NEUTral? 45 MEASure:CURRent:NEUTral:AC? FETCh:CURRent:NEUTral:AC? 46 MEASure:CURRent:NEUTral:ACDC? FETCh:CURRent:NEUTral:ACDC? 46 MEASure:CURRent:NEUTral:HARMonic? FETCh:CURRent:NEUTral:HARMonic? 46 MEASure:CURRent:NEUTral:HARMonic:PHASe? FETCh:CURRent:NEUTral:HARMonic:PHASe? 47
Measurement Subsystem (Frequency) 48
Subsystem Syntax 48 MEASure:FREQuency? FETCh:FREQuency? 48
Measurement Subsystem (Power) 49
Subsystem Syntax 49 MEASure:POWer? FETCh:POWer? 49 MEASure:POWer:AC? FETCh:POWer:AC? 49 MEASure:POWer:AC:APParent? FETCh:POWer:AC:APParent? 50 MEASure:POWer:AC:REACtive? FETCh:POWer:AC:REACtive? 50 MEASure:POWer:AC:PFACtor? FETCh:POWer:AC:PFACtor? 50 MEASure:POWer:AC:TOTal? FETCh:POWer:AC:TOTal? 51
Measurement Subsystem (Voltage) 52
Subsystem Syntax 52 MEASure:VOLTage? FETCh:VOLTage? 52 MEASure:VOLTage:AC? FETCh:VOLTage:AC? 52 MEASure:VOLTage:ACDC? FETCh:VOLTage:ACDC? 53 MEASure:VOLTage:HARMonic? FETCh:VOLTage:HARMonic? 53 MEASure:VOLTage:HARMonic:PHASe? FETCh:VOLTage:HARMonic:PHASe? 54 MEASure:VOLTage:HARMonic:THD? FETCh:VOLTage:HARMonic:THD? 54
Output Subsystem 55
Subsystem Syntax 55 OUTPut 55 OUTPut:COUPling 56 OUTPut:DFI 56 OUTPut:DFI:SOURce 56 OUTPut:IMPedance 57 OUTPut:IMPedance:REAL 57 OUTPut:IMPedance:REACtive 57 OUTPut:PON:STATe 58 OUTPut:PROTection:CLEar 58 OUTPut:PROTection:DELay 58 OUTPut:RI:MODE 59 OUTPut:TTLTrg 59 OUTPut:TTLTrg:SOURce 59
Sense Subsystem 60
Subsystem Syntax 60 SENSe:CURRent:ACDC:RANGe 60 SENSe:SWEep:OFFSet:POINts 61 SENSe:SWEep:TINTerval 61 SENSe:WINDow 61
Source Subsystem (Current) 62
Subsystem Syntax 62 CURRent 62 CURRent:PEAK 63 CURRent:PEAK:MODE 63 CURRent:PEAK:TRIGgered 64 CURRent:PROTection:STATe 64
Source Subsystem (Frequency) 65
Subsystem Syntax 65 FREQuency 65 FREQuency:MODE 65 FREQuency:SLEW 66 FREQuency:SLEW:MODE 66 FREQency:SLEW:TRIGgered 66 FREQuency:TRIGgered 67
Source Subsystem (Function) 68
Subsystem Syntax 68 FUNCtion 68 FUNCtion:MODE 69 FUNCtion:TRIGgered 69 FUNCtion:CSINusoid 70
Source Subsystem (List) 71
Subsystem Syntax 71 LIST:COUNt 72 LIST:CURRent 72 LIST:CURRent:POINts? 72 LIST:DWELl 73 LIST:DWELl:POINts? 73 LIST:FREQuency 73 LIST:FREQuency:POINts? 74 LIST:FREQuency:SLEW 74 LIST:FREQuency:SLEW:POINts? 74 LIST:PHASe 74 LIST:PHASe:POINts? 75 LIST:SHAPe 75 LIST:SHAPe:POINts? 75 LIST:STEP 76 LIST:TTLTrg 76 LIST:TTLTrg:POINts? 76 LIST:VOLTage 77 LIST:VOLTage:POINts? 77 LIST:VOLTage:SLEW 77 LIST:VOLTage:SLEW:POINts? 78 LIST:VOLTageOFFSet 78 LIST:VOLTage:OFFSet:POINts? 78 LIST:VOLTage:OFFSet:SLEW 79 LIST:VOLTage:OFFSet:SLEW:POINts? 79
Source Subsystem (Phase) 80
PHASe 80 PHASe:MODE 81 PHASe:TRIGgered 81
Source Subsystem (Pulse) 82
Subsystem Syntax 82 PULSe:COUNt 82 PULSe:DCYCle 82 PULSe:HOLD 83 PULSe:PERiod 84 PULSe:WIDTh 84
Source Subsystem (Voltage) 85
Subsystem Syntax 85 VOLTage 86 VOLTage:TRIGgered 86 VOLTage:MODE 87 VOLTage:OFFSet 87 VOLTage:OFFSet:MODE 88 VOLTage:OFFSet:TRIGgered 88 VOLTage:OFFSet:SLEW 89 VOLTage:OFFSet:SLEW:MODE 89 VOLTage:OFFSet:SLEW:TRIGgered 90 VOLTage:PROTection 90 VOLTage:PROTection:STATe 90 VOLTage:RANGe 91 VOLTage:SENSe:DETector VOLTage:ALC:DETector 91 VOLTage:SENSe:SOURce VOLTage:ALC:SOURce 92 VOLTage:SLEW 92 VOLTage:SLEW:MODE 93 VOLTage:SLEW:TRIGgered 93
Status Subsystem 94
Subsystem Syntax 94 STATus:PRESet 94 Bit Configuration of Operation Status Registers 95 STATus:OPERation? 95 STATus:OPERation:CONDition? 95 STATus:OPERation:ENABle 95 STATus:OPERation:NTRansition STATus:OPERation:PTRansition 96 Bit Configuration of Questionable Status Registers 97 STATus:QUEStionable? 97 STATus:QUEStionable:CONDition? 97 STATus:QUEStionable:ENABle 98 STATus:QUEStionable:NTRansition STATus:QUEStionable:PTRansition 98 Bit Configuration of Questionable Instrument Summary Registers 99 STATus:QUEStionable:INSTrument:ISUMmary? 99 STATus:QUEStionable:INSTrument:ISUMmary:CONDition? 100 STATus:QUEStionable:INSTrument:ISUMmary:ENABle 100 STATus:QUEStionable:INSTrument:ISUMmary:NTR STATus:QUEStionable:INSTrument:ISUMmary:PTR101
System Commands 102
Subsystem Syntax 102 SYSTem:CONFigure 102 SYSTem:CONFigure:NOUTputs 103 SYSTem:ERRor? 103 SYSTem:VERSion? 103 SYSTem:LANGuage 104 SYSTem:LOCal 104 SYSTem:REMote 104 SYSTem:RWLock 104
Trace Subsystem 105
Subsystem Syntax 105 TRACe DATA 105 TRACe:CATalog? DATA:CATalog? 106 TRACe:DEFine DATA:DEFine 106 TRACe:DELete DATA:DELete 106
Trigger Subsystem 107
Subsystem Syntax 107 ABORt 108 INITiate:SEQuence INITiate:NAME 108 INITiate:CONTinuous:SEQuence INITiate:CONTinuous:NAME 109 TRIGger 109 TRIGger:DELay 109 TRIGger:SOURce 110 TRIGger:SEQuence2:SOURce TRIGger:SYNChronize:SOURce 110 TRIGger:SEQuence2:PHASe TRIGger:SYNCHronize:PHASe 111 TRIGger:SEQuence3 TRIGger:ACQuire 111 TRIGger:SEQuence3:SOURce TRIGger:ACQuire:SOURce 112 TRIGger:SEQuence1:DEFine TRIGger:SEQuence2:DEFine TRIGger:SEQuence3:DEFine 112
Common Commands 113
Common Commands Syntax 113 *CLS 114 *ESE 114 Bit Configuration of Standard Event Status Enable Register 114 *ESR? 115 *IDN? 115 *OPC 115 *OPT? 116 *PSC 116 *RCL 116 *RST 117 *SAV 118 *SRE 118 *STB? 119 Bit Configuration of Status Byte Register 119 *TRG 119 *TST? 119 *WAI 120
4 - PROGRAMMING EXAMPLES 121
Introduction 121 Programming the Output 121
Power-on Initialization 121 Enabling the Output 121 AC Voltage and Frequency 122 Voltage and Frequency Slew Rates 123 Waveform Shapes 123 Individual Phases (Agilent 6834B only) 124 Current Limit 125 DC Output (Agilent 6811B/6812B/6813B only) 126 Coupled Commands 127
Programming Output Transients 128
Transient System Model 129 Step and Pulse Transients 130 List Transients 130
Triggering Output Changes 132
SCPI Triggering Nomenclature 132 Output Trigger System Model 132 Initiating the Output Trigger System 134 Selecting the Output Trigger Source 134
Specifying a Trigger Delay 135 Synchronizing Output Changes to a Reference Phase Angle 135 Generating Output Triggers 136 Specifying a Dwell Time for Each List Point 136
Making Measurements 137
Voltage and Current Measurements 137 Power Measurements 138 Harmonic Measurements 138 Simultaneous Output Phase Measurements (Agilent 6834B only) 138 Returning Voltage and Current Data From the Data Buffer 139 Regulatory-Compliant Measurement of Quasi-Stationary Harmonics 139
Triggering Measurements 139
SCPI Triggering Nomenclature 139 Measurement Trigger System Model 139 Initiating the Measurement Trigger System 140 Selecting the Measurement Trigger Source 140 Generating Measurement Triggers 141 Controlling the Instantaneous Voltage and Current Data Buffers 141
Programming the Status Registers 142
Power-On Conditions 142 Operation Status Group 142
Questionable Status Group 144
Questionable Instrument Isummary Status Group 145 Standard Event Status Group 146 Status Byte Register 147 Examples 147
Programming the Trigger In and Trigger Out BNC Connectors 148
Trigger In BNC 148 Trigger Out BNC 149
Remote Inhibit and Discrete Fault Indicator 149
Remote Inhibit (RI) 150 Discrete Fault Indicator (DFI) 150
SCPI Command Completion 150
A - SCPI COMMAND TREE 151
Command Syntax 151
B - SCPI CONFORMANCE INFORMATION 155
SCPI Confirmed Commands 155 Non SCPI Commands 156
C - ERROR MESSAGES 157
Error Number List 157
D - ELGAR MODEL 9012 COMPATIBILITY 161
Elgar Model 9012 Plug-in Programmer Compatibility 161 Main Board W1 Jumper Option Emulation 161 Syntax Compatibility 161 Status Model 162 Power-on State 162 Protection 163 Front Panel Operation 163
System Keys 163
Function Keys 163 Entry Keys 164
E9012 Language Command Summary 164
E - IEC MODE COMMAND SUMMARY 167
Introduction 167
Using the SENSe:CURRent:ACDC:RANGe command 167 Command Syntax 168 CALCulate:INTegral:TIME 169 CALCulate:SMOothing 169 CALCulate:LIMit:UPPer 170 FORMat 171 FORMat:BORDer 172 MEASure:ARRay:CURRent:HARMonic? 173 MEASure:ARRay:VOLTage:FLUCtuations:ALL? 174 MEASure:ARRay:VOLTage:FLUCtuations:FLICker? 176 MEASure:ARRay:VOLTage:FLUCtuations:PST? 177 SENSe:CURRent:PREFerence 178 SENSe:WINDow 178 SYSTem:CONFigure 179
INDEX 181
10

General Information

About this Guide

This manual contains programming information for the Agilent 6811B, 6812B, 6813B, 6814B, 6834B, 6843A AC Power Solutions. These units will be referred to as "ac sources" throughout this manual. You will find the following information in the rest of this guide:
Chapter 1 Introduction to this guide. Chapter 2 Introduction to SCPI messages structure, syntax, and data formats. Chapter 3 Dictionary of SCPI commands. Chapter 4 Introduction to programming the ac source with SCPI commands. Appendix A SCPI command tree. Appendix B SCPI conformance information. Appendix C Error messages Appendix D Elgar Model 9012 plug-in programmer compatibility Appendix E IEC mode SCPI commands
Earlier AC Source Models
With the exception of some minor readback specification differences, information in this manual also applies to the following earlier ac source models:
1
Information about this
current model
Agilent 6811B Agilent 6811A AC Power Source/Analyzer Agilent 6812B Agilent 6812A AC Power Source/Analyzer
Agilent 6813B Agilent 6813A AC Power Source/Analyzer
also applies to the following earlier
models:
Agilent 6841A Harmonic/Flicker Test System in normal mode
Agilent 6842A Harmonic/Flicker Test System in normal mode
Documentation Summary
The following documents that are related to this Programming Guide have additional helpful information for using the ac source.
Quick Start Guide
u
u
User’s Guide
panel, how to connect to the instrument, and calibration procedures.
u
Quick Reference Card
u
Agilent 14761A, 14762A, 14763A User’s Guides
application and with Agilent 6843A units only.
. Information on how to quickly get started using the ac source.
. Includes specifications and supplemental characteristics, how to use the front
. Designed as a memory jogger for front panel and GPIB operation.
are shipped along with the specific software
11
1 - General Information

External References

SCPI References
The following documents will assist you with programming in SCPI:
Beginner’s Guide to SCPI
u
has not had previous experience programming with SCPI.
u
Tutorial Description of the General Purpose Interface Bus
recommended for those not familiar with the IEEE 488.1 and 488.2 standards.
To obtain a copy of the above documents, contact your local Agilent Sales and Support Office.
. Agilent Part No. H2325-90001. Highly recommended for anyone who
. Agilent Part No. 5952-0156. Highly
GPIB References
The most important GPIB documents are your controller programming manuals - Agilent BASIC, GPIB Command Library for MS DOS, etc. Refer to these for all non-SCPI commands (for example: Local Lockout).
The following are two formal documents concerning the GPIB interface:
ANSI/IEEE Std. 488.1-1987 IEEE Standard Digital Interface for Programmable Instrumentation
u
Defines the technical details of the GPIB interface. While much of the information is beyond the need of most programmers, it can serve to clarify terms used in this guide and in related documents.
ANSI/IEEE Std. 488.2-1987 IEEE Standard Codes, Formats, Protocols, and Common
u
Commands
programming. Helpful for finding precise definitions of certain types of SCPI message formats, data types, or common commands.
The above two documents are available from the IEEE (Institute of Electrical and Electronics Engineers), 345 East 47th Street, New York, NY 10017, USA.
. Recommended as a reference only if you intend to do fairly sophisticated
.
Agilent VXI
Agilent VXI now available on the Web at http://www.ag.com/go/drivers. These instrument drivers provide a high­level programming interface to your Agilent Power Products instrument. Agilent VXI drivers are an alternative to programming your instrument with SCPI command strings. Because the instrument driver’s function calls work together on top of the VISA I/O library, a single instrument driver can be used with multiple application environments.
plug&play
plug&play
Power Products instrument drivers for Microsoft Windows 95 and Windows NT are
Power Products Instrument Drivers
plug&play
instrument
Supported Applications
ñ Agilent VEE ñ Microsoft Visual BASIC ñ Microsoft Visual C/C++ ñ Borland C/C++ ñ National Instruments LabVIEW ñ National Instruments LabWindows/CVI
12
System Requirements
General Information - 1
The Agilent 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 Agilent VXIplug&play instrument driver, make sure that you have one
of the supported applications installed and running on your computer.
1. Access Agilent Technologies’ Web site at http://www.ag.com/go/drivers.
2. Select the instrument for which you need the driver.
3. Click on the driver, either Windows 95 or Windows NT, and download the executable file to your PC.
4. Locate the file that you downloaded from the Web. From the Start menu select Run <path>:\agxxxx.exe - where <path> is the directory path where the file is located, and agxxxx is the instrument driver that you downloaded .
5. Follow the directions on the screen to install the software. The default installation selections will work in most cases. The readme.txt file contains product updates or corrections that are not documented in the on-line help. If you decide to install this file, use any text editor to open and read it.
6. To use the VXI help under “Introduction to Programming”.
plug&play
instrument driver, follow the directions in the Agilent VXI
plug&play
online
Accessing Online Help
A comprehensive online programming reference is provided with the driver. It describes how to get started using the instrument driver with Agilent VEE, LabVIEW, and LabWindows. It includes complete descriptions of all function calls as well as example programs in C/C++ and Visual BASIC.
ñ To access the online help when you have chosen the default Vxipnp start folder, click on the Start button and select Programs | Vxipnp | agxxxx Help (32-bit).
- where agxxxx is the instrument driver.
13
2

Introduction to Programming

GPIB Capabilities of the AC Source

All ac source functions except for setting the GPIB address are programmable over the GPIB. The IEEE
488.2 capabilities of the ac source are listed in the appendix A of the User’s Guide.
GPIB Address
The ac source operates from a GPIB address that is set from the front panel. To set the GPIB address, press the Address key on the front panel and enter the address using the Entry keys.

RS-232 Capabilities of the AC Source

The ac source provides an RS-232 programming interface, which is activated by commands located under the front panel Address key. All SCPI and E9012 commands are available through RS-232 programming. When the RS-232 interface is selected, the GPIB interface is disabled.
The EIA RS-232 Standard defines the interconnections between Data Terminal Equipment (DTE) and Data Communications Equipment (DCE). The ac source is designed to be a DTE. It can be connected to another DTE such as a PC COM port through a null modem cable.
NOTE: The RS-232 settings in your program must match the settings specified in the front panel
Address menu. Press the front panel Address key if you need to change the settings.
RS-232 Data Format
The RS-232 data is a 11-bit word with one start bit and two stop bits. The number of start and stop bits is not programmable. The following parity options are selectable using the front panel Address key:
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.
Baud Rate
The front panel Address key lets you select one of the following baud rates, which is stored in non-volatile memory: 300 600 1200 2400 4800 9600
15
2 - Introduction to Programming
RS-232 Programming Example
The following program illustrates how to program the ac source using RS-232 to set the output voltage and frequency and to read back the model number and output voltage. The program was written to run on any controller using Microsoft QBasic.
NOTE: The ac source must be configured for RS232 and the same baud rate and parity as the
controller.
‘ Program to write and read via RS232 ‘ Configure serial port for: ‘ 9600 baud ‘ 7 bit data ‘ 2 stop bits ‘ Ignore request to send ‘ Ignore carrier detect ‘ Even parity ‘ Needed with Vectra basic, ignored with QBasic ‘ Send line feed ‘ Reserve 1000 character buffer for serial I/O ‘ DECLARE FUNCTION gets$ () ‘ Function to read string from ac source CLS ‘ Clears screen LOCATE 1, 1 ‘ Position cursor at top left ‘ Configure Com1 Port OPEN “com1:9600,e,7,2,rs,cd,pe,lf” FOR RANDOM AS #1 LEN = 1000 PRINT #1, “*RST” ‘ Resets the ac source PRINT #1, “VOLT 60” ‘ Set voltage to 60 volts PRINT #1, “FREQ 50” ‘ Set frequency to 50 hertz PRINT #1, “OUTPUT ON” ‘ Turn on the output PRINT #1, “*IDN?” ‘ Query the ac source identification string PRINT gets$ ‘ Go to gets$ Function and print data returned PRINT #1, MEAS”VOLT?”; volt ‘ Query the ac source voltage Volt = VAL (gets$) ‘ Convert gets$ string to a value PRINT gets$ ‘ Print the value of the voltage END ‘ End of main program
FUNCTION gets$ ‘ Get a new line feed terminated string from device #1 C$ = “” ‘ Set C$ to null WHILE c$ <> CHR$ (10) ‘ Set loop to stop at Line Feed
C$ = INPUT$ (1, #1) ‘ Read 1 bit into file #1
Resp$ = resp$ + c$ ‘ Concatenate bit with previous bits WEND ‘ End of WHILE loop gets$ = resp$ ‘ Assign response to gets$ END FUNCTION
RS-232 Troubleshooting
If you are having trouble communicating over the RS-232 interface, check the following:
The computer and the ac source must be configured for the same baud rate, parity, and number of data bits. Note that the ac source is configured for 1 start bit and 2 stop bits (these values are fixed).
The correct interface cables or adaptors must be used, as described under "RS-232 Connector" in
the User’s Guide. Note that even if the cable has the proper connectors for your system, the internal wiring may be incorrect.
The interface cable must be connected to the correct serial port on your computer (COM1, COM2,
etc.).
16
Introduction to Programming - 2

Introduction to SCPI

SCPI (Standard Commands for Programmable Instruments) is a programming language for controlling instrument functions over the GPIB. SCPI is layered on top of the hardware-portion of IEEE 488.2. The same SCPI commands and parameters control the same functions in different classes of instruments. For example, you would use the same DISPlay command to control the ac source display and the display of a SCPI-compatible multimeter.
Conventions Used in This Guide
Angle brackets < > Items within angle brackets are parameter abbreviations. For example,
<NR1> indicates a specific form of numerical data.
Vertical bar | Vertical bars separate alternative parameters. For example, NORM | TEXT
indicates that either "TEXT" or "NORM" can be used as a parameter.
Square Brackets [ ] Items within square brackets are optional. The representation
[SOURce:]LIST means that SOURce: may be omitted.
Braces { } Braces indicate parameters that may be repeated zero or more times. It is
used especially for showing arrays. The notation <A>{<,B>} shows that parameter "A" must be entered, while parameter "B" may be omitted or may be entered one or more times.
Computer font Computer font is used to show program lines in text. TRIGger:DELay .5
shows a program line.
Types of SCPI Commands
SCPI has two types of commands, common and subsystem.
u Common commands generally are not related to specific operation but to controlling overall ac
source functions, such as reset, status, and synchronization. All common commands consist of a three-letter mnemonic preceded by an asterisk:*RST*IDN?*SRE 8
u Subsystem commands perform specific ac source functions. They are organized into an inverted
tree structure with the "root" at the top. Some are single commands while others are grouped within specific subsystems.
Refer to appendix A for the ac source SCPI tree structure.
Types of SCPI Messages
There are two types of SCPI messages, program and response.
u A program message consists of one or more properly formatted SCPI commands sent from the
controller to the ac source. The message, which may be sent at any time, requests the ac source to perform some action.
u A response message consists of data in a specific SCPI format sent from the ac source to the
controller. The ac source sends the message only when commanded by a program message called a "query."
17
2 - Introduction to Programming
T
g

The SCPI Command Tree

As previously explained, the basic SCPI communication method involves sending one or more properly formatted commands from the SCPI command tree to the instrument as program messages. The following figure shows a portion of a subsystem command tree, from which you access the commands located along the various paths (you can see the complete tree in appendix A).
ROO
:OUTPut
:STATus
[:STATe]
:COUPlin
:DFI
:PROTection
:OPERation
[:STATe]
:SOURce
:CLEar
:DELay
[:EVEN]
:CONDition?
?
Figure 2-1. Partial Command Tree
The Root Level
Note the location of the ROOT node at the top of the tree. Commands at the root level are at the top level of the command tree. The SCPI interface is at this location when:
u the ac source is powered on u a device clear (DCL) is sent to the ac source u the SCPI interface encounters a message terminator u the SCPI interface encounters a root specifier
Active Header Path
In order to properly traverse the command tree, you must understand the concept of the active header path. When the ac source is turned on (or under any of the other conditions listed above), the active path is at the root. That means the SCPI interface is ready to accept any command at the root level, such as OUTPut or STATe.
If you enter OUTPut, the active header path moves one colon to the right . The interface is now ready to accept :STATe, :COUPling, :DFI, or :PROTection as the next header. You must include the colon, because it is required between headers.
If you now enter :PROTection, the active path again moves one colon to the right. The interface is now ready to accept either :CLEar or :DELay as the next header.
18
Introduction to Programming - 2
If you now enter :CLEar, you have reached the end of the command string. The active header path remains at :CLEar. If you wished, you could have entered :CLEar;DELay 20 and it would be accepted as a compound message consisting of:
OUTPut:PROTection:CLEAr and OUTPut:PROTection:DELay 20.
The entire message would be:
OUTPut:PROTection:CLEar;DELay 20
The message terminator after DELay 20 returns the path to the root.
The Effect of Optional Headers
If a command includes optional headers, the interface assumes they are there. For example, if you enter OUTPut OFF, the interface recognizes it as OUTPut:STATe OFF. This returns the active path to the root (:OUTPut). But if you enter |OUTPut:STATe OFF,| then the active path remains at :STATe. This allows you to send
OUTPut:STATe OFF;PROTection:CLEar
in one message. If you tried to send
OUTPut OFF;PROTection:CLEar
the header path would return to :OUTPut instead of :PROTection. The optional header [SOURce] precedes the current, frequency, function, phase, pulse, list, and voltage
subsystems. This effectively makes :CURRent, :FREQuency, :FUNCtion, :PHASe, :PULse, :LIST, and :VOLTage root-level commands.
Moving Among Subsystems
In order to combine commands from different subsystems, you need to be able to restore the active path to the root. You do this with the root specifier (:). For example, you could clear the output protection and check the status of the Operation Condition register as follows:
OUTPut:PROTection:CLEAr STATus:OPERation:CONDition?
Because the root specifier resets the command parser to the root, you can use the root specifier and do the same thing in one message:
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 70;PROTection 80;:CURRent:LEVel 3;PROTection:STATe ON
Note the use of the optional header LEVel to maintain the correct path within the voltage and current subsystems and the use of the root specifier to move between subsytems.
NOTE: The "Enhanced Tree Walking Implementation" given in appendix A of the IEEE 488.2
standard is not implemented in the ac source.
19
2 - Introduction to Programming
Including Common Commands
You can combine common commands with system commands in the same message. Treat the common command as a message unit by separating it with a semicolon (the message unit separator). Common commands do not affect the active header path; you may insert them anywhere in the message.
VOLTage:TRIGger 7.5;INITialize;*TRG OUTPut OFF;*RCL 2;OUTPut ON
Using Queries
Observe the following precautions with queries:
u Set up the proper number of variables for the returned data. u Read back all the results of a query before sending another command to the ac source. Otherwise
a Query Interrupted error will occur and the unreturned data will be lost.
Coupled Commands
When commands are coupled it means that the value sent by one command is affected by the settings of the other commands. The following commands are coupled in the ac source:
u the voltage, voltage offset, and function shape commands u the step, pulse, and list commands that control output voltages, voltage offsets, and function
shapes
u the pulse commands that program the width, duty cycle, period, and the hold parameter u the voltage range and current limit commands in some ac source models
As explained later in Chapter 4, the order in which data is sent by these coupled commands can be important when more than one parameter is changed.

Structure of a SCPI Message

SCPI messages consist of one or more message units ending in a message terminator. The terminator is not part of the syntax, but implicit in the way your programming language indicates the end of a line (such as a newline or end-of-line character).
The Message Unit
The simplest SCPI command is a single message unit consisting of a command header (or keyword) followed by a message terminator.
ABORt<newline> VOLTage?<newline>
The message unit may include a parameter after the header. The parameter usually is numeric, but it can be a string:
VOLTage 20<newline> VOLTage MAX<newline>
20
Introduction to Programming - 2
g
y
Message Terminator
CURR?
Combining Message Units
The following command message is briefly described here, with details in subsequent paragraphs.
Data
Message Unit
Headers
VOLT:LEV 80
Header Separator
Messa
e Unit Separators
Figure 2-2. Command Message Structure
The basic parts of the above message are:
Message Component Example
Headers Header Separator Data Data Separator Message Units Message Unit Separator Root Specifier Query Indicator Message Terminator
VOLT LEV PROT CURR The colon in VOLT:LEV 8088 The space in VOLT 80 and PROT 88 VOLT:LEV 80 PROT 88 CURR? The semicolons in VOLT:LEV 80; and PROT 88; The colon in PROT 88;:CURR? The question mark in CURR? The <NL> (newline) indicator. Terminators are not part of the SCPI syntax
;
PROT 88
Root Specifier
Indicator
Quer
;
:
<NL>
Headers
Headers are instructions recognized by the ac source. Headers (which are sometimes known as "keywords") may be either in the long form or the short form.
Long Form Short Form
The SCPI interface is not sensitive to case. It will recognize any case mixture, such as TRIGGER, Trigger, TRIGger.
NOTE: Short form headers result in faster program execution.
The header is completely spelled out, such as VOLTAGE, STATUS, and DELAY. The header has only the first three or four letters, such as VOLT, STAT, and DEL.
21
2 - Introduction to Programming
Header Convention
Header Separator
Optional Headers
In the command descriptions in Chapter 3 of this manual, headers are emphasized with boldface type. The proper short form is shown in upper-case letters, such as DELay.
If a command has more than one header, you must separate them with a colon (VOLT:PROT OUTPut:RELay:POLarity).
The use of some headers is optional. Optional headers are shown in brackets, such as OUTPut[:STATe] ON. As previously explained under "The Effect of Optional Headers", if you combine two or more message units into a compound message, you may need to enter the optional header.
Query Indicator
Following a header with a question mark turns it into a query (VOLTage?, VOLTage:PROTection?). If a query contains a parameter, place the query indicator at the end of the last header (VOLTage:PROTection? MAX).
Message Unit Separator
When two or more message units are combined into a compound message, separate the units with a semicolon (STATus:OPERation?;QUEStionable?).
Root Specifier
When it precedes the first header of a message unit, the colon becomes the root specifier. It tells the command parser that this is the root or the top node of the command tree. Note the difference between root specifiers and header separators in the following examples:
OUTPut:PROTection:DELay .1 :OUTPut:PROTection:DELay .1 OUTPut:PROTection:DELay .1;:VOLTage 12.5
All colons are header separators Only the first colon is a root specifier Only the third colon is a root specifier
NOTE: You do not have to precede root-level commands with a colon; there is an implied colon in
front of every root-level command.
Message Terminator
A terminator informs SCPI that it has reached the end of a message. Three permitted messages terminators are:
u newline (<NL>), which is ASCII decimal 10 or hex 0A. u end or identify (<END>) u both of the above (<NL><END>).
In the examples of this guide, there is an assumed message terminator at the end of each message. If the terminator needs to be shown, it is indicated as <NL> regardless of the actual terminator character.
22
Introduction to Programming - 2

SCPI Data Formats

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

System Considerations

The remainder of this chapter addresses some system issues concerning programming. These are ac source addressing and the use of the following types of GPIB system interfaces:
u HP Vectra PC controller with Agilent 82335A GPIB Interface Command Library u IBM PC controller with National Instruments GPIB-PCII Interface/Handler u Agilent controller with Agilent BASIC Language System
Assigning the GPIB Address in Programs
The ac source address cannot be set remotely. It must be set from the front panel. Once the address is set, you can assign it inside programs. The following examples assume that the GPIB select code is 7, and the ac source will be assigned to the variable ACS.
1070 ACS=706 ! Agilent 82335A Interface 1070 ASSIGN @ACS TO 706 ! 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 GPIB documentation).
Types of DOS Drivers
The Agilent 82335A and National Instruments GPIB are two popular DOS drivers. Each is briefly described here. See the software documentation supplied with the driver for more details.
Agilent 82335A Driver For GW-BASIC programming, the GPIB library is implemented as a series of subroutine calls. To access
these subroutines, your application program must include the header file SETUP.BAS, which is part of the DOS driver software.
SETUP.BAS starts at program line 5 and can run up to line 999. Your application programs must begin at line 1000. SETUP.BAS has built-in error checking routines that provide a method to check for GPIB errors during program execution. You can use the error-trapping code in these routines or write your own code using the same variables as used by SETUP.BAS.
National Instruments GPIB Driver
Your program must include the National Instruments header file DECL.BAS. This contains the initialization code for the interface. Prior to running any applications programs, you must set up the interface with the configuration program (IBCONF.EXE).
Your application program will not include the ac source symbolic name and GPIB address. These must be specified during configuration (when you run IBCONF.EXE). Note that the primary address range is from 0 to 30 but any secondary address must be specified in the address range of 96 to 126. The instrument expects a message termination on EOI or line feed, so set EOI w/last byte of Write. It is also recommended that you set Disable Auto Serial Polling.
All function calls return the status word IBSTA%, which contains a bit (ERR) that is set if the call results in an error. When ERR is set, an appropriate code is placed in variable IBERR%. Be sure to check IBSTA% after every function call. If it is not equal to zero, branch to an error handler that reads IBERR% to extract the specific error.
24
Introduction to Programming - 2
Error Handling
If there is no error-handling code in your program, undetected errors can cause unpredictable results. This includes "hanging up" the controller and forcing you to reset the system. Both of the above DOS drivers have routines for detecting program execution errors.
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 ac source can be programmed to generate SRQ on errors, your program can use an SRQ service routine for decoding detected errors. The detectable errors are listed in Appendix C.
25
3

Language Dictionary

Introduction
This section gives the syntax and parameters for all the IEEE 488.2 SCPI commands and the Common commands used by the ac sources when operating in Normal mode. It is assumed that you are familiar with the material in Chapter 2 "Introduction to Programming". Because the SCPI syntax remains the same for all programming languages, the examples given for each command are generic.
Syntax Forms
Parameters
Models
Phases
Related Commands
Order of Presentation
Syntax definitions use the long form, but only short form headers (or "keywords") appear in the examples. Use the long form to help make your program self­documenting.
Most commands require a parameter and all queries will return a parameter.The range for a parameter may vary according to the model of ac source. Parameters for all
models are listed in the Specifications table in the User’s Guide. If a command only applies to specific models, those models are listed in the <Model>
Only entry. If there is no <Model> Only entry, the command applies to all models. If a command can apply to individual phases of an , the entry Phase Selectable will
appear in the command description. Where appropriate, related commands or queries are included. These are listed
because they are either directly related by function, or because reading about them will clarify or enhance your understanding of the original command or query.
The dictionary is organized as follows:
u Subsystem commands, arranged by subsystem u IEEE 488.2 common commands
27
3 - Language Dictionary

Subsystem Commands

Subsystem commands are specific to functions. They can be a single command or a group of commands. The groups are comprised of commands that extend one or more levels below the root. The description of common commands follows the description of the subsystem commands.
The subsystem command groups are listed in alphabetical order and the commands within each subsystem are grouped alphabetically under the subsystem. Commands followed by a question mark (?) take only the query form. When commands take both the command and query form, this is noted in the syntax descriptions.
You will find the subsystem command groups discussed on the following pages:
Subsystem Page
Calibration Subsystem 29 Display Subsystem 34 Instrument Subsystem 35 Measurement Subsystem (Arrays) 37 Measurement Subsystem (Current) 42 Measurement Subsystem (Frequency) 48 Measurement Subsystem (Power) 49 Measurement Subsystem (Voltage) 52 Output Subsystem 55 Sense Subsystem 60 Source Subsystem (Current) 62 Source Subsystem (Frequency) 65 Source Subsystem (Function) 68 Source Subsystem (List) 71 Source Subsystem (Phase) 80 Source Subsystem (Pulse) 82 Source Subsystem (Voltage) 85 Status Subsystem 94 System Commands 102 Trace Subsystem 105 Trigger Subsystem 107 Common Commands 113
28
Language Dictionary - 3

Calibration Subsystem Commands

The commands in this subsystem allow you to do the following:
u Enable and disable the calibration mode u Change the calibration password u Calibrate the current and voltage output levels, and store new calibration constants in nonvolatile
memory.
Subsystem Syntax
CALibrate
:CURRent
:AC Begin ac current programming calibration sequence
:MEASure Begin current measurement calibration sequence :DATA <n> Input a calibration measurement :IMPedance Begin output impedance calibration sequence :LEVel <level> Advance to next calibration step (P1 | P2 | P3 | P4) :PASSword <n> Set calibration password :PWM
:FREQuency <n> Trim pulse width modulator frequency
:RAMP <n> Trim pulse width modulator ramp :SAVE Save new cal constants in non-volatile memory :STATE <bool> [,<n>] Enable or disable calibration mode :VOLTage
:AC Begin ac voltage calibration sequence
:DC Begin dc voltage calibration sequence
:OFFSet Begin offset voltage calibration sequence
:PROTection Begin voltage protection calibration sequence
:RTIMe Begin realtime voltage calibration sequence
CALibrate:CURRent:AC
Phase Selectable
This command can only be used in the calibration mode. It initiates the calibration of the ac current limit and metering circuits.
Command Syntax
Parameters
Examples
Related Commands
CALibrate:CURRent:AC None
CAL:CURR:AC
CAL:STAT CAL:SAV CAL:LEV
29
3 - Language Dictionary
CALibrate:CURRent:MEASure
Agilent 6811B, 6812B, 6813B, 6843A Only
This command is used to initiate the calibration of the current metering circuits and the peak current limit circuits. It can only be used in the calibration mode.
Command Syntax
Parameters
Examples
Related Commands
CALibrate:CURRent:MEASure None
CAL:CURR:MEAS
CAL:STAT CAL:SAV CAL:LEV
CALibrate:DATA
Phase Selectable
This command is only used in calibration mode. It enters a calibration value that you obtain by reading an external meter. You must first select a calibration level (with CALibrate:LEVel) for the value being entered. These constants are not stored in nonvolatile memory until they are saved with CALibrate:SAVE. If CALibrate:STATE OFF is programmed without a CALibrate:SAVE, the previous calibration constants are restored.
Command Syntax
Parameters
Examples
Related Commands
CALibrate:DATA <NRf> <external reading>
A
Unit
(amperes)
CAL:DATA 3222.3 MA CAL:DATA 5.000
CAL:STAT CAL:SAV
CALibrate:IMPedance
Agilent 6811B, 6812B, 6813B, 6843A Only
This command can only be used in calibration mode. It calibrates the output impedance circuits. The automatically performs the calibration and stores the impedance constant in nonvolatile memory. CALibrate:IMPedance is a sequential command that takes several seconds to complete.
Command Syntax
Parameters
Examples
Related Commands
CALibrate:IMPedance None
CAL:IMP
CAL:STAT CAL:SAV
CALibrate:LEVel
Phase Selectable
This command can only be used in calibration mode. It is used to advance to the next state in the calibration sequence.
Command Syntax
Parameters
Examples
Related Commands
CALibrate:LEVel <level> P1 | P2 | P3 | P4
CAL:LEV P2
CAL:STAT CAL:SAV
30
Loading...
+ 157 hidden pages