8250A Optical Power Meter Operation Manual
4.7.1 GPIB Sample Programs
4-40
Call ibwrt(opm, "R07" & vbCrLf)
' Sets the measurement range to 20
W.
Call ibwrt(opm, "PR2" & vbCrLf)
' Sets the sampling rate to MED.
Call ibrd(opm, dt)
' Reads the measured value and substitutes it for a variable.
Cells(8, 2) = Left$(dt, 15)
' Substitutes the measured value for a cell.
Call ibonl(opm, 0)
' Terminates.
End Sub
Example 2 Triggers the measurement in the sampling HOLD mode, detects the measurement end by
using the status byte, and reads the measured data from the 8250A.
Set the GPIB address of the 8250A to 1.
Figure 4-4 Measurement Image 2 (GPIB)
Program list
Option Explicit
' All variables are clearly declared.
Sub Sample2_Click()
' Registers the subroutine for the command button on the sheet.
Dim GP_ADR As Integer
' Declares the variable of the GPIB address of the 8250A.
Dim opm 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.
GP_ADR = 1
' GPIB address of the 8250A
Call ibdev(0, GP_ADR, 0, T10s, 1, 0, opm)
' Initializes the GPIB I/F.
Call ibconfig(opm, IbcUnAddr, 1)
' Sets the transmitting and receiving addresses individually.
Call ibwrt(opm, "*RST" & vbCrLf)
' Initializes the 8250A.
Call ibwrt(opm, "DW0" & vbCrLf)
' Sets the unit display to dBm.
Call ibwrt(opm, "R0" & vbCrLf)
' Sets the measurement range to Auto.
Call ibwrt(opm, "M1" & vbCrLf)
' Sets the sampling mode to HOLD.
Call ibwrt(opm, "*CLS" & vbCrLf)
' Clears the status byte.