3-29
3
3.8
PROGRAMMING GUIDELINES
This section shows the user how to program the unit. Examples include how
to configure the digital interface, how to transfer data, how to use the IEEE-
488.2 Status Reporting Structure to generate Service Requests, how to
control and read analog values, reading temperatures, setting the IDN
message and how to save and lock the configuration. The example
statements in this section are language independent commands so they can
be easily inserted into your favorite programming language. The SCPI
commands used in these examples can be shortened to their abbreviated
form or they can be replaced with the equivalent short form commands. The
examples refer to the 4807/4867 but apply equally to the 23072367 except
where noted. All settings must be saved with the *SAV 0 command or they
will be lost when power is turned off.
Paragraph 3.8.1 describes how to transfer digital data. Paragraphs 3.8.2
through 3.8.16 describe how to control and configure the unit. Some of the
program examples show how to program the example application shown in
Figure 3-2. This is not meant to limit the user to the data formats shown,
but rather to illustrate of some of the unit's capabilities. Before you start,
read section 2.11 to learn how the example is connected to the unit.
3.8.1
General Data Transfer Methods
The units transfers data between the GPIB bus or the serial interface and the
32 digital I/O lines as command parameters.
SENSe and SOURce command branches give the user two ways of
transferring data to or from the digital interface. The PORTn commands
pass data to or from a specific port (or byte). These are the easiest data
transfer commands to use as they do not require configuring the input or
output ports (bytes). The ports are configured as inputs or outputs when the
command is executed. Examples are:
SOURC:DATA:PORT4 #h12
'updates the LED display
SENS:DATA:PORT1?
'reads push-button in byte 1
The PORT and VALue commands can pass strings of one or multiple bytes
to bytes configured as outputs or from bytes configured as inputs. These
commands use the CONFigure and FORMat settings to define how the
commands work. Some examples are: