7351 Series Digital Multimeter Operation Manual
6.9 Sample Programs (SCPI command)
6-54
Example 2 Sets the measurement function to the 2W
measurement, detects the measurement end by
using the status byte, and reads the measurement data from the 7351A. The GPIB address of
the 7351A is set to 1 and the header is set to OFF.
Dim DMM_ADR As Integer
' Declares the variable of the 7351A GPIB address.
Dim dmm As Integer
' Declares the variable of the device descriptor.
Dim dt As String * 100
' Declares the variable of the buffer used for receiving the GPIB data.
DMM_ADR = 1
' The GPIB address of the 7351A
Call ibdev(0, DMM_ADR, 0, T10s, 1, 0, dmm)
' Initializes the GPIB I/F.
Call ibconfig(dmm, IbcUnAddr, 1)
' Sets the transmitting and receiving addresses individually.
Call ibwrt(dmm, "*RST" & Chr(10))
' Initializes the 7351A.
Call ibwrt(dmm, ":SENSE:FUNCTION 'RESISTANCE'" & Chr(10))
' Sets the measurement function to 2 W
.
Call ibwrt(dmm, ":SENSE:RESISTANCE:RANGE 1999" & Chr(10))
' Sets the measurement range to 2 k
.
Call ibwrt(dmm, ":SENSE:RESISTANCE:SRATE MED" & Chr(10))
' Sets integration time to MED.
Call ibwrt(dmm, ":TRIGGER:SOURCE BUS" & Chr(10))
' Specifies "BUS" as the trigger.
Call ibwrt(dmm, "*CLS" & Chr(10))
' Clears the status byte.
Call ibwrt(dmm, ":INITIATE;*WAI" & Chr(10))
' Waits for the trigger.
Call ibwrt(dmm, "*TRG" & Chr(10))
' Triggers.
Do
' Reads the status byte.
Call ibwrt(dmm, "*STB?" & Chr(10))
' Requests the contents of the status byte.
Call ibrd(dmm, dt)
' Writes the contents of the status byte into the variable dt.
dt = dt And 16
' Performs the AND operation in bit4 (MAV).
Loop While (dt <> 16)
Call ibwrt(dmm, ":FETCH?" & Chr(10))
' Requests the measurement data.
Call ibrd(dmm, dt)
' Reads the measurement data.
Cells(1, 1) = "'" & Left(dt, 12)
' Substitutes the measurement value for a cell.
Call ibonl(dmm, 0)
' Terminates.