8250A Optical Power Meter Operation Manual
4.7.2 USB Sample Programs
4-44
MsgBox "USB end error", vbExclamation
End If
End Sub
Sub Data acquisition_Acquire()
' Registers the subroutine for the ENTER button on the sheet.
enterF = 1
' Sets the flag of the ENTER input button to ON.
End Sub
Example 2 Acquires the measured data from the connected two set of the 8250A.
Set USB.ID of each 8250A to 1 and 2.
Figure 4-6 Measurement Image 2 (USB)
Program list
Option Explicit
' All variables are clearly declared.
Private Const OK As Integer = 0
' Definition of "OK"
Sub Two sets of the 8250A control_Start()
' Registers the subroutine for the START button on the sheet.
Dim OPM1 As Long
' USB handle
Dim OPM2 As Long
' USB handle
Dim USB_ID1 As Long
' USB_ID which is set in OPM1
Dim USB_ID2 As Long
' USB_ID which is set in OPM2
Dim ret As Long
' Driver return value
Dim siz As Long
' Number of characters of the received data
Dim rstr As String
' Receiving buffer of the measured data
USB_ID1 = 1
' Sets USB_ID to 1.
USB_ID2 = 2
' Sets USB_ID to 2.
ret = ausb_start(10)
' USB initialization, time-out: 10 seconds
If ret <> OK Then
' If the USB initialization is performed incorrectly,
MsgBox "USB initialization error", vbExclamation
GoTo err_exit
End If
Call mSecSleep(100)
' Waits for the USB initialization (100 ms).
ret = ausb_open(OPM1, USB_ID1)
' Opens the OPM whose USB_ID is set to 1 and acquires the USB
' handle.