3-32
3
numbers from 0 to 255 separated by commas. HEXL is similar but it uses
two HEX characters for each byte separated by commas. HEX is the same
as HEXL but without the commas between bytes. The following example
shows the three formats being used to output 24 bits of data (0000 0001 0001
0111 1111 1110):
Format
Sequence
ASCii
1,23, 254
HEXL
01,17,FE
HEX
0117FE
Byte 4 in Figure 3-2 could be configured and written to by a string
command. The example configure and format commands are:
CONFigure:OUTput (@ 4)
'sets byte 4 as an output byte
CONFigure:OUTput:POL 0
'low true data
FORMat:LISTen HEX
'selects HEX coded data:
SOURce:DATA 3F <nl>
'sets bits to 1100 0000
3.8.4
Reading Individual Ports
Input ports (bytes) are read with the SCPI SENSE subsystem. The
SENSe:DATA:PORTn? command automatically sets the byte for inputting
data and tristates the input lines when the port is read. The :POLarity
command configures the input polarity on a bit-by-bit basis. Polarity must
be programmed before data is read. In the example cable, the input bits are
all high true. The example sense commands for Figure 3-2 are:
SENSe:DATA:PORT1:POLarity #hFF 'sets all bits high true
SENSe:DATA:PORT1?
'reads byte 1
3.8.5
Configuring for a Talk String (Digital Inputs)
The SCPI CONFIGURE and FORMAT subsystems are used to configure
the digital interface for an input string before inputting data. In Figure 3-
2, bytes 2 and 3 are used to input 16 bits of data as BCD/HEX characters
from a digital panel meter (DPM). The DPM has a 2 1/2 digit output with
a polarity signal and a conversion done signals Note:-If the DPM output is
not latched, it should be read until two successive readings have the same
valid results. The configuration commands are: