3-31
3
The FORMat command lets the user select how the data is represented.
Byte data values can be decimal numbers (0-255) or hex numbers (#h0-
#hFF). Data string characters can be decimal values for each byte separated
by commas, HEX numbers separated by commas or a HEX character string.
Some examples are:
128,03,174
'decimal for three bytes
80,03,AE
'HEXL for same three bytes
8003AE
'HEX for same three bytes
It is a good idea to include all of the configuration commands or start with
the known settings from the CAL:DEFAULT command when configuring
a unit in case a different configuration was stored in the unit's Flash
memory.
3.8.2
Outputting to Individual Ports
Output ports (bytes) are controlled with the SCPI SOURCE subsystem. The
SOURce:DATA:PORTn command sets the byte as an output byte and the
output lines to a high or low state when the port is written to. The :POLarity
command configures the output polarity on a bit-by-bit basis. Polarity must
be programmed before the data is outputted.
Example source commands for Figure 3-2 are:
SOURce:DATA:PORT4:POLarity #h0
'sets Port 4 to low true polarity
SOURce:DATA:PORT4 63
'selects byte 4 for output and sets bits 0-5 low.
The data can also be expressed in hex format which is often easier to use
when setting specific bits. e.g.
SOURce:DATA:PORT4 #h3F
'sets bits 0-5 low.
3.8.3
Configuring the Listen String (Digital Outputs)
The SCPI CONFIGURE and FORMAT subsystems are used to configure
bytes as outputs before outputting data in a string format. The
FORMat:LISTen command provides the user with three formats for
outputting data. ASCii lets the user send the byte output value as decimal