95x Series Operating Manual - May 17, 2022
Page
150
of
155
? Response Fields for details regarding the response.
PROGRAMMING GUIDELINES
AVOID INTERFACE SPECIFIC METHODS
The 95x can be interfaced to with RS232, GPIB or Ethernet interfaces. It is recommended that the programmer not
use interface specific methods, e.g., serial polling over GPIB, to ease the migration between interfaces at a later
date. Similarly, it is recommended to always terminate commands with either the <CR> or <LF> characters (or
both) rather than using the GPIB specific EOI or GET methods. The command set and response formats are
identical between interfaces, so migration between interfaces is simple if this guideline is followed.
START BY INITIALIZING THE 95X
When a user application is started on the controlling computer the status of the 95x is unknown, it may have a
response waiting to be read, it may have a partial command in its input buffer. It is recommended that the user
always perform an interface clear when the application is started to ensure that there are no pending or partially
programmed activities in the 95x. This can be achieved by sending the
*RST
command.
EMPLOY A TIMEOUT ON ALL ACTIVITIES
On all interfaces, the 95x has full handshake capabilities, so both commands and responses can be held up for
short periods of time. The user must employ timeouts for both transmit and receive operations and take any
desired corrective action should a timeout occur.
FULLY CONFIGURE THE 95X
If there are any configuration settings in the 95x which are relied upon by the programmer, then these should be
explicitly set by the user application when it is first started. Commands are provided to set the 95x configuration
settings.
CHECKING FOR ERRORS
Often the user wishes to ensure that a command was correctly received by the 95x and that the command was not
rejected by the 95x. This is easily achieved by always sending the
*ERR?
command after sending any non-query
command, waiting for the response,
and checking that it is “0”. There are other registers which could be used also,
but the ERR register provides the most information regarding the nature of the error.
For example
–
BEEP,START,2<CR><LF>
*ERR?
<CR><LF>
This would cause the response to be
0
<CR><LF>
As another example
–
BEEP,START,9;*ERR?<CR><LF>
This w
ould not function as expected. The “9” field in the BEEP command is in error, which makes the 95x reject
the entire set of commands. This should be
–
BEEP,START,9<CR><LF>
*ERR?
<CR><LF>
This would cause the response to be
5
<CR><LF>