Output Programming Example - Agilent Technologies N6751A User Manual

Modular power system
Table of Contents

Advertisement

7 Programming Examples

Output Programming Example

Sub output_programming_example()
Dim IDN As String
Dim GPIBaddress As String
Dim ErrString As String
' This variable controls the channel number to be programmed
Dim channel As String
' This variable controls the voltage
Dim VoltSetting As Double
' This variable measures the voltage
Dim MeasureVoltString As String
' This variable controls the current
Dim CurrSetting As Double
' This variable controls the over voltage protection setting
Dim overVoltSetting As Double
'These variables are necessary to initialize the VISA COM.
Dim ioMgr As AgilentRMLib.SRMCls
Dim Instrument As VisaComLib.FormattedIO488
' The following command line provides the program with the VISA name of the
' interface that it will communicate with. It is currently set to use GPIB.
GPIBaddress = "GPIB0::5::INSTR"
' Use the following line instead for LAN communication
' TCPIPaddress="TCPIP0::141.25.36.214"
' Use the following line instead for USB communication
' USBaddress = "USB0::2391::1799::US00000002"
' Initialize the VISA COM communication
Set ioMgr = New AgilentRMLib.SRMCls
Set Instrument = New VisaComLib.FormattedIO488
Set Instrument.IO = ioMgr.Open(GPIBaddress)
' The next three command lines set the voltage, current, and over voltage
VoltSetting = 3
CurrSetting = 1.5
overVoltSetting = 10
' This variable can be changed to program any channel in the mainframe
channel = "(@1)"
With Instrument
' Send a power reset to the instrument
.WriteString "*RST"
' Query the instrument for the IDN string
.WriteString "*IDN?"
IDN = .ReadString
110
This is a simple program that sets a voltage, current, over-voltage,
and the status of over-current protection. When done, the program
checks for instrument error and gives a message if there is an error.
' amps
' channel 1
Series N6700 User's Guide

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents