Programming Guide – 31
Table 7: RS232 Functions
Name
Symbol
Pin Number
Signal Direction
transmitted data
TxD
2
out
received data
RxD
3
in
request to send
RTS
8
out
clear to send
CTS
7
in
data terminal ready
DTR
6
out
signal ground
SG
5
—
The data protocol is permanently set to 1200 baud, ASCII character code with eight bits per
character, one stop bit, and no parity bit. The serial port of the controlling computer must be
configured with the same settings.
RS232 Programming Examples
This section provides programming examples for controlling the attenuator over the RS232
interface. The examples were written in MS-DOS
4
Qbasic and run on a personal computer
equipped with a serial port. COM port 2 of the computer must be designated as the serial port
and must be connected to the attenuator.
Before using any of these examples, ensure that the active interface command set is HA9.
The RS232 interface cannot receive an SRQ interrupt.
The RS232 commands that appear in this section do not always show the terminating
sequence; however, it is implied.
Sending Commands
This example sets the wavelength to 1300 nm and the attenuation to 20 dB. These commands
demonstrate the use of a variable in the statement that sends the attenuation command.
OPEN "COM2:1200,N,8,1” FOR RANDOM AS #3
PRINT#3, "WVL 1300e-9 m"
atten=20
PRINT#3, "ATT ";atten;" dB"
END
4
MS-DOS is a registered trademark id Microsoft Corporation.
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com