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:DATA
n 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:DATA
n
[:type]:BIT
m
<
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
D
n
-7
D
n
-6
D
n
-5
D
n
-4
D
n
-3
D
n
-2
D
n
-1
D
n
-0
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
MSB
LSB
Содержание E1330B
Страница 2: ......
Страница 10: ...8 Notes ...
Страница 11: ...9 Notes ...
Страница 12: ...10 Notes ...
Страница 25: ...Configuring the Agilent E1330B Digital I O Module 23 Chapter 2 Figure 2 6 J1 and J2 Connector Pinouts ...
Страница 32: ...30 Configuring the Agilent E1330B Digital I O Chapter 2 Notes ...
Страница 42: ...40 Using the Agilent E1330B Digital I O Module Chapter 3 Notes ...
Страница 58: ...56 Understanding the Agilent E1330B Digital I O Module Chapter 4 Notes ...
Страница 104: ...102 Agilent E1330B Digital I O Module Command Reference Chapter 5 Notes ...
Страница 146: ...144 Error Messages Appendix C Notes ...