7351 Series Digital Multimeter Operation Manual
6.8 Sample Programs (Command used in ADC CORPORATION)
6-52
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 number 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, "F3" & Chr(10))
' Sets the measurement function to 2 W
.
Call ibwrt(dmm, "R4" & Chr(10))
' Sets the measurement range to 2 k
.
Call ibwrt(dmm, "PR2" & Chr(10))
' Sets the sampling rate to MED.
Call ibwrt(dmm, "TRS3" & Chr(10))
' Specifies "BUS" as the trigger.
Call ibwrt(dmm, "*CLS" & Chr(10))
' Clears the status byte.
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 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.