Specifications
SR400 with the RS-232 Interface
49
SR400 WITH THE RS-232 INTERFACE
The RS-232 is a popular serial interface standard
for bit serial communication. Despite the existence
of the standard there are many permutations of
control lines, baud rates, and data formats.
DATA COMMUNICATIONS EQUIPMENT
(DCE)
The SR400 is configured as DCE so that it may be
connected directly to a terminal or IBM PC. If the
SR400 is to be interfaced with another DCE
device, a special cable (sometimes referred to as a
'null modem' cable) is required. To use the RS-232
interface you must set the COM parameters to
match your computer's baud rate, parity, and
number of bits.
RS-232 ECHO
The RS-232 ECHO should be OFF whenever the
SR400 is interfaced with a computer. This
prevents unwanted characters from being sent
back to the computer after every command. The
echo should be ON only if a terminal (or terminal
emulator program) is being used.
WAIT COMMAND
The SR400 normally waits until the RS-232 'Clear
to Send' control line (CTS) is asserted before
sending characters. However, some computers do
not set and reset the CTS line, possibly causing the
SR400 to send data when the computer is not
ready to read it. The SR400 may be 'slowed down'
using the SW command. Sending 'SWn' causes the
unit to wait nx3.3 ms before sending each
character over the RS-232 interface. The
command SW0 sets the wait interval to zero and
results in the fastest transmission. The wait
interval is set to 6 (20 ms) on power-up reset
(STOP key held on power on).
TERMINATION SEQUENCES
The default RS-232 termination characters are
sufficient to interface with most computers,
however, it will occasionally be necessary to send
special terminating sequences to fit the
requirements of some computers. This can be done
with the SE command. The format for the
command is:
SE {n1,n2,n3,n4}
where n1, n2, n3, and n4 are decimal values
between 0 and 255 corresponding to the ASCII
codes of the desired termination characters. For
instance, if the desired termination sequence is an
asterisk, (ASCII 42), two carriage returns, (ASCII
13), and a line-feed, (ASCII 10), the appropriate
command is:
SE 42,13,13,10
If an NP command is sent requiring an answer of
100 (N PERIODS = 100), the SR400 would
respond with the string
100*<cr><cr><lf>
Up to four terminating characters may be specified
by the SE command. If no arguments are sent with
the SE command, the terminating sequence returns
to the default (echo on: <cr><lf>; echo off: <cr>).
The SE command does not affect the terminating
character (<cr>) required at the end of commands
received by the SR400. It also does not affect the
terminating sequence sent with data over the GPIB
interface.
EXAMPLE PROGRAMS
The following section lists several example
programs which use the RS-232 port to control the
SR400. All of the programs do the same thing,
only the language is different. The programs set up
the SR400 to count 10 MHz on counter A for 1
second. The counter data is read and the PORT1
output is ramped.