EXTERNAL CAVITY TUNABLE LD LIGHT SOURCE ECL-210
9-3
9.2. RS-232C Program
The following program provides an example of the use of the Control Commands for RS-232C
communication. The program is written in Visual Basic and has an input function to set the
wavelength of an ECL-210 unit placed in slot A of a MLS rack, and an output function to read the
current optical ouput power and the target optical output power of the same ECL-210 unit. The
communications port in this example is Com1 and requires the ActiveX MSComm component to be
included in the 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 ActualPower_dBm As String * 30
‘Dimensions array as
string of length 30
Dim TargetPower_dBm As String * 30
‘Dimensions array as
string of length 30
‘Set Wavelength Subroutine
‘Comment
ans = InputBox(“Required Wavelength (nm)”)
‘Ask user for required
wavelength value
Form1.MSComm1.PortOpen = True
‘
Open Port MSComm1 in Form1
of program
Form1.MSComm1.Output = “A:WA” + ans + Chr$(&HD)
‘
Send value of wavelength to
Com port with CR delimiter.
Form1.MSComm1.PortOpen = False
‘
Close Port MSComm1 in Form1
End Sub
‘End Subroutine
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com