7451A/7461A/7461P Digital Multimeter Operation Manual
6.9 Sample Programs (SCPI command)
6-61
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 in which the serial polling result is stored
DMM_ADR = 1
' The GPIB address 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 ibconfig(0, IbcAUTOPOLL, 0)
' Disables the automatic serial polling.
Call ibwrt(dmm, "*RST" & Chr(10))
' Initializes the 7461A.
Call ibwrt(dmm, ":SENSE:FUNCTION 'VOLTAGE:DC'" & Chr(10))
' Sets the measurement function to DCV.
Call ibwrt(dmm, ":SENSE:VOLTAGE:DC:RANGE 10" & Chr(10))
' Sets the measurement range to 10 V.
Call ibwrt(dmm, ":TRIGGER:SOURCE BUS" & Chr(10))
' Specifies "BUS" as the trigger.
Call ibwrt(dmm, ":INITIATE:CONTINUOUS ON" & Chr(10))
' Sets Continuous to ON.
Call ibwrt(dmm, ":SENSE:ZERO:AUTO OFF" & Chr(10))
' Disables the auto-zero.
Call ibwrt(dmm, ":SENSE:VOLTAGE:DC:APERTURE 100E-6" & Chr(10))
' Sets the integration time to 100
s.
Call ibwrt(dmm, ":TRIGGER:TIMER 500E-6" & Chr(10))
' Sets the sampling interval to 500
s.
Call ibwrt(dmm, ":DIPLAY OFF" & Chr(10))
' Sets the display to OFF.
Call ibwrt(dmm, ":TRACE:STATE ON" & Chr(10))
' Enables the measurement memory.
Call ibwrt(dmm, ":TRACE:CLEAR" & Chr(10))
' Clears the measurement memory.
Call ibwrt(dmm, ":SAMPLE:COUNT 1000" & Chr(10))
' Sets the sampling counts per one trigger. (1000 counts)
Call ibwrt(dmm, ":TRACE:NUMBER 0,999" & Chr(10))
' Sets the range of the recall. (0 to 999)
Call ibwrt(dmm, "*CLS" & Chr(10))
' Clears the status byte.
Call ibwrt(dmm, ":STATUS:MEASUREMENT:ENABLE 256" & Chr(10))
' Sets the measurement end flag of MSR.
Call ibwrt(dmm, "*SRE 1" & Chr(10))
' Sets the measurement end flag of SRE.
Call ibwrt(dmm, "*TRG" & Chr(10))
' Triggers.
Call ibwait(dmm, RQS Or TIMO)
' Waits for the SRQ transmitting.
If (ibsta And TIMO) Then
' Judges whether a time-out occurs.
Call MsgBox("SRQ Time Out", vbOKOnly, "Error")
' Sends a message if the time-out occurs.