User`s manual
36 Using the Agilent E1330B Digital I/O Module
Chapter 3
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.
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 488selected device
clear. In BASIC this is
CLEAR 70918.
Output 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. The choice of output format is indicated by a special
character (#) in the value to be output. If the # character is not used, the
output value is assumed to be in decimal format.
Example 10 ASSIGN @Dio TO 70918
!Establish I/O path to module.
20 INTEGER Bits, Bytes, Ready
30 Bits= 1
40 Bytes = 255
50 OUTPUT @Dio;"*RST;*OPC?"
!Reset the module to establish
defaults.
60 ENTER @Dio;Ready
!Wait for completion.
70 OUTPUT@Dio;"DIG:DATA0:BIT5 "&VAL$(Bits)&";*OPC?"
!Set port 0 bit 5 true.
80 ENTER @Dio;Ready
!Wait for completion.
90 OUTPUT@Dio;"DIG:DATA1 "&VAL$(Bytes)&";*OPC?"
!Output a byte on port 1.
100 ENTER @Dio;Ready
!Wait for completion.
110 END
This example sets bit 5 on port 0 to a logical true value (with the default
polarity established, the data line is set to TTL high). The example then sets
all the data lines on port 1 to TTL high. Port 0, bit 5 and port 1 data lines will
remain in the TTL high condition until another output command or input
command at the same port is received.