8250A Optical Power Meter Operation Manual
4.7 Sample Programs
4-39
4.7
Sample Programs
4.7.1
GPIB Sample Programs
This section shows examples of programs that control this instrument from a personal computer through
GPIB.
[Operation check environment]
Compatible PC:
FMV-6667ML6c Windows98SE manufactured by Fujitsu Limited
GPIB hardware:
PCI-GPIB manufactured by NATIONAL INSTRUMENTS
Standard module:
Niglobal.bas,Vbib-32.bas (Included software in PCI-GPIB)
Compatible language:
MS-EXCEL2000 VBA
Example 1 Measures the optical power in the W unit display and reads the measured data from the
8250A.
Set the GPIB address of the 8250A to 1.
Figure 4-3 Measurement Image 1 (GPIB)
Program list
Option Explicit
' All variables are clearly declared.
Sub Sample1_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, "DW1" & vbCrLf)
' Sets the measurement unit display to "W".