6-2
Remote Programming
computer is ready to receive. If either buffer over-
flows, both buffers are cleared and an error
reported.
The present value of a particular parameter may
be determined by querying the SR850 for its
value. A query is formed by appending a question
mark "?" to the command mnemonic and omitting
the desired parameter from the command. Values
returned by the SR850 are sent as a string of
ASCII characters terminated by a carriage return
<cr> on RS232 and by a line-feed <lf> on GPIB. If
multiple queries are sent on one command line
(separated by semicolons, of course) the answers
will be returned individually, each with a
terminator.
Examples of Command Formats
FMOD 0<lf> Set reference source to
internal
FREQ 10E3 <lf> Set the internal reference fre-
quency to 10000 Hz (10 kHz)
❊IDN? <lf> Queries the device
identification
STRT <lf> Starts data acquisition (same
as [START] key)
OUTP? 1 <lf> Queries the value of X
INTERFACE READY AND STATUS
The Interface Ready bit (bit 1) in the Serial Poll
Status Byte signals that the SR850 is ready to
receive and execute a command. When a com-
mand is received, this bit is cleared indicating that
an operation is in progress. While the operation is
in progress, no other commands will be pro-
cessed. Commands received during this time are
stored in the buffer to be processed later. Only
GPIB serial polling will generate a response while
a command is in progress. When the command
execution terminates, the Interface Ready bit is set
again and new commands will be processed.
Since most commands execute very quickly, the
host computer does not need to continually check
the Interface Ready bit. Commands may be sent
one after another and they will be processed
immediately.
However, some commands, such as file com-
mands and math operations, may require a long
time to execute. In addition, the host program may
need to check that these operations executed
without error. In these cases, after the command is
sent, the Status Bytes should be queried.
When using the GPIB interface, serial polling may
be used to check the Interface Ready bit in the
Serial Poll Byte while an operation is in progress.
After the Interface Ready bit becomes set, signal-
ling the completion of the command, then the ERR
or ESB bit may be checked to verify successful
completion of the command.
If the RS232 interface is used, or serial polling is
not available, then the ❊STB?, ❊ESR?, ERRS?,
and LIAS? status query commands may be used
to query the Status Bytes. Since the SR850 pro-
cesses one command at a time, the status query
will not be processed until the previous operation
is finished. Thus a response to the status query in
itself signals that the previous command is fin-
ished. The query response may then be checked
for various errors.
For example, the command line SDAT;ERRS?
<lf> will save the data to disk and return the Error
Status Byte when finished. The Disk Error bit (bit
3) may be checked to make sure that the Save
Data (SDAT) command terminated without error.
Since the Save Data command may take a long
time to execute, it is important that the host com-
puter interface does not time out while waiting for
the response to the ERRS? query. In the case
where the host interface times out before the
ERRS? response, the host program must wait
before sending the ERRS? query.
GET (GROUP EXECUTE TRIGGER)
The GPIB interface command GET is the same as
the TRIG command. GET is the same as a trigger
input. GET only has an effect if the sampling rate
is triggered or if triggers start a scan.