7451A/7461A/7461P Digital Multimeter Operation Manual
6.8 Sample Programs (Command used in ADC CORPORATION)
6-56
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 7461A. The GPIB address of
the 7461A is set to 1.
Dim DMM_ADR As Integer
' Declares the variable of the 7461A 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 7461A
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 7461A.
Call ibwrt(dmm, "H1" & Chr(10))
' Sets the header of the output data to ON.
Call ibwrt(dmm, "F3" & Chr(10))
' Sets the measurement function to 2W
.
Call ibwrt(dmm, "R4" & Chr(10))
' Sets the measurement range to 1k
.
Call ibwrt(dmm, "ITP1" & Chr(10))
' Sets the integration time to 1 PLC.
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 of the measurement end.
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, 18)
' Substitutes the measurement value for a cell.
Call ibonl(dmm, 0)
' Terminates.
Example 3 Sets the measurement function to the DCV 10 V range and performs the high-speed measure-
ment (Sampling interval: 500
s). In the high-speed measurement, the data is read after the
measurements of the specified count are complete. The GPIB address of the 7461A is set to 1.
Dim DMM_ADR As Integer
' Declares the variable of the 7461A GPIB address.
Dim dmm As Integer
' Declares the variable of the device descriptor.
Dim dt As String * 20000
' Declares the variable of the buffer used for receiving the GPIB data.
Dim s As Integer
' The variable for storing the result of serial polling
DMM_ADR = 1
' The GPIB number of the 7461A
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.