126
────────────────────────────────────────────────────
8.9 Sample Programs
────────────────────────────────────────────────────
(3) Excel
Program List line
Dim buffer As String* 256 1
Sub Main( )
pad%=0
gpibad%=1
timeout%=T10s 5
Call ibfind("gpib0",pad%)
Call ibdev(pad%,gpibad%,0,timeout%,1,0,dmm%)
Call SendIFC(pad%)
Worksheets("Sheet1").Activate
Columns.Clear 10
Columns("B").NumberFormat= "0.0000E+00"
Range("A:C").HorizontalAlignment=xlCenter
For i=1 To 10
Call Trigger(pad%,gpibad%)
Call Send(pad%,gpibad%,":MEAS:RESI",NLend%) 15
Call Receive(pad%,gpibad%,buffer$,STOPend$)
Cells(i,"A")=i
Cells(i,"B")=bugger$
Cells(i,"B").TextTOColumns comma:=True
Rows(i).AutoFit 20
Next i
Columns("A:C").AutoFit
Call ibonl(pad%,0)
End Sub
Comments
line
6 Initialize the GP-IB port
8 Initialize the interface
9 Initialize the worksheet
14 Execute the measurement once
16 Getting the measurement value
17 Pastes the measurement value into cells.
21 Loop until getting the designated number of measurement value
23 Set the interface to the local state.