User`s manual

Understanding the Agilent E1330B Digital I/O Module 51
Chapter 4
(POSitive polarity) if all data lines are at a TTL low level, the returned value
will be
0; if all lines are at a TTL high level, the returned value will be 255.
For example, the following BASIC program code will request and display
the decimal value of the data lines on port 2.
120 OUTPUT @Dio;"MEAS:DIG:DATA2?"
130 ENTER @Dio;Result
140 DISP "Decimal value of port 2 data lines ";Result
Port numbers range from 0 to 3 for single port operations. The section
“Multiple Port Operations” beginning on page 53 describes port numbering
for multiple port operations. For a single port, the returned decimal value
will have the following correspondence to the port data lines:
Outputting Data Bytes and Bits
Data output is performed using the commands in SCPI
[SOURce:]DIGital:DATAn subsystem. The TTL levels of an output will
depend upon the POLarity programmed for the port.
Output operations can involve single bits, 8-bit bytes, or multiple bytes.
Single bit output operations always expect a value of 0 or 1. Byte or
multiple byte output operations can accept numbers in decimal,
hexadecimal, octal, or binary formats.
Both Input and Output operations will attempt to complete the handshake
mode set for the port and may "hang" if required handshake operations are
not completed. To unhang a hung transfer issue a IEEE 488 selected device
clear. In BASIC this is
CLEAR 70918.
Bit Output The SCPI command for setting the state of a single bit on a data port is:
[SOURce:]DIGital:DATAn[:type]:BITm <value>
This command instructs the Digital I/O module to set bit m on port n to
<value>, using the output handshake. The actual TTL level set on the
corresponding data line depends upon the programmed state of the port
polarity. If
<value> is 1 and the default polarity (POSitive polarity) is used,
the data line corresponding to bit m will be set to a TTL high level. For
example, the following BASIC program code will set the state of data line 2
(bit-2) on port 3 to a value of 1.
120 OUTPUT @Dio;"DIG:DATA3:BIT2 1"
Bit numbers range from 0 to 7 for single port operations. For multiple port
operations, bit numbers can range from 0 to 31. The section “Multiple Port
Operations” beginning on page 53 describes bit numbering for multiple port
Dn-7 Dn-6 Dn-5 Dn-4 Dn-3 Dn-2 Dn-1 Dn-0
Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
MSB LSB