Agilent Technologies 5744A, 5752A, 5743A, 5748A, 5741A, 5746A, 5751A, 5742A Series N5700 User’s Guide

Models: 5751A 5744A 5743A 5750A 5749A 5752A 5747A 5742A 5748A 5741A 5745A 5746A

1 132
Download 132 pages 2.14 Kb
Page 85
Image 85

Programming Examples 6

' Set the voltage

.WriteString "VOLT" & Str$(VoltSetting)

' Set the current level

.WriteString "CURR " & Str$(CurrSetting)

'Set the triggered voltage and current levels

.WriteString "VOLT:TRIG " & Str$(trigVoltSetting)

.WriteString "CURR:TRIG " & Str$(trigCurrSetting)

'Turn the output on

.WriteString "OUTP ON"

'Make sure that the output is on

.WriteString "*OPC?"

.ReadString

'Measure the voltage before triggering the change

.WriteString "MEAS:VOLT?" MeasureVolt = .ReadNumber

'Save the value for later display

msg1$ = "Voltage before trigger = " & Str$(MeasureVolt)

'Initiate the trigger system

.WriteString "INIT"

'Make sure that the trigger system is initiated

Do

.WriteString "STAT:OPER:COND?" stat = .ReadNumber

Loop Until ((stat And WTG) = WTG)

'Trigger the unit

.WriteString "*TRG"

'Make sure that the trigger is done

.WriteString "*OPC?"

.ReadString

'Measure the voltage after triggering the change

.WriteString "MEAS:VOLT?" MeasureVolt = .ReadNumber

'Display the measured values

MsgBox msg1$ + Chr$(13) + "Voltage after trigger = " & Str$(MeasureVolt)

'Check instrument for any errors

.WriteString "Syst:err?" ErrString = .ReadString

'Give message if there is an error If Val(ErrString) Then

MsgBox "Error in instrument!" & vbCrLf & ErrString End If

End With

End Sub

Series N5700 User’s Guide

85

Page 85
Image 85
Agilent Technologies 5744A, 5752A, 5743A, 5748A, 5741A, 5746A, 5751A, 5742A, 5745A, 5747A, 5749A, 5750A Series N5700 User’s Guide