19
SR530 Guide to
Programming
The SR530 Lock-in Amplifier is remotely
programmable via both RS232 and GPIB
interfaces. It may be used with laboratory
computers or simply with a terminal. All front
panel features (except signal input selection and
power) may be controlled and read via the
computer interfaces. The SR530 can also read
the analog outputs of other laboratory instruments
using its four general purpose analog input ports.
There are also two programmable analog output
ports available to provide general purpose control
voltages.
Communicating with the SR530
Before using either the RS232 or GPIB interface,
the appropriate configuration switches need to be
set. There are two banks of 8 switches, SW1 and
SW2, located on the rear panel. SW1 sets the
GPIB address and SW2 sets the RS232
parameters. The configuration switches are read
continuously and any changes will be effective
immediately. For details on switch settings, see
page 7 at the front of this manual.
Command Syntax
Communications with the SR530 use ASCII
characters. Commands to the SR530 may be in
either UPPER or lower case.
A command to the SR530 consists of one or two
command letters, arguments or parameters if
necessary, and an ASCII carriage return (<cr>) or
line-feed (<lf>) or both. The different parts of the
command do not need to be separated by spaces.
If spaces are included, they will be ignored. If
more than one parameter is required by a
command, the parameters must be separated by
a comma. Examples of commands are:
G 5 <cr> set the sensitivity to 200 nV
T 1,4 <cr> set the pre filter to 30 mS
F <cr> read the reference frequency
P 45.10 <cr> set phase shift to 45.10¡
X 5,-1.23E-1 <cr> set port X5 to -0.123 V
Multiple commands may be sent on a single line.
The commands must be separated by a semicolon
(;) character. The commands will not be executed
until the terminating carriage return is sent.
An example of a multiple command is:
G 5; T 1,4; P 45.10 <cr>
It is not necessary to wait between commands.
The SR530 has a command input buffer of 256
characters and processes the commands in the
order received. Likewise, the SR530 has an
output buffer (for each interface) of 256
characters.
In general, if a command is sent without
parameters, it is interpreted as a request to read
the status of the associated function or setting.
Values returned by the SR530 are sent as a string
of ASCII characters terminated usually by carriage
return, line-feed. For example, after the above
command is sent, the following read commands
would generate the responses shown below.
Command Response from the SR530
G <cr> 5<cr><lf>
T 1 <cr> 4<cr><lf>
P <cr> 45.10<cr><lf>
The choice of terminating characters sent by the
SR530 is determined by which interface is being
used and whether the 'echo' feature is in use. The
terminating sequence for the GPIB interface is
always <cr><lf> (with EOI). The default sequence
for RS232 is <cr> when the echo mode is off, and
<cr><lf> when the echo mode is on. The
terminating sequence for the RS232 interface may
be changed using the J command.
Note that the terminating characters are sent with
each value returned by the SR530. Thus, the
response to the command string G;T1;P<cr> while
using the RS232 non-echo mode would be
5<cr>4<cr>45.10<cr>.
Front Panel Status LED's
The ACT LED flashes whenever the SR530 is
sending or receiving characters over the computer
interfaces.
The ERR LED flashes whenever an error has
occurred, such as, an illegal command has been
received, a parameter is out of range, or a
communication buffer has exceeded 240
characters. This LED flashes for about three
seconds on power-up if the battery voltage is
insufficient to retain previous instrument settings.