6243/44 DC Voltage Current Source/Monitor Operation Manual
5.2.11 Program Examples
5-36
5.2.11.3 Program Example 3: Sweep Measurement
Option Explicit ’ Explicit declaration for all variables
Private Sub Start_Click() ’ Event procedure for the command button (Start)
Dim board As Integer ’ GPIB board address
Dim pad As Integer ’ 6243/44 address
Dim vig As Integer ’ 6243/44 device descriptor
Dim dt As String * 20 ’ Data reception buffer
Dim s As Integer ’ Serial poll result storage variable
board = 0 ’ GPIB board address 0
pad = 1 ’ 6243/44 address 1
Call ibdev(board, pad, 0, T10s, 1, 1, vig) ’ Opening and initializing device (6243/44) (timeout 10 s)
Call ibconfig(vig, IbcUnAddr, 1) ’ Address setting performed for each transmission or reception
Call ibeos(vig, &H40A) ’ Setting terminator to LF for sending command
Call SUBsend(vig, “C,*RST”) ’ DCL and parameter initialization
Call SUBsend(vig, “*CLS”) ’ Initializing status byte
Call SUBsend(vig, “*SRE8”) ’ Setting bit 3 for the Service Request Enable Register to 1
Call SUBsend(vig, “DSE8192”) ’ Setting bit 13 for the Service Event Enable Register to 1
Call SUBsend(vig, “S0”) ’ SRQ transmission mode
’ Register setting for transmitting SRQ following completion of sweep
Call SUBsend(vig, “MD2”) ’ Sweep generation mode
Call SUBsend(vig, “SN1V,10V,1V”) ’ Linear sweep: Start 1 V, stop 10 V, step 1 V
Call SUBsend(vig, “SB0V”) ’ Sweep bias value 0 V
Call SUBsend(vig, “SP3,4,100”) ’ Hold time 3 ms, measure delay time 4 ms
’ Period 100 ms
Call SUBsend(vig, “D30MA”) ’ Limiter value 30 mA
Call SUBsend(vig, “SM1”) ’ Memory Store ON
Call SUBsend(vig, “E”) ’ Output ON
Call SUBsend(vig, “*TRG”) ’ Sweep starts
’ Waiting for sweep measurement completion
Call ibwait(vig, RQS Or TIMO) ’ Waiting for SQL transmission
If (ibsta And TIMO) Then ’ In case of timeout
Call MsgBox(“SRQ Time Out”, vbOKOnly, “Error”)
’ Error indicated
Else ’ If no timeout
Call ibrsp(vig, s) ’ executing serial poll
End If ’ Ending If