7352 Series Digital Multimeter Operation Manual
6.7.2 Sample Programs (SCPI commands for GPIB)
6-56
6.7.2
Sample Programs (SCPI commands for GPIB)
This section describes example programs in which a computer controls this instrument through a GPIB
interface.
[Operation check environment]
Computer:
DELL OPTIPLEX 170L(Pentium
4 CPU 2.80GHz)
GPIB hardware:
GPIB-USB-HS manufactured by NATIONAL INSTRUMENTS
Module:
Niglobal.bas,Vbib-32.bas (Included software in PCI-GPIB)
Language:
Microsoft Excel Visual Basic for Application
NOTE:
The GPIB address of the 7352A is set to 1.
Example 1 Sets the DCV-Ach 2 V range for the left side display and the ACV-Ach 2 V range for the right
side display, sets the trigger source to BUS, and then triggers to start the measurement.
Detects the measurement end by polling the status byte, reads the measured data from the
7352A, and then displays the data in cells.
Dim DMM_ADR As Integer
'Declares the GPIB address variable of the 7352A.
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
'GPIB address of the 7352A
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" & vbLf)
'Initializes the 7352A.
Call ibwrt(dmm, ":SENSE:FUNCTION 'VOLTAGE:DC',(@1)" & vbLf)
'Sets the measurement function for the left side display to DCV.
Call ibwrt(dmm, ":SENSE:VOLTAGE:DC:RANGE 1.99999,(@1)" & vbLf)
'Sets the measurement range for the left side display to 2 V.
Call ibwrt(dmm, ":SENSE:VOLTAGE:DC:SRATE MED" & vbLf)
'Sets the sampling rate to MED.
Call ibwrt(dmm, ":SENSE:FUNCTION 'VOLTAGE:AC',(@2)" & vbLf)
'Sets the measurement function for the right side display to ACV.
Call ibwrt(dmm, ":SENSE:VOLTAGE:AC:RANGE 1.99999,(@2)" & vbLf)
'Sets the measurement range for the right side display to 2 V.
Call ibwrt(dmm, ":SENSE:VOLTAGE:AC:SRATE MED" & vbLf)
'Sets the sampling rate to MED.
Call ibwrt(dmm, ":TRIGGER:SOURCE BUS" & vbLf)
'Sets the trigger source to "BUS".
Call ibwrt(dmm, ":INITIATE:CONTINUOUS ON" & vbLf)
'Sets CONTINUOUS ON.
Call ibwrt(dmm, "*CLS" & vbLf)
'Clears the status byte.
Call ibwrt(dmm, "*TRG" & vbLf)
'Triggers.
Do
'Reads the status byte of the measurement end.
Call ibwrt(dmm, "*STB?" & vbLf)
'Requests the content of the status byte.
Call ibrd(dmm, dt)
'Writes the content of the status byte into the variable dt.
dt = dt And 16
'Performs the AND operation in bit4 (MAV).
Loop While (dt <> 16)