OPTICAL TUNABLE FILTER OTF-920
9-1
9
Example Programs
9.1. GPIB Program
‘Set Wavelength Routine
‘Subroutine description
Private Sub Wavelength_Set()
‘Sets routine name to
Wavelength_Set
‘Define Variables
‘Comment
Dim ans As String * 30
‘Dimensions ans array as
String of length 30
Dim otf920 As Integer
‘Dimensions otf920 as
integer
Dim otf920a As Integer
‘Dimensions otf920a as
integer for error checking
‘Initialise Device
‘Comment
Call SendIFC(0)
‘Initialise GPIB interface
Call ibdev(0, 1, 0, T10s, 0, 0, otf920)
‘Open and initialise device
Call ibln(otf920, 1, 0, otf920a)
‘Check for device presence
(error checking)
gpib_dl$ = Chr$(13) + Chr$(10)
‘Set Cr/Lf as delimitter
‘Set Wavelength Subroutine
‘Comment
ans = InputBox(“Required Wavelength (nm)”)
‘Ask user for required
wavelength value
Call ibwrt(otf920, “WA” + ans + gpib_dl$)
‘Set wavelength to value
defined by user input
End Sub
‘End subroutine
The following program provides an example of the use of the Control Commands for GPIB
communication. The program is written in Visual Basic and has an input function to set the wavelength
and an output function to read the Optical Power.
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com