2400 Series SourceMeter
®
User’s Manual Sweep Operation 10-27
Sweep branching program example
The code fragment below is a Visual Basic sweep branching subroutine. This example sets
up source memory locations 1-3 as indicated in code comments. Location 100 is used as a
dummy location. Failure at any one of locations 1-3 causes a branch to location 100 to
stop the sweep as soon as possible in the event of failure. For all three source memory
locations, operating modes are set as follows:
• Source function: volts, 10V output voltage
• Measurement function: current, 100mA range, 105mA compliance
• Delay: 1s
Test limits for the three memory locations are:
• Location 1: 10mA to 20mA
• Location 2: 20mA to 30mA
• Location 3: 30mA to 40mA
Attribute VB_Name = “Headers”
Option Explicit
Public Sub RunSourceMemory()
Dim intGPIB As Integer
Dim strAnswer As String
intGPIB = 24 'Primary address = 24.
Call OutputCmd(intGPIB, “:TRAC:CLE”) 'Clear Readings from
Buffer
'Setup Source Memory Location 1
'------------------------------
Call OutputCmd(intGPIB, “*RST”) 'Restore GPIB default
conditions.
Call OutputCmd(intGPIB, “:SOUR:FUNC VOLT”) 'Current Source
Function.
Call OutputCmd(intGPIB, “:SENS:FUNC ‘CURR:DC’”) 'Current Sense Function.
Call OutputCmd(intGPIB, “:SENS:CURR:PROT .105”) 'Set 105mA Compliance
Call OutputCmd(intGPIB, “:SENS:CURR:RANGE .1”) 'Set 100mA Current Mea-
sure Range
Call OutputCmd(intGPIB, “:SOUR:DEL 1”) 'Set Source Delay to 1
Call OutputCmd(intGPIB, “:SOUR:VOLT 10”) '10V Source Voltage.
Call OutputCmd(intGPIB, “:CALC2:FEED CURR”) 'Send Current(A) Read-
ings to Buffer
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com