Operating and Maintenance Instructions – 28
INPUT #2, sr
' read status register
PRINT sr
' verify SRQ bit is set
PRINT #1, "SPOLL 05"
' serial poll again to verify SRQ bit is cleared
INPUT #2, sr
' read status register
PRINT sr
RETURN
RS232 Interface Programming Example
This section provides a programming example for controlling the TB9 grating filter over the
RS232 interface. The sample was written in MS-DOS Qbasic and run on a personal computer,
equipped with a serial port. The COM 2 port of the computer must be designated as the serial
port and must be connected to the TB9 grating filter.
The RS232 command that appears in this section does not show the terminating character
<CR>; however, it is implied.
The RS232C interface cannot receive an SRQ interrupt.
OPEN "com2:1200,n,8,1" FOR RANDOM AS #1
CLS
' clear unit
PRINT #1, "clr"
' identify unit
PRINT #1, "idn?"
INPUT #1
PRINT a$
' set unit to 1550 nm
PRINT #1, "wvl 1550 nm"
' fetch status
PRINT #1, "wvl?"
INPUT #1, wvl
PRINT #1, "xdr?"
INPUT #1, xdr
PRINT #1, "stb?"
INPUT #1, stb
PRINT #1, "sre?"
INPUT #1, sre
PRINT #1, "err?"
INPUT #1, err
PRINT #1, "lerr?"
INPUT #1, lerr
' print status
PRINT wvl,xdr,stb,sre,err,lerr
CLOSE
END
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com