6243/44 DC Voltage Current Source/Monitor Operation Manual
5.2.11 Program Examples
5-40
5.2.11.5
Program Example 5: Using Measurement Buffer Memory
(100 measurement data is recalled in the shortest time.)
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 dt_sz As Integer
’ Number of measurement buffer memory data
Dim dt_rn(100) As String * 15
’ Measurement buffer memory data storage string variable
Dim i As Integer, s As Integer
’ i: Loop variable, s: Serial poll result storage variable
board = 0
’ GPIB board address 0
pad = 1
’ 6243/44 address 1
Call ibdev(board, pad, 0, T30s, 1, 1, vig)
’ Opening and initializing device (6243/44) (timeout 30 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
’ Executing sweep measurement
Call SUBsend(vig, “C,*RST”)
’ DCL and parameter initialization
Call SUBsend(vig, “*CLS”)
’ Status byte initialization
Call SUBsend(vig, “*SRE8”)
’ Setting bit 3 for the Service Request Enable Register to 1
Call SUBsend(vig, “DSE8192”)
’ Setting bit 13 for the Device Event Enable Register to 1
Call SUBsend(vig, “S0”)
’ SRQ transmission mode
’ Registering setting for transmitting SRQ following completion of sweep
Call SUBsend(vig, “MD2”)
’ Sweep generation mode
Call SUBsend(vig, “SN0.1V,10V,0.1V”)
’ Linear sweep: Start 0.1 V, stop 10 V, step 0.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”)
’ Starting sweep
’ 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”)
’ indicating error