User`s guide
Table Of Contents
- Agilent E3632A DC Power Supply
- Table of Contents
- List of Figures
- List of Tables
- 1 Getting Started
- 2 Operation and Features
- Overview
- Constant Voltage Operation
- Constant Current Operation
- Storing and Recalling Operating States
- Programming the Overvoltage Protection
- Programming the Overcurrent Protection
- Remote Voltage Sensing
- Disabling the Output
- System-Related Operations
- Remote Interface Configuration
- GPIB Interface Configuration
- RS-232 Interface Configuration
- Calibration
- 3 Remote Interface Reference
- SCPI Command Summary
- Introduction to the SCPI Language
- Simplified Programming Overview
- Using the APPLy Command
- Output Settings and Operation Commands
- Triggering Commands
- System-Related Commands
- Calibration Commands
- RS-232 Interface Commands
- SCPI Status Registers
- What is an event register?
- What is an enable register?
- SCPI status system
- The Questionable Status register
- The Standard Event register
- The Status Byte register
- Using Service Request (SRQ) and Serial POLL
- Using *STB? to read the Status Byte
- Using the Message Available Bit (MAV)
- To interrupt your bus controller using SRQ
- To determine when a command sequence is completed
- Using *OPC to signal when data is in the output buffer
- Status Reporting Commands
- Halting an Output in Progress
- SCPI Conformance Information
- IEEE-488 Conformance Information
- 4 Error Messages
- 5 Application Programs
- 6 Tutorial
- 7 Characteristics and Specifications
5 Application Programs
Example Program for Excel 5.0 (Windows 3.1 and GPIB)
146 E3632A User’s Guide
GPIB bas Macro
Option Explicit
' - Declarations for VISA.DLL, additional declarations are usually in the
' directory c:\vxipnp\win\include in file visa.bas, also see the VISA manual
Declare Function viOpenDefaultRM Lib "VISA.DLL" Alias "#141" (sesn As Long) As Long
Declare Function viOpen Lib "VISA.DLL" Alias "#131" (ByVal sesn As Long, _
ByVal desc As String, ByVal mode As Long, ByVal TimeOut As Long, vi As Long) As Long
Declare Function viClose Lib "VISA.DLL" Alias "#132" (ByVal vi As Long) As Long
Declare Function viRead Lib "VISA.DLL" Alias "#256" (ByVal vi As Long, _
ByVal Buffer As String, ByVal Count As Long, retCount As Long) As Long
Declare Function viWrite Lib "VISA.DLL" Alias "#257" (ByVal vi As Long, _
ByVal Buffer As String, ByVal Count As Long, retCount As Long) As Long
' Error Codes and other global variables
Global Const VI_SUCCESS = &h0&
Global videfaultRM As Long ' resource manager id for VISA GPIB
Global vi As Long ' stores the session for VISA
Dim errorStatus As Long ' VTL error code
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' This routine requires the file VISA.dll. It typically resides under
' the directory c:\windows\system. This routine uses the VTL Library to
' send commands to an instrument. A description of these and additional
' VTL commands are contained in the Hewlett Packard Visa Transition
' Library book Agilent PN E2094-90002.
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Function SendSCPI(SCPICmd As String) As String
' This function will send a SCPI command string to the
' GPIB port. If the command contains a question mark,
' the response is read, and returned.
Dim readbuf As String * 512 ' buffer used for returned string
Dim crlfpos As Integer ' location of CR's and LF's in readbuf
Dim cmdString As String ' command passed to instrument
Dim ReturnString As String ' string returned from instrument
Dim actual As Long ' number of characters send/returned
'Set up an error handler within this subroutine that will get
'called if an error occurs.
On Error GoTo VIerrorHandler
'Write the command to the instrument terminated by a linefeed.
cmdstring = SCPICmd & Chr$(10)
errorStatus = viWrite(vi, ByVal commandstr, Len(commandstr), actual)