Index ..............................................................................................................................145
Certification
Hewlett-Packard Company certifies that this product met its published specifications at the time of shipment from the factory. HewlettPackard further certifies that its calibration measurements are traceable to the United States National Institute of Standards and
Technology (formerly National Bureau of Standards), to the extent allowed by that organization’s calibration facility, and to the
calibration facilities of other International Standards Organization members.
Warranty
This Hewlett-Packard product is warranted against defects in materials and workmanship for a period of three years from date of shipment.
Duration and conditio ns of wa rrant y for this p roduc t may be su perseded when th e pro duct is in tegrate d in to (bec omes a part of) other HP
products. During the warranty period, Hewlett-Packard Company will, at its option, either repair or replace products which prove to be
defective.
For warranty service or repai r, this produc t must be return ed to a service facility design ated by Hewlett-Pa ckard (HP). Bu yer sha ll prep ay
shipping charges to HP and HP shall pay shipping charges to return the product to Buyer. However, Buyer shall pay all shipping charges,
duties, and taxes for products returned to HP from another country
HP warrants that its software and firmware designated by HP for use with a product will execute its programming instructions when
properly installed on that product. HP does not warrant that the operation of the product, or software, or firmware will be uninterrupted
or error free.
Limitation Of Warranty
The foregoing warranty sh all not apply to defects resu lting from im proper or ina dequate ma intenance by Buyer, Bu yer-supplie d products
or interfacing, unauthorized modification or misuse, operation outside of the environmental specifications for the product, or improper
site preparation or ma intenance.
The design and implementation of any circuit on this product is the sole responsibility of the Buyer. HP does not warrant the Buyer’s
circuitry or malfunctions of HP products that result from the Buyer’s circuitry. In addition, HP does not warrant any damage t hat occurs
as a result of the Buyer’s circuit or any defects that result from Buyer-supplied products.
NO OTHER WARRANTY IS EXPRESSED OR IMPLIED. HP SPECIFICALLY DISCLAIMS THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
Exclusive Remedies
THE REMEDIES PROVIDED HEREIN ARE BUYER’S SOLE AND EXCLUSIVE REMEDIES. HP SHALL NOT BE LIABLE FOR
ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER BASED ON CONTRACT,
TORT, OR ANY OTHER LEGAL THEORY.
Notice
The information contained in this document is subject to change without notice. HEWLETT-PACKARD (HP) MAKES NO
WARRANTY OF ANY KIND WITH REGARD TO THIS MATERIAL, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. HP shall not be liable for errors
contained herein or for incidental or consequential damages in connection with the furnishing, perf ormance or use of this material. This
document contains proprietary information which is protected by copyright. All rights are reserved. No part of this document may be
photocopied, reproduced, or translated to another language without the prior written consent of Hewlett-Packard Company. HP assumes
no responsibility for the use or reliability of its software on equipment that is not furnished by HP.
U.S. Government Restricted Rights
The Software and Documentation have been developed entirely at private expense. They are delivered and licensed as "commercial
computer software" as defined in DFARS 252.227- 7013 (Oct 1988), DFARS 252.211-7015 (May 1991) or DFARS 252.227-7014 (Jun
1995), as a "commercial item" as defined in FAR 2.101(a), or as "Restricted computer software" as defined in FAR 52.227-19 (Jun
1987)(or any equivalent agency regulation or contract clause), whichever is applicable. You have only those rights provided for such
Software and Documentation by the applicable FAR or DFARS clause or the HP standard software agreement for the product involved
All Editions and Updates o f this manu al and t heir cre ation da te are li sted belo w. The first Edi tion o f the m anual i s Edition 1. The Edition
number increments by 1 whenever the manual is revised. Updates, which are issued between Editions, contain replacement pages to
correct or add additional information to the current Edition of the manual. Whenever a new Edition is created, it will contain all of the
Update information for the previous Edi tion. Each ne w Edition or Upd ate also incl udes a revised copy of this d ocumentation h istory page.
Instruction manual symbol affixed to
product. Indicates that the user must refer to
product. Indicates that the user must refer to
the manual for specific WARNING or
the manual for specific WARNING or
CAUTION information to avoid personal
CAUTION information to avoid personal
injury or damage to the product.
injury or damage to the product.
Indicates the field wiring terminal that must
be connected to earth ground before
operating the equipme nt—protects against
electrical shock in case of fault.
WARNING
Alternating current (AC)
Direct current (DC).
Indicates hazardous voltages.
Calls attention to a procedure, practice , or
condition that could cause bodily injury or
death.
or
Frame or chassis ground terminal—typically
connects to the equipment' s metal frame.
CAUTION
Calls attention to a procedure, practice , or
condition that could p ossibly cause damage to
equipment or permane nt loss of data.
WARNINGS
The following genera l safety precautions must be observed during all phas es of operation, service, and re pair of this product. Failure to
comply with these precautions or with specific warnings elsewhere in this manual violates safety standards of design, manufacture, and
intended use of the product. Hewlett-Packar d Company assumes no liabilit y for the customer's failu re to comply with these requirements.
Ground the equipment: For Safety Class 1 equipment (equipment having a protective earth terminal), an uninterruptible safety earth
ground must be provided from the mains power source t o the product input wiring terminals or supplied power cable.
DO NOT operate the product in an explosive atmosphere or in the presence of flammable gases or fumes.
For continued protection against fire, replace the line fuse(s) only with fuse(s) of the same voltage and current rating and type. DO NOT
use repaired fuses or short-circuited fuse holders.
Keep away from live circuits: Operating personnel must not remove equipment covers or shields. Procedures involving the removal of
covers or shields are for use by service-trained personnel only. Under cer tain conditions, dangerous voltages may exist even w ith the
equipment swi tched off . To avoid da ngerous el ectrica l shock, DO N OT perform procedure s involvin g cover or sh ield remova l unless you
are qualified to do so.
DO NOT operate damaged equipmen t: Whenever it is possible that the safety protection features built into this product have been
impaired, either through physical damage, excessive moisture, or any other reason, REMOVE POWER and do not use the product until
safe operation can be verified by service-trained personnel. If necessary, return the product to a Hewlett-Packard Sales and Service Office
for service and repair to ensure that safety features are maintained.
DO NOT service or adjust alone: Do not attempt internal service or adjustment unless another person, capable of rendering first aid and
resuscitation, is present.
DO NOT substitute parts or modify equipment: Because of the dange r of introd ucing addi tional h azards, do not install substitute parts
or perform any unauthorized mod ification to the product. Return the product t o a Hewl ett-Packard Sales and Service Office for service
and repair to ensure that safety features are maintained.
6
Declaration of Conformity
according to ISO/IEC Guide 22 and EN 45014
Manufacturer’s Name:Hewlett-Packard Company
Loveland Manufacturing Center
Manufacturer’s Address:815 14th Street S.W.
Loveland, Colorado 80537
declares, that the product:
Product Name:Quad 8-Bit Digital I/O Module
Model Number:HP E1330B
Product Options:All
conforms to the following Product Specifications:
Safety:IEC 1010-1 (1990) Incl. Amend 1 (1992)/EN61010-1 (1993)
CSA C22.2 #1010.1 (1992)
UL 1244
EMC: CISPR 11:1990/EN55011 (1991): Group 1 Class A
EN50082-1:1992
IEC 801-2:1991: 4kVCD, 8kVAD
IEC 801-3:1984: 3 V/m
IEC 801-4:1988: 1kV Power Line, .5kV Signal Lines
Supplementary Information: The product herewith complies with the requirements of the Low Voltage Directive
73/23/EEC and the EMC Directive 89/336/EEC (inclusive 93/68/EEC) and carries the "CE" marking acco rdingly.
Tested in a typical configuration in an HP B-Size VXI mainframe.
June 15, 1995
European contact: Your local Hewlett-Packard Sales and Service Office or Hewlett-Packard GmbH, Depart-
ment HQ-TRE, Herrenberger Straße 130, D-71034 Böblingen, Germany (FAX +49-7031-14-3143)
Jim White, QA Manager
7
Notes:
8
Pl
ease fold and tape for ma
ili
ng
Reader Comment Sheet
HP E1330B Quad 8-Bit Digital I/O User’s Manual
Edition 7
You can help us improve our manuals by sharing your comments and sug gestions . In appreciation of your time, we will
enter you in a quarterly drawing for a Hewlett-Packard Palmtop Personal Computer (U.S. government employees
are not eligible for the drawing).
Your Name
Company Name
Job Title
Address
City, State/Province
Country
Zip/Postal Code
Telephone Number with Area Code
Please list the system controller, operating system, programming language, and plug-in modules you are using.
fold here
BUSINESS REPLY MAIL
FIRST CLASS PERMIT NO. 37 LOVELAND, CO
POSTAGE WILL BE PAID BY ADDRESSEE
cut along this li ne
HEWLETT-PACKARD COMPANY
Measurement Systems Division
Learning Products Department
P.O. Box 301
Loveland, CO 80539-9984
NO POSTAGE
NECESSARY
IF MAILED
IN THE
UNITED STATES
fold here
Please pencil-in one circle for each statement below: Disagree Agree
• The documentation is well organized.OOOOO
Instructions are easy to understand.OOOOO
•
The documentation is clearly written.OOOOO
•
•Examples are clear and useful.OOOOO
Illustrations are clear and helpful.OOOOO
•
The documentation meets my overall expectations.OOOOO
•
Please write any comments or suggestions below–be specific.
Using This Chapter
This chapter describes the Quad 8-bit Digital I/O Module and how to
program the Module using SCPI (Standard Commands for Programmable
Instruments) commands. This chapter contains the following sections:
The HP E1330B Quad 8-Bit Digital I/O Module (referred to as the Digital
I/O module) is a four port digital input/output module intended for data
communication and digital control in electronic environments. The Digital
I/O module is compatible with TTL levels (0-5V) or CMOS levels (using
external pull-ups). The Digital I/O module complies wi th VXIbus (VMEbus
Extensions for Instrumentation) definitions for the P1 bus connector on
B-sized modules. A jumper on the module sets the VXIbus interrupt level.
Chapter 1
Getting Started
Figure 1-1. HP E1330B Digital I/O Module
Getting Started 11Chapter 1
Each port is identical and con si st s of 6 cont ro l lines and 8 data lines. There
are 7 registers for control and status on each port. In addition, the module
also has Manufacturer ID, Device Type, and Module Status/Control
Registers. Figure 1-1 shows the locations of the ports and a simplified
diagram of a single port. Of the seven control lines, three (I/O
FLG) are used with SCPI commands and three (RES
, STS, and PIR) are
, CTL, and
controlled through register access. Chapter 4 — “Understanding the
HP E1330B Digital I/O Module” contains detailed descriptions of these
lines.
Each port has two sets of hardware configuration jumpers. One set of
jumpers allows you to connect th e FLG lines together for multi-port dat a
transmission. Another jumper selects either open collector operation or
internal pull-up to TTL compatible levels on the data lines. Chapter 2 —
“Configuring the HP E1330B Digital I/O Module” describes how to set
these jumpers.
SCPI commands provided for the Digital I/O allow opera tion on a singl e bit,
8-bit "BYTE" format, 16-bit "WORD" format (using 2 ports), or 32-bit
"LWORd" format (using 4 ports).
Figure 1-1 shows the mapping of bit numbers from the 8-bit ports to the
16- or 32-bit ports. Chapter 5 — “HP E1330B Digital I/O Command
Reference” describes each command in detail and Chapter 3 — “Using the
HP E1330B Digital I/O Module” gives examples of the use of SCPI
commands.
Table 1-1. Data Lines
8-bit (BYTE) Operations
Port #0123
Bit designations7------07------07------07------0
16-bit (WORD) Operations
Port #02
Bit designations15------87------015------87------0
32-bit (LWORd) Operations
Port #0
Bit designations31------2423------1615------87------0
Two 3-meter, 60-wire ribbon cabl es with an insulation displacement hea der
connector (ribbon cable c onnector) on o ne end a re incl uded with the Dig ital
I/O module. Additional cable sets can be ordered (HP part number
E1330-61601) from your nearest Hewlett-Packard Sales Office.
12Getting Started Chapter 1
Instrument Definition
Each Digital I/O module installed in an HP mainframe is treated as an
independent instrument; having a unique secondary HP-IB address. Each
instrument is also assig ned a dedicated error queue, inpu t and output buffers,
status registers and, if ap plicable, dedicated mainframe memory space for
readings or data. Multiple Digital I/O modules cannot be combined into a
single instrument.
Downloading SCPI Drivers
The HP Digital I/O Driver allows the HP E1330B module to operate with
either B-size mainframes or HP E1405/06 Command Modules in a C-size
mainframe. The driver implements the Stan dard Commands for
Programmable Instrumentation (SCPI) command language. The B-size
HP E1300/E1301 Mainframe has a bui lt in driver, or can use a downloa dable
driver. The two driver s are slightl y differ ent and the diff erences are de tailed
in Chapter 5 — “HP E1330B Digital I/O Command Reference”.
To use the HP E1330B with a C- size mainframe and command module, you
must use a downloadable driver. The downloadable driver name for the
Digital I/O module is “DIG_IO”. The procedure for downloading the drivers
is contained in the HP E1405B and HP E1406A Command Module User Guides.
Programming the Digital I/O Module
To program the Digital I/O module us ing SCPI commands, you will nee d to
know the controller language and int erface a ddresses you will be using. See
the HP 75000 Series B or Series C Installation and Getting Started Guide
for detailed interface addressing and controller language information.
NoteThis discussion applies only to SCPI (Standard Commands for
Programmable Instruments ) programming. See Append ix B — “Digital I/O
Register Information” for details on register addressing. Do not mix SCPI
programming and direct register access.
Getting Started 13Chapter 1
SCPI Command
Format Used in This
Manual
SCPI commands can be used in either long or short form. A long form
example is:
DISPlay:MONitor ON
The same command, without the lower case letters, is the short form.
For example:
DISP:MON ON
Either the long form or th e short for m commands ca n be used to perform the
same result. The long and short forms can also be mixed within the same
program code. The commands are case insensitive, either upper or lower
case letters are accepted.
<> is a
Specifying SCPI
Commands
In the command examples shown above, the item enclosed in
parameter required to use the command, however, do not include the
brackets when sending the command. In this example, the parameter input
can be replaced with any one of the following:
allowable values of the parameters are given in Chapter 5 — “HP E1330B
Digital I/O Module Command Reference”. You must include at least one
space between the keywords and the parameter.
Some commands are shown with items enclosed in square brackets (
These are implied or optional items that do not have to be included. For
example, the complete command syntax listing for the first example is:
DISPlay:MONitor[:STATe] <0|1 or OFF|ON>
The item enclosed in brackets, [:STATe], does not have to be i ncluded for the
command to work. Complete descr ip ti ons of the SCPI command language,
syntax, parameter types, and usage are in Chapter 5 of this manual.
SCPI command s related to the Dig ital I/O module use three types of
parameters to specify a port number, a bit number, or a multiple port
combining operation. Each type is briefly described here. Descriptions and
examples of usage can be found in Chapter 3 of this manual.
0, 1, OFF, or ON. The
Specifying a PortThe Digi tal I/O module has four identical por ts numbered from 0 to 3. SCPI
commands that relate to a specific port use a specia l parameter to indicate
the port number. For example:
[]).
[SOURce:]DIGital:DATAn <value>
This command writes the parameter
portion of the
the number the last character of the
example, to set all port 2 data lines to logical zero, use the command:
[SOURce:]DIGital:DATA2 0
The value of n may vary for multiple port commands and operations. A
description of multiple port commands is on page 15.
14Getting Started Chapter 1
DATA keyword. Replace the n with the port number, making
<value> to the port specified by the n
DATA keyword without spaces. For
Specifying a BitEach of the four ports on the module has eight bi-directional data lines,
corresponding to eight programmable data bits. Some SCPI commands
allow you manipulate or read these bits individually. For example:
MEASure:DIGital:DATAn:BITm?
This command reads the state of a bit, specified by m, on port n. The result
will be either 0 or 1, indica ting the current l ogical state of the bit. Replac e m
with the desired bit number, and n with the desired port number, making
each number the last characters of the
spaces. For example, to read bit 7 on port 0, use the following command:
MEASure:DIGital:DATA0:BIT7?
For single ports, the value of m can range from 0 to 7. Some multiple port
operations and commands may allow bit numbers to range from 0 to 31.
DATA and BIT keywords without
Specifying Multiple Port
Operations
The Digital I/O modul e all o ws you to set or read mult ip le por ts or bits with
a single command. For example:
MEASure:DIGital:DATAn[:type]?
This command uses an opti onal keyword, [:type], to specify how many ports
are combined in a single re tur n ed val ue. T he l o wer cas e ke yword
[:type] is
replaced with one of a fixed set o f keywords. For exam ple, to read al l 4 ports
(all 32-bits) as a single returned value, use the command:
MEASure:DIGital:DATA0:LWORd?
Keywords are provided to allow port combin ation s of 16- or 32-bits. Us ing
multiple ports is described in more det ail in Chapter 4 of this manual.
Getting Started 15Chapter 1
Initial Operation
Use the following example t o verify init ial operati on. The example first sets
and then queries the polarity of a logical true condition on the port 0 FLG
line. The example uses an HP Ser ies 200/30 0 Computer with HP BASIC as
the programming language. The computer is connected to an HP E1301
Mainframe using the Hewlett-Packard Interface B us (HP-IB)*. The HP-IB
interface select code is 7, the HP-IB primary address is 09, and the HP-IB
secondary address (used to specify the Digital I/O module) is 18. Refer to
the B-Size Installation and Getting Started Guide for more details.
10ASSIGN @Dio TO 70918
20DIM Polarity$[3]
30OUTPUT @Dio;"*RST"
40OUTPUT @Dio;"*OPC?"
50 ENTER @Dio;Ready
60OUTPUT @Dio;"SOUR:DIG:FLAG0:POL POS;*OPC?"
70 ENTER @Dio;Ready
80OUTPUT @Dio;"SOUR:DIG:FLAG0:POL?"
90ENTER @Dio;Polarity$
100IF Polarity$ <> "POS" THEN
110DISP "Polarity Check ERROR"
120PAUSE
130ELSE
140DISP"Polarity set to "&Polarity$
150END IF
160OUTPUT @Dio;"SOUR:DIG:F LAG 0 :PO L NEG;*OPC?"
170ENTER @Dio;Ready
180OUTPUT @Dio;"SOUR:DIG:F LAG 0 :POL? "
190ENTER @Dio;Polarity$
200IF Polarity$ <> "NEG" THEN
210DISP "Polarity Check ERROR"
220PAUSE
230ELSE
240DISP"Polarity set to "&Polarity$
250END IF
260OUTPUT @Dio;"*RST"
270OUTPUT @Dio;"*OPC?"
280ENTER @Dio;Ready
290END
!Sets an I/O path to the module.
!Reset the module.
!Wait for the module to finish.
!Hold here until command is
finished.
!Set POSitive polarity.
!Wait for finish.
!Query the polarity state.
!Get the result.
!Check the result.
!Error discovered.
!Pause on error.
!Set NEGative polarity.
!Wait for finish.
!Query the polarity state.
!Get the result.
!Check the result.
!Error discovered.
!Pause on error.
!Restore the module.
!Wait for the module to finish.
* HP-IB is Hewlett-Packard’s implementation of IEEE Std 488.1-1984.
16Getting Started Chapter 1
Configuring the HP E1330B Digit a l I/O
Using This Chapter
Chapter 2
Module
This chapter shows how to configure the Digital I/O module for use in a
VXIbus mainframe, connect peripheral devices, and configure the module
for operation. Refer to Figure 2-1 for locations of jumpers and switches. This
chapter contains the following sections:
Configuring the HP E1330B Digital I/O Module 17Chapter 2
Setting the Address Switch
Refer to Figure 2-1. In the center rear of the module, next to the P1
connector, you will fi nd the logical address switch. It s factory sett ing is 144;
rockers 4 and 7 a re closed, all othe rs are open. You can select the addr ess of
the Digital I/O module to any number 0–255 (d eci mal ). The defaul t se tt ing
of the address switch is shown in Figure 2-2.
NoteTo be recognized as an instrument when you are using the Digital I/O
module in an HP E1300/1301 Mainframe or with an HP E1405 or E1406
Command Module, the logical address must be set to a multiple of 8.
Figure 2-2. Logical Address Switch Set at 144
18Configuring the HP E1330B Digital I/O Module Chapter 2
Enabling Pull-ups
NoteThe jumper in the enabled posit ion does not add an i nput pull -up res isto r to
Referring to Figure 2-1, note the pull-up enable jumpers near the middle of
each of the large ICs. The data lines of each port can be independently
configured for either passive or active pull-up to TTL high levels. The
factory-shipped condition is pull-up disabled for all ports. The data lines
may be either inputs or outputs. When the data lines are outputs, and the
jumper is in the enabl ed position, the outputs are acti vely forced high. When
the data lines are inputs, the jumper position makes no difference.
each data line, it enables a chip-internal pull-up network.
Each data line has an active resistive terminating network. The active
circuitry ensures that when power is removed from the module, the data
lines are not loaded. With power applied, the resistive terminating network
is equivalent to that shown in Figure 2-3.
Figure 2-3. Equivalent Data Line Termination
Configuring the HP E1330B Digital I/O Module 19Chapter 2
Selecting the Interrupt Line
The VXI peripheral i nterrupt bus consists o f seven lines which can car ry the
interrupt signal to th e commander. The most common li ne to be used is line
one, as this is the usual default interrupt line. Many VXIbus commanders
have a way to change the interrupt line they manage (for example, the
E1405/06 has an interrupt line allocation table). When doing direct
register-based programming, instead of using the SCPI driver, set the
interrupt line to a line that is not used by the SCPI driver. Module interrupt
priority can be established wi th these lines. In general, the higher the line
number, the higher the priority.
Referring to Figure 2-1, near the P1 connector you w ill find two sets of
jumper pins labeled X and 1 through 7 (JM15 and JM16). The Digital I/O
module is factory-shipped with the interrupt set to 1. If you need to change
the interrupt level you must move both jumpers on the blocks. Spare
jumpers, used for combining the flag (FLG) lines, are stored on the unused
ground pins of this connector when it ships from the factory.
NoteThe interrupt circuitry for the HP E1330B is implemented as release on
interrupt acknowledge (ROAK). The HP E1330B Digital I/O module will
de-assert (or release) the interrupt request line during an interrupt
acknowledge cycle.
The interrupt circuitry on the HP E1330A is implemented as release on
register access (RORA). The HP E13 30A Di gital I/O module will continu e
to assert the interrupt request line until the Port Control/Status Register on
the Digital I/O module is accessed.
Both the HP E1330A and HP E1330B may be used with the HP E1300A/
E1301A and with the HP E1405A/B and HP E1406A. If you are using
HP Compiled SCPI (i.e., HP E1570A), you must use the HP E1330B.
20Configuring the HP E1330B Digital I/O Module Chapter 2
Combining the Flag Lines
Each port contains a Flag Line, labeled FLG, that can be use d to implement
a handshake scheme with a peripheral. For single port operations, the FLG
lines can be used in the factory default setting (no flag lines combined) to
handshake with a peripheral. For multi-port operations with a single
handshake line, you can combine the flag line from multiple ports. The
combined flag lines are physically tied together. An action on any of the
combined flag lines performs that action for all combined flag lines.
Figure 2-5 shows the locations of the flag combining switches and how to
set them. Before setting any flag combine switches, you may wish to read
the discussion regarding allowable port combinations and handshaking in
Chapter 4 of this manual.
NoteWhen using FLG and CTL for handshaking on multiple port operations,
CTL is set for each port sequentially, beginning at the lowest numbered
port.
Figure 2-5. Flag Combine Switches
Configuring the HP E1330B Digital I/O Module 21Chapter 2
Digital I/O Module Peripheral Pinout
Figure 2-6 shows pinouts for the Digital I/O module connectors. Each is
compatible with easy cr imp connections to ri bbon cables for standar d digital
I/O interfacing. Figure 2-7 shows the data line location on the supplied
ribbon cables. Figure 2-8 shows ho w to connect th e cables. Deta ils about the
functioning of these pins i s covered in Chapt er 4 — “Understandin g the HP
E1330B Digital I/O Module but line names are as follows:
RES
STSStatus Line - used as an auxili ary handshake line. Input
PIRPeripheral Interrupt Line - used to si gnal a peripheral
FLGFlag Line - used to handshake data between a
CTLControl Line - used to handshake data between a
I/O
Reset Line - used to res et a peripheral. Output from the
Digital I/O module.
to the Digital I/ O module.
interrupt. Input to the Digital I/O module.
peripheral and the Digital I/O module. Controlled by
the peripheral. Input to the Dig ital I/O module.
peripheral and the Digital I/O module. Controlled by
the Digital I/O module. Output from the Digital I/O
module.
Input/Output Line - used to establish input or output
on a port. Controlled by the Digital I/O module. Input
to the Digital I/ O module.
22Configuring the HP E1330B Digital I/O Module Chapter 2
Figure 2-6. J1 and J2 Connector Pinouts
Configuring the HP E1330B Digital I/O Module 23Chapter 2
Figure 2-7. Data Line Location on Ribbon Cables
Figure 2-8. Connecting the Digital I/O Cable
24Configuring the HP E1330B Digital I/O Module Chapter 2
Configuring for Isolated Digital I/O
The two Digital I/O module per iph era l connectors, J1 and J2, each ha ve 60
pins. An industry standar d isolated di gital I/O peri pheral, like the Opto 22
16 Position Single Channel Mounting Rack, is a 50-pin connection. The
connector is either a card edge or a header connector (similar to J1 on the
Digital I/O module). For example , the Opto 22
edge connector; PB16H uses a header connector. They both have the same
pin-out for the ribbon ca ble. Both can accommodate up to 16 single chann el
I/O lines.
12 of the wires on the supplied ribbon cable are not connected. Figure 2-8
shows the ribbon cable connect ions. The method of connection to the ribbon
cable can be faci lit ated by the use of sp ecial ty f ixtures for th ese co nnecto rs,
but there is no standard for connector keys or spacing.
For the Opto 22
Pins 27–57 on the ri bbon cable, od d numbered pins on ly, correspo nd to pins
17–47 on the Opto 22
connect pins 1 and 49 on the Opto 22
Procedure1. Carefully cut lines 1-11 on the ribbon cable and line 59. A tan wire
should be the first wire on the ribbon cable after you make the cut.
rack, lines 1–10 are not used on th e peripher al conne ctor.
rack. All even numbered pins are ground. Do not
rack, PB16C, uses a card
rack connector.
2. Select the 50-pin connector you nee d, either edge connec tor or heade r
connector and attach the ribbon cable.
3. Connect the ribbon cable to the Opto 22
digital operation.
Opto 22 is a registered trademark of Opto 22, Huntington Beach, CA 92649
rack for optically isolated
Configuring the HP E1330B Digital I/O Module 25Chapter 2
Connecting to a GPIO Peripheral
The GPIO interface is a widely used standard parallel interface for
connecting computers to peri pherals. The GPIO interface may em ploy up to
32-bits of bi-directional data transfer. The Digital I/O module and the GPIO
interface have identical line definitions but different pin assignments.
Ports A-D on the GPIO are defined as ports 0-3 on the Digital I/O module.
Procedure1. Connect the ribbon cable to connector J1 and/or J2 on th e Digi ta l I/ O
module.
2. Connect the wires on the ribbon cable to the peripheral as described
in Figure 2-1 for the GPIO interface.
Figure 2-9. Typical Isolated Peripheral Hookup
26Configuring the HP E1330B Digital I/O Module Chapter 2
Table 2-1. Digital I/O Pinout to GPIO Pinout
Port 0
Digital I/OGPIO
ConnectorJ1J2ConnectorJ1J2
NamePin #Pin#NamePin#Pin#
D00
D01
D02
D03
D04
D05
D06
D07
RES0
STS0
PIR0
FLG0
CTL0
I/O0
ConnectorJ2J1ConnectorJ2J1
43
45
47
49
51
53
55
57
5
9
13
17
21
25
Port 2
Digital I/OGPIO
33
15
34
16
35
17
36
18
12
26
9
27
13
31
D10
D11
D12
D13
D14
D15
D16
D17
RES1
STS1
PIR1
FLG1
CTL1
I/O1
Port 1
Digital I/OGPIO
27
29
31
33
35
37
39
41
3
7
11
15
19
23
Port 3
Digital I/OGPIO
22
21
20
19
29
25
30
11
4
3
2
1
8
7
NamePin #Pin#NamePin#Pin#
D20
D21
D22
D23
D24
D25
D26
D27
RES2
STS2
PIR2
FLG2
CTL2
I/O2
For the Digital I/O connectors, all even numbered pins are ground.
For the GPIO connector, pins 5, 6, 10, 14, 23, 24, 28 and 32 are ground.
43
45
47
49
51
53
55
57
13
17
21
25
33
15
34
16
35
17
36
18
5
9
12
26
9
27
13
31
D30
D31
D32
D33
D34
D35
D36
D37
RES3
STS3
PIR3
FLG3
CTL3
I/O3
27
29
31
33
35
37
39
41
11
15
19
23
4
22
3
21
2
20
1
19
3
7
29
8
25
7
30
11
Configuring the HP E1330B Digital I/O Module 27Chapter 2
Using with External Pull-ups
The Digital I/O module data lines can be used in an open collector
configuration. Connections for open collector require the use of external
power supplies and pull-up resistors. The internal pull-up mode of the
Digital I/O module shoul d be disabled for open col lector output. Fi gure 2-10
shows a single data line connection. The value of the pull-up resistor is
calculated as follows:
Vcc5.0 Vdc=
ImaxIout
Vcc
----------- -
R
Imax
The value of TTL high with the 200 Ω pull-up resistor is calculated as
follows:
V
High
Vcc
safety_factor×48mA0.52×25mA===
Low
5
------------ -
0.025
-------------------------- -
×4.84Vdc==
6200200+
200Ω== =
6200
Figure 2-10. T ypical Open Collector Data Line
28Configuring the HP E1330B Digital I/O Module Chapter 2
Typica l Connection
Figure 2-11 shows a typical driver/receiver connection for data transfer.
The FLG, PIR, and STS lines have a discrete r esisti ve pull-up network. The
data lines do not have a discrete resistive pull-up, but can use an internal
pull-up in the 75ALS160. The internal pull-up requires that the data lines
sink 3.2 mA to pull the line to less th an 0.4 V. The I/O
are open collector, and require external pull-up to logic high.
, CTL, and RES lines
Figure 2-11. Typical Driver/Receiver Connections
Configuring the HP E1330B Digital I/O Module 29Chapter 2
Notes:
30Configuring the HP E1330B Digital I/O Module Chapter 2
Using the HP E1330B Digital I/O Module
Using This Chapter
Chapter 3
This chapter is divi ded into eight sectio ns about transferring dat a to and from
the Digital I/O Module and a peripheral:
The examples shown in this chapter use the default addresses for the
interface, Command module , and Digital I/O module . The address us es both
HP-IB primary and secondary addresses. The default address is:
Interface Select CodeCommand module
To establish these defaults as an I/O path in HP BASIC, the program
examples use this code:
10 ASSIGN @Dio TO 70918
Each Digital I/O module in a system must have a different logical address.
Additionally, no two instruments in the same system can have the same
logical address. Setting the logical address is described in Chapter 2 —
“Configuring the HPE1330B Digital I/O Module”.
70 91 8
HP-IB Primary AddressHP-IB Secondary
Address
Digital I/O module
HP-IB Address
address
LADDR
------------------- -
8
Using the HP E1330B Digital I/O Module 31Chapter 3
Operation Overview
The following steps illustrate general operation of the Digital I/O module.
Figure 3-1. HP E1330B General Operation
32Using the HP E1330B Digital I/O Module Chapter 3
Default and Reset States
At initial power-on and following the *RST command, the Digital I/O
module is set to the following stat es:
CTL line:0 = TTL Low
I/O
line:TRUE = input = TTL High
Data, FLG, and CTL line Polarity:POSitive
Handshake mode:NONE
Setting the Polarity
The logical true level of the control (CTL) line, the flag (FLG) line, and the
data lines of each port can be set to either TTL high (> 2.5V) or TTL Low
(< 1.4V) levels. SCPI commands use the
[SOURce:]DIGital:CONTroln:POLarity <POSitive or NEGative>
to set the control line’s (CTL) polarity on port n.
[SOURce:]DIGital:FLAGn:POLarity <POSitive or NEGative>
to set the flag line’s (FLG) polarity on port n.
POLarity keyword as:
[SOURce:]DIGital:DATAn:POLarity <POSitive or NEGative>
This program sets the polarity to positive on port 1 data lines. A TTL high
will be input as a 1, or a bit set to 1 will output a TTL High level.
*RST (reset) condition is positive polarity for control (CTL), flag
The
(FLG), and data lines on all ports.
Using the HP E1330B Digital I/O Module 33Chapter 3
Setting the Handshake Mode
Handshaking ensures corr ect transfer of data between devices. You mus t set
both the mode and the timing to establish correct handshaking. Most
handshake modes use the FLG and CTL lines to control the data transfer.
SCPI commands support the following modes of handshaking:
-- LEADing Edge
-- TRAiling Edge
-- PULSe
-- PAR Tial
-- STRobe
-- NONE
These SCPI commands set the type of handshake mode used:
Handshake TimingSome handshake modes require that a timing value be set.Primarily, the
timing applies to only output functions (the exception is STRobe Input
handshaking mode). These SCPI commands se t the timing of the hands hake
(where timing applies):
Sets the 8-bit por t 0 handshake mode to the LEADing Edge handshak e mode
and sets the output timing handshake delay to 0.015 seconds.
Detailed descripti ons of the ha ndshake modes, t iming diagrams, and the use
of the FLG and CTL lines are given in Chapter 4 —“Understanding the
HP E1330B Digital I/O Module”.
34Using the HP E1330B Digital I/O Module Chapter 3
Inputting Data Bytes and Bits
Data input is performed using commands in the SCPI
MEASure:DIGital:DATAn subsystem. The returned valu e of an input 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, is sue a IEEE 488 sele cted device
clear. In HP BASIC this is
InputInput operations ca n involve single bits, 8 -bit bytes, or multip le bytes. Single
bit operati ons always return a value of 1 or 0. Byte or multiple byte inp uts
always return values in decimal format.
40 ENTER @Dio;Ready
50OUTPUT @Dio;"MEAS:DIG:DATA0:BIT7?"
60 ENTER @Dio;Bits
70OUTPUT @Dio;"MEAS:DIG:DATA1?"
80 ENTER @Dio;Bytes
90DISP "Port 0, Bit 7 is "&Bits
100DISP "Port 1 byte is "&Bytes
110END
!Establish I/O path to module.
!Reset the module to establish
defaults.
!Wait for completion.
!Input a bit on port 0.
!Input a byte on port 1.
!Show the results.
This example first sets the module to the default state (positive polarity and
no handshake). The state of data line 7 (Bit 7) of port 0 is read. A byte is
input from port 1. The displayed state of the bit input will be either 0 or 1,
depending upon the electric al state of port 0 data line 7. The displ ayed value
of the byte input will range from 0 (all port 1 data lin es lo w) to 255 (all po rt
1 data lines high).
NoteFollowing a *RST command, the port data lines will be configured as
inputs, with the ports terminating resistors pulling them high. Bits will be
read as a 1 and a byte as 255.
Using the HP E1330B Digital I/O Module 35Chapter 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, is sue a IEEE 488select ed device
clear. In HP BASIC this is
OutputOutput operations can involve single bits, 8-bit bytes, or multiple bytes.
Single bit output operat ions 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.
This example sets bit 5 on port 0 to a logical true value (with the default
polarity establi shed, th e data li ne is set to TTL high). The example th en sets
all the data lines on por t 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.
!Establish I/O path to module.
!Reset the module to establish
defaults.
!Wait for completion.
!Set port 0 bit 5 true.
!Wait for completion.
!Output a byte on port 1.
!Wait for completion.
36Using the HP E1330B Digital I/O Module Chapter 3
Multiple Port Operations
The Digital I/O module supports multiple port operations using a single
SCPI command. Multiple port operations are shown in the SCPI command
syntax as the optional keyword
syntax initiates a handshake and returns a value:
MEAS:DIG:DATAn[:type]?
The optional keyword [:type] is re placed by one of the foll owing keywords :
[:type]. For example, this SCPI command
:BYTE
This keyword, or no keyword (default), is used for 8-bit port
operations.
:WORDThis ke yword is used to combine 2 adjace nt ports for 16-bit port
:LWORd
operations.
This keyword is used to combine all 4 ports for 32-bit operations.
!Establish I/O path to module.
!Alternating 1 and 0.
!Alternating 0 and 1.
!Reset the module to establish
defaults.
!Wait for completion.
!Set LEADing handsh ake for 32
bit operations.
!Wait for completion.
!Set handshake delay time.
!Wait for completion.
!Set 32 bits, use handshake,
alternating 1 and 0.
!Wait for completion.
!Set 32 bits, use handshake,
alternating 0 and 1.
!Wait for completion.
This example combines all four ports for handshaking and output
operations. The handshake mode is set to LEADing. The output data is given
in hexadecimal as specifi ed by the
#H characters. When using mult iple port
handshaking, use the highest numbered port CTL line to ensure a correct
handshake.
Using the HP E1330B Digital I/O Module 37Chapter 3
Using Trace Memory
Trace memory can speed input and output operations and free your system
controller during multiple byte input or output operations. A portion of
system memory is set aside and data is read or written as blocks. Trace
memory allows the fastest operation of the Digital I/O module. The rate of
transfer of each block of data is determined by the handshake speed of the
Digital I/O module and the peripheral.
NoteByte swapping may occur when using the :TRACe commands. If you are
using a Motorola processor, the bytes are written or read to memory with
the lowest port receiving the least significant byte (the case when directly
addressing the po rt through SCPI commands) . An Intel processo r , ho wever ,
when used with the
bytes. The bytes are written or read from memory with the lowest port
receiving the most si gnificant byte and the highest port the l east significant
byte.
Trace Memory Example 1This example writes 20 bytes as 10 WORDS at ports 0 and 1.
Using the HP E1330B Digital I/O Module 39Chapter 3
Notes:
40Using the HP E1330B Digital I/O Module Chapter 3
Chapter 4
Underst anding the HP E1330B Digital I/O
Module
Using This Chapter
This chapter provides explanations of the signal lines, handshake modes,
and port combining for the Digital I/O Module. This chapter has the
following topics.
Data LinesEach port has 8 data lines, numbered from 0 to 7. The data lines can be set
Each of the Digital I/O modul e ports has 8 data lines and 6 control lines . Not
all these lines are required for every application. A simplified diagram of a
port is shown in Figure 1- 1 on page 11. The fo llowin g subsect ions des cribe
the use of these lines.
as an 8-bit group, as part of a larger group, or individually using SCPI
commands.
The logical TRUE condition of the data lines can be controlled with SCPI
commands. Positive polarity is the default. The following table shows the
effect of changing the polarity with Input and Output operations for each
data line.
Input OperationsOutput Operations
TTL High = 11 = TTL High
POSitive Polarity
NEGative Polarity
TTL Low = 00 = TTL Low
TTL High = 00 = TTL High
TTL Low = 11 = TTL Low
Understanding the HP E1330B Digital I/O Module 41Chapter 4
The FLG Line (Input)Each port has a flag ( FLG) line. A flag li ne is an input line from a pe ripheral
and has two states: READY and BUSY. A flag line is normally used in
conjunction with the corresponding control line (CTL) to establish a
handshake between a peripheral and the Digital I/O Module. SCPI
commands that define handshake modes typically use the FLG and CTL
lines. The state of the FLG line can also be read with a SCPI command to
implement custom handshakes. Positive polarity is the default. The
following shows the effect of changing the polarity of the FLG line.
POSitive PolarityTTL High = BUSY = 1
TTL Low = READY = 0
NEGative PolarityTTL High = READY = 0
TTL Low = BUSY = 1
The CTL Line
(Output)
Each port has a control line (CTL). A control line is an open collector output
line from the Digital I /O module to the perip heral and has two states: TRUE
and FALSE. A control line is normally used in conjunction with the
corresponding flag lin e on the same port to establi sh a handshake betw een a
peripheral and the Digital I/O Module. SCPI commands that define
handshake modes typicall y use the FLG and CTL lines. Th e state of the CTL
line can be read and set with SCPI commands to implement custom
handshakes. Positive polar ity is the default. The fo llowing shows the effect
of changing the polarity of the CTL line.
POSitive PolarityTTL High = TRUE = ON = 1
TTL Low = FALSE = OFF = 0
NEGative PolarityTTL High = FALSE = OFF = 0
TTL Low = TRUE = ON = 1
The I/O Line (Output)Each port has an open collector I/ O line which is output fr om the Digita l I/O
module to the peripher al and has two states: TRUE or FALSE. The state of
the I/O
The data transceiver of that port is enabled for input. The peripheral may
respond to the signal by enabling itself to send data.
line is not directly programmable.
When the I/O
line is:TTL High = TRUE = 1 = Input
When the I/O line is:TTL Low = FALSE = 0 = Output
The data transceiver of that port is enabl ed for output. The per ipheral should
respond to the signal by enabling itself to receive data.
CautionTo prevent damage to the Digit al I/O module, when the I/O line is
set for Output (TTL Low), the peripheral MUST NOT attempt to
source on any data lines.
42Understanding the HP E1330B Digital I/O Chapter 4
The STS LineEach port has a status line labeled STS. The STS line is an input line to the
Digital I/O module. The use of the STS line is only at the register leve l, and
is not supported by SCPI commands. Refer to Appendix B for more
information about this line.
The PIR LineEach port has a peripheral interrupt request line l abeled PIR. The PI R line is
an input line to th e Digital I/O module. The use of t he PIR li ne is only at the
register level, and is not supported by SCPI commands. Refer to Appendix
B for more information about this line.
The RES LineEach port has a reset line labeled RES. The RES line is an open collector
output line to the peripheral. Control of the RES
level and is not supported by SCPI commands. Refer to Appendix B for
more information about this line .
Default and Reset States
At initial power-on and following the *RST command, the Digital I/O
module is set to the following stat es:
CTL line:0 = TTL Low
line is only at the register
Setting the Polarity
ExampleDIG:DATA1:POL POS
line:TRUE = input = TTL High
I/O
Data, FLG, and CTL line Polarity:POSitive
Handshake mode:NONE
The logical true level of the control (CTL) line, the flag (FLG) line, and the
data lines of each port can be set to either TTL high (>2.5V) or TTL Low
(<1.4V) levels. SCPI commands use the POLarity keyword as:
[SOURce:]DIGital:CONTroln:POLarity <POSitive or NEGative>
to set the control line’s (CTL) polarity on port n.
[SOURce:]DIGital:FLAGn:POLarity <POSitive or NEGative>
to set the flag line’s (FLG) polarity on port n.
[SOURce:]DIGital:DATAn:POLarity <POSitive or NEGative>
to set the da ta lines polarity on port n.
Sets the polarity to posit ive o n port 1 dat a line s, a TTL high wi ll be input as
a 1, or a bit set to 1 will output a TTL High level.
*RST (reset) condition is positive polarity for control (CTL),
The
flag (FLG), and data lines on all ports.
Understanding the HP E1330B Digital I/O Module 43Chapter 4
Using the Handshake Modes
Handshaking ensures corr ect transfer of data between devices. You mus t set
both the mode and the timing to establish correct handshaking. SCPI
commands support the following modes of handshaking:
--LEADing Edge
--TRAiling Edge
--PULSe
--PARTial
--STRobe
--NONE
These SCPI commands set the type of handshake mode used:
44Understanding the HP E1330B Digital I/O Chapter 4
Handshake ModesThe operation of each handshake mode for input or output operations is
described in the following subsections. In these discussions, only the FLG,
CTL, and DATA lines a re included. Ot her port control lines, contr olled only
through register access, are described in Appendix B of this manual.
LEADing EdgeThe LEADing Edge handshake makes use of both the CTL and FLG lines.
The input and output operations are described below.
INPUTOUTPUT
1The Digital I/O module sen ses the
FLG line and waits for READY.
2The Digital I/O module sets the
I/O line HIGH.
3The Digital I/O module sets CTL
TRUE.
4The peripheral senses the CTL
line and places data on the dat a
lines.
5The peripheral sets the FLG line
to BUSY indicating data is valid.
6The Digital I/O module sen ses the
FLG line and latches the data.
7The Digital I/O module returns
CTL to FALSE.
8The peripheral senses the CTL
line and returns the FLG line to
READY.
1The Digital I/O mo dule ch ecks the
state of the FLG line (must be
READY).
2The Digital I/O module sets the
I/O line LOW.
3The Digital I/O module places the
data on the data lines.
4After waiting the progr ammed
delay time, Td, the Digital I/O
module sets CTL to TRUE.
5The peripheral senses the CTL
line and sets the FLG line to
BUSY while it latches the data.
6When the Digital I/O module
senses the FLG line in the BUSY
state, it sets the CTL line to
FALSE and monitors the FLG line.
7When the peripheral returns the
FLG line to READY (indicating it
has latched the data) the next
handshake can begin.
Understanding the HP E1330B Digital I/O Module 45Chapter 4
TRAiling EdgeThe TRAiling Edge handshake makes use of both the CTL and FLG lines.
The input and output operations are described below.
INPUTOUTPUT
1The Digital I/O module sen ses the
FLG line and waits for READY.
2The Digital I/O module sets the
line HIGH.
I/O
3The Digital I/O module sets CTL
TRUE.
4The peripheral senses the CTL
line and sets the FLG line to
BUSY.
5The Digital I/O module sen ses the
FLG BUSY and sets the CTL line
FALSE.
6The peripheral senses the CTL
line change and places data on
the data lines.
7The peripheral indicates the data
is valid by returning the FLG line
to READY.
8The Digital I/O module sen ses the
FLG READY and latc hes th e data.
1The Digital I/O mo dule ch ecks the
state of the FLG line (must be
READY).
2The Digital I/O module sets the
I/O line LOW.
3The Digital I/O module places the
data on the data lines.
4After waiting the progr ammed
delay time, Td, the Digital I/O
module sets CTL to TRUE.
5The peripheral senses the CTL
line and sets the FLG line to
BUSY while it latches the data.
6The peripheral returns the FLG
line to READY indicating the end
of data transfer.
7The Digital I/O modul e senses th e
FLG line in the READY state and
returns CTL to FALSE.
46Understanding the HP E1330B Digital I/O Chapter 4
PULSeThe PULSe handshake makes use of both the CTL an d FLG lines. The input
and output operations are described below.
INPUTOUTPUT
1The Digital I/O module sen ses the
FLG line and waits for READY.
2The Digital I/O module sets the
line HIGH.
I/O
3The Digital I/O module sets CTL
TRUE.
4The peripheral senses the CTL
line and sets the FLG line to
BUSY.
5The peripheral places the dat a on
the data lines and indicates valid
data by setting the FLG line to
READY.
6The Digital I/O module sen ses the
FLG READY, returns CTL to
FALSE, and latches the input
data.
1The Digital I/O mo dule ch ecks the
state of the FLG line (must be
READY).
2The Digital I/O module sets the
I/O line LOW.
3The Digital I/O module places the
data on the data lines.
4After waiting the progr ammed
delay time, Td, the Digital I/O
module sets CTL to TRUE.
5The Digital I/O module then waits
another delay time, Td, and sets
the CTL line to FALSE.
6The peripheral senses the CTL
line change, sets the FLG line to
BUSY and latches the data.
7When the data is entered, the
peripheral returns the FLG line to
READY.
Understanding the HP E1330B Digital I/O Module 47Chapter 4
PARTialThe PARTial handshake makes use of both the CTL and FLG lines. The
input and output operations are described below.
INPUTOUTPUT
1The Digital I/O module sets the
line HIGH.
I/O
2The Digital I/O module sets CTL
TRUE.
3The peripheral senses the CTL
line and sets the data lines.
4The peripheral holds the FLG
line READY for at least
250 nsecs and the n set s the FL G
line BUSY to indicate the data is
valid.
5The Digital I/O module sen s es
the FLG line change to BUSY
and latches the data.
6The Digital I/O module then sets
the CTL line FALSE.
1The Digital I/O module sets the
I/O line LOW.
2The Digital I /O module places the
data on the data lines.
3After waiting the programmed
delay time, Td, the Digital I/O
module sets CTL to TRUE.
4The peripheral senses the CTL
line change, sets the FLG line to
READY for a minimum of
250 nsecs, latches the data, and
sets the FLG line to BUSY.
5The Digital I/O module senses
the change of the FLG line and
sets CTL to FALSE.
48Understanding the HP E1330B Digital I/O Chapter 4
STRobeThe STRobe handshake makes use t he CTL l ine, but not the FLG line. The
input and output operations are described below.
INPUTOUTPUT
1The Digital I/O module sets the
2The Digital I/O m odule sets CTL
3The peripheral senses the CTL
4The Digita l I/O mod ule wa its the
5The Digital I/O module then
line HIGH.
I/O
TRUE.
line and sets the data lines.
programmed time delay, Td,
after setting CTL TRUE and then
latches the data.
returns CTL to FALSE.
1The Digital I/O module sets
the I/O line LOW.
2The Digita l I/O module pl aces
the data on the data lines.
3After waiting the programmed
delay time, Td, the Digital I/O
module sets CTL to TRUE.
4The peripheral senses the
CTL line and latches the data.
5After waiting the programmed
delay time, Td, the Digital I/O
module sets CTL to FALSE.
NONEWhen handshake is set to NONE, no control or flag lines are used. The
Digital I/O module will inpu t data or output data when programmed. The I /O
line is set for output (LOW) before data is output. Data lines programmed
for output will remain as output until another command is received.
Handshake NONE can be combined with the SCPI commands
MEASure:DIGital:FLAGn and [SOURce:]DIGital:CONTroln to create
custom handshakes.
Handshake TimingHandshake timing is set through the SCPI commands
[SOURce:]DIGital:DATAn[:type]:HANDshake:DELay <time> or
[SOURce:]DIGital:HANDshakenDELay <time
generally used for data output operations. Timing for data input affects only
STRobe handshake modes.
Understanding the HP E1330B Digital I/O Module 49Chapter 4
>
. Handshake timing is
Inputting Data Bytes and Bits
Data input is performed using commands in the SCPI
MEASure:DIGital:DATAn subsystem. The returned valu e of an input will
depend upon the POLarity programmed for the port.
Input operations ca n involve single bits, 8 -bit bytes, or multip le bytes. Single
bit input operations always return a decimal value of
byte input operations always return numbers in decimal format.
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 unha ng a hun g tran sfer iss ue a I EEE 488 sel ecte d devic e
clear. In HP BASIC this is
Bit InputThe SCPI command for inputting the state of a single bit on a data port is:
MEASure:DIGital:DATAn[:type]:BITm
0 or 1. Byte or multiple
CLEAR 70918.
This command instruc ts the Digi tal I/O modul e to retur n a val ue of eith er
1, indicating the condition of b it m on port n, following comple tion of the
or
input handshake. The value returned depe nds upon the prog rammed state of
the port POLarity. I n the def ault st ate (POSit ive pola rity) a TTL high on the
data line specified by m will return a
HP BASIC program code will request and display the state of data line 3
(bit-3) on po rt 4.
120OUTPUT @Dio;"MEAS:DIG:DATA4:BIT3?"
130ENTER @Dio;Bits
140DISP "State of bit 3 on port 4" &Bits
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 bi t numbering for multipl e port
operations. For a single port, the data line numbers and bit numbers
correspond:
Dn-7Dn-6Dn-5Dn-4Dn-3Dn-2Dn-1Dn-0
Bit 7Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1Bit 0
In this manual the p hysical dat a lines are indicated as Dn-1. The n should be
replaced with the por t number f or th e in put oper ation . For exa mple, bi t 3 of
port 2 affects the state of data line D2-3.
1. For example, the following
0
Byte InputThe SCPI command requesting an 8-bit byte from a data port is:
MEASure:DIGital:DATAn[:BYTE][:VALue]?
This command instructs the Digital I/O module to return a decimal value
between 0 and 255, indicating the condition of the data lines on port n,
following completion of the input handshake. The value returned depends
upon the programmed state of the port POLarity. In the default state
50Understanding the HP E1330B Digital I/O Chapter 4
(POSitive polarity) if all data lines are at a TTL low level , the returned val ue
will be
0; if all lines are at a TTL hig h level, the retur ned value will be 255.
For example, the following HP BASIC program code will request and
display the decimal value of the data lines on port 2.
120OUTPUT @Dio;"MEAS:DIG:DATA2?"
130ENTER @Dio;Result
140DISP "Decimal value of port 2 data lines ";Result
Port numbers range from 0 to 3 for single port operations. The section
“Multiple Port Operations” begi nning on page 53 describes port nu mbering
for multiple port operations. For a single port, the returned decimal value
will have the following correspondence to the port data lines:
Dn-7Dn-6Dn-5Dn-4Dn-3Dn-2Dn-1Dn-0
Bit 7Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1Bit 0
MSBLSB
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 unha ng a hun g tran sfer iss ue a I EEE 488 sel ecte d devic e
clear. In HP BASIC this is
CLEAR 70918.
Bit OutputThe 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
the data line corresponding to bit m will be set to a TTL high level. For
example, the following HP 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 bi t numbering for multipl e port
>
is 1 and the default pol arit y (POSit ive po lari ty) is used,
Understanding the HP E1330B Digital I/O Module 51Chapter 4
operations. For a single port, the data lines number and bit numbers are:
Dn-7Dn-6Dn-5Dn-4Dn-3Dn-2Dn-1Dn-0
Bit 7Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1Bit 0
In this manual the p hysical dat a lines are indicated as Dn-1. The n should be
replaced with the por t number f or th e in put oper ation . For exa mple, bi t 3 of
port 2 affects the state of data line D2-3.
Byte OutputThe SCPI command syntax to send an 8-bit byte to a data port is:
This command instr ucts the Digi tal I/O module to se t the port n data lines to
<value
>
using the output hands hake. The optional parame ter <base> defines
the numbering system to use to impl ement
<base
>
are four values allowed for
no parameterdecimal format
#Hhexadecimal format
#Qoctal format
:
<value
>
on the data lines. There
#Bbinary format
The TTL levels set on the data lines depends upon the programmed port
polarity. In t he de fault sta te ( POSiti ve pol arit y) a TTL high l evel will be s et
for any bit set to 1. For example, the following four HP BASIC program
lines all perform the same function and set the same data lines on port 3:
If port 3 is in the default POSitive polarity mode, the TTL levels set on the
data lines by any of the program lines above will be:
TTL levelHighLowHighLowHighLowHighLow
Data lineD3-7D3-6D3-5D3-4D3-3D3-2D3-1D3-0
Port numbers range from 0 to 3 for single port operations. The section
“Multiple Port Operations” begi nning on page 53 describes port nu mbering
and byte order for multiple port operations. For single port operations, the
most significant bit is bit 7. The table below sh ows the bit numbers and data
lines.
n-7Dn-6Dn-5Dn-4Dn-3Dn-2Dn-1Dn-0
D
Bit 7Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1Bit 0
MSBLSB
52Understanding the HP E1330B Digital I/O Chapter 4
Multiple Port Operations
The Digital I/O module suppo rts multiple port ope rations. You can combi ne
operations using 2 or 4 ports with a single SCPI command. Multiple port
operations are shown in th e SCPI command sy ntax as the op tional key word
[:type]. For example, this SCPI command syntax initiates a handshake and
returns a valu e:
MEAS:DIG:DATAn[:type]?
The optional keyword [:type] is re placed by one of the foll owing keywords :
:BYTE
This keyword, or no keyword (default), is used for 8-bit port
operations.
:WORD
This keyword is used to combine 2 adjacent port s for 16-bit port
operations.
:LWORd
The SCPI keyword
This keyword is used to combine all 4 ports for 32-bit operations.
:DATAn specifies the port to be used for operations by
replacing n with the port number. Mu ltiple port operatio ns have fixed values
allowed for n. For all operations, if n is omitted, port 0 is assumed. The
values allowed for n are:
Operation
:BYTE0, 1, 2, or 3
:WORD0 or 2
:LWORd0
Values of n
For example, the foll owi ng HP BASIC pr ogr am c ode wil l obt ai n a decimal
value of the state of the 32 data lines contained in physical por ts 0, 1, 2 and 3.
120OUTPUT @Dio;"MEAS:DIG:DATA0:LWORD?"
130ENTER @Dio;Result
140DISP "32 bit longword at port 4 ";Result
Multiple Port
Handshaking
The SCPI command syntax to establish a multiple port handshake and set
handshake timing is:
The optional keyword [:type], parameter DATAn, handshake <mode>, and
<time
>
handshake delay
, are all described earlier in th is chapter. See the
sections “Handshak e Modes”, “Handshake Ti ming”, and the intr oduction to
“Multiple Port Operations” for explanations of these keywords and
parameters.
Understanding the HP E1330B Digital I/O Module 53Chapter 4
Multiple port handshaking has the following two abnormalities regarding
the CTL and FLG control lines:
•Input or Output handshaking using the CTL line. The CTL line is
set TRUE or FALSE sequentially on all ports involved in the
operation, from the lowest numbered port to the highest numbered
port. A slight time de la y exists between each po rt se tt ing the CTL line
TRUE or FALSE. When using handshaking on multiple port
operations, use the highest numbered port CTL line to ensure correct
data transfer.
•Input or Output handshaking using the FLG line. A change in the
state of any FLG line on any combined port continues the handshake
operation for all the c ombined ports . FLG lines can also be electric ally
combined through a jumper setting (see Chapter 2).
Multiple Port
Input/Output
Data input is performed using commands in the SCPI
MEASure:DIGital:DATAn subsystem. Data output is performed using the
commands in SCPI
[SOURce:]DIGital:DATAn subsystem.
The returned value of an input, or the TTL levels of an output, will depend
upon the POLarity programmed.
Both Input and Output operations will attempt to complete the handshake
mode set and may "hang" if required handshake operations are not
completed.
The sections “Byte Input” and “Byte Output”, earlier in this chapter,
describe operations that also apply to multiple port commands. The values
used for input and output operations depend upon the
[:type] used in the
command. Values for multiple port output operations are given below.
Input OperationsOutput Operations
FormatRangeFormatRange
BYTEDecimal0 to 255Decimal
#H
#Q
#B
WORDDecimal-32768
to
32767
Decimal
#H
#Q
#B
-128 to 255
00 to FF
000 to 377
8-bits
-32768 to 32767
0000 to FFFF
00000 to 177777
16-bits
LWORdDecimal-2147483648
to
2147483647
Table 4-1 shows allowable port combinations for each value of
Decimal
#H
#Q
#B
-2147483648 to 2147483647
00000000 to FFFFFFFF
0 to 37777777777
32-bits
[:type].
You can combine multi pl e po rt ope rations on the same Di git al I /O mod ule .
For example, you could define two independent 16-bit ports at port 0 and
port 2.
54Understanding the HP E1330B Digital I/O Chapter 4
Table 4-1. Port Combinations for [:type] Values
8-bit (BYTE) operations
Port #0123
Bit Designations7–07–07–0 7–0
Data LinesD0_7–D0_0D1_7–D1_0D2_7–D_0D3_7–D3_0
Parameters<
Port #02
Bit Designations15–87–015–87–0
Data LinesD0_7–D0_0D1_7–D1_0D2_7–D_0D3_7–D3_0
Parameters<
Port #0
Bit Designations31–2423–1615–87–0
Data LinesD0_7–D0_0D1_7–D1_0D2_7–D_0D3_7–D3_0
Parameters<
value><value><value><value>
16-bit (WORD) operations
value><value>
32-bit (LWORd) operat i o n s
value>
Understanding the HP E1330B Digital I/O Module 55Chapter 4
Notes:
56Understanding the HP E1330B Digital I/O Chapter 4
HP E1330B Digit al I/O Module Command
Using This Chapter
This chapter describes Standard Commands for Programmable Instrumentation
(SCPI) and summarizes IEEE 488.2 Common (*) Commands applicable to the
Digital I/O Module.
Commands are separated into two types: IEEE 488.2 Common Commands and SCPI
Commands.
Chapter 5
Reference
Common
Command
Format
SCPI
Command
Format
The IEEE 488.2 standard defines the Common Commands that perform functions
like reset, self-test, status byte query, etc. Common Commands are four or five
characters in length, always begin with the asterisk character (*), and may include
one or more parameters. The command keyword is separated from the first
parameter by a space character. Some examples of Common Commands are shown
below:
*RST*ESR 32*STB?
SCPI commands perform functions like closing switches, making measurements,
querying instrument states, or retrieving data. A subsystem command structure is a
hierarchical structure that usually consists of a top level (or root) command, one or
more lower level commands, and their p arameters. The follow ing example shows
part of a typical subsystem:
[SOURce:]
DIGital
:DATA
n
[:VALue]?
m?
:BIT
[SOURce:]
third level command (where n is the port number 0–3), and [
fourth level commands (where m is the queried bit location).
is the root co mmand, DIGital is a second level command, :DATAn is a
:VALue] and :BITm are
HP E1330B Digital I/O Module Command Reference 57Chapter 5
Command
Separator
A colon (:) always separ ates one command from th e next lower level command. This
is illustrated as follows:
MEASure:DIGital:DATAn:VALue?
Colons separate the root command from the second level ( MEASur e:DIGit al) and the
second from third level (
DIGital:DATAn), and so forth.
Abbreviated
Commands
Implied
Commands
The command syntax shows most commands as a mixture of upper and lower case
letters. The upper ca se letters i ndicate the abbrevi ated spelling for the command. For
shorter program lines, send the abbreviated form. For bet ter program readability, you
may send the entire command. The instrument will accept either the abbreviated
form or the entire command.
For example, if the command syntax shows
are both acceptable forms. Other forms of
MEASure, then MEAS and MEASURE
MEASure, such as MEASU or MEASUR
will generate an error. You may use upper or lower case letters. Therefore,
MEASURE, measure, and MeAsUrE are all acceptable.
Command keywords can be entered in their full form, as shown above, or can be
entered in their short form. In this manual, the entry required in short form
commands is always capitalized. The short form is generally used for examples in
this manual.
Implied commands are those which appear in square brackets ([]) in the command
syntax. (Note that the brackets are not part of the command and are not sent to the
instrument.) Suppose you send a second level command but do not send the
preceding implied command. In thi s case, the inst rument as sumes you int end to use
the implied command and it responds as if you ha d sent it. Examine thi s excerpt from
[SOURce:] subsystem shown below:
the
[SOURce:]
DIGital
:DATA
n
[:VALue] <parameter>
m <parameter>
:BIT
Both the root command [SOURce:], and fo rth level co mmand [:VALue], are implied
commands. To set the inst rument to output a logi cal 1 to bit 0 of port 3, yo u may send
either:
SOURce:DIGital:DATA3:BIT0 1orDIGital:DATA3:BIT0 1
NoteYou must include a space between the keywords and any parameters.
58HP E1330B Digital I/O Module Command Chapter 5
ParametersParameter Types. The following table contains explanations and examples of
parameter types you might see later in this chapter.
Parameter
Type
NumericAccepts all commonly used decima l represe nta tions of nu mbers
including optional signs, decimal points, and scientific notation.
123, 123E2, -123, -1.23E2, .123, 1.23E-2 , 1.23000E-01 . Special
cases include MIN, MAX, and DEF. MIN selects minimum value
available, MAX selects maximum value available, and DEF
selects default or reset value .
BooleanRepresents a single binary condition that is either true or false.
1 or ON; 0 or OFF.
DiscreteSelects from a finite number of values. These parameters use
mnemonics to represent each valid setting.
An example is the DIGital:CONTrol
command where polarity can be either POS or NEG.
Optional Parameters. Parameters shown within square brackets (
Explanations and Examples
n:POLarity <polarity>
[]) are optional
parameters. (Note that the brackets are not part of the command and are not sent to
the instrument.) If you do not specify a value for an optional parameter, the
instrument chooses a default value. For example, consider the
DISPlay:MONitor:PORT? [<MIN|MAX|DEF>] command. If you send the command
without specifying a parameter, the command returns the state of the port last
addressed. If you send the
returns
0. If you send the MAX parameter, the command returns 3. Be sure to pl ace
MIN parameter or the DEF parameter, the command
a space between the command and the parameter.
Keyword
Substitutions
Linking
Commands
Some commands indicat e a keyword substituti on by showing the keyword bold type
with an all lower case keyword. For example, in the SCPI command
MEASure:DIGital:DATAn[:type] the keyword [:type] should be replaced by one
these parameters:
:BYTE
:WORD
:LWORd
Linking IEEE 488.2 Common Commands with SCPI Commands.
Use a semicolon between the commands. For example:
*RST;DIG:CONT2 1 or DIG:CONT2:POL POS;*OPC?
Linking Multiple SCPI Commands.
Use both a semicolon and a colon between the commands. For example:
DIG:DATA2:POL NEG;:DIG:DATA2:BIT3 1
HP E1330B Digital I/O Module Command Reference 59Chapter 5
SCPI Command Reference
This section describes the Standard Commands for Programmable Instruments
(SCPI) commands for the Digital I/O Module. Commands are listed alphabetically
by subsystem and within each subsystem.
60HP E1330B Digital I/O Module Command Chapter 5
The DISPlay subsystem turns on the Monitor mode. Monitor mode enables the HP
E1301 Mainframe display, or an external terminal connected to either a B-size or a
C-size mainframe. Parameters re lated to the state of the data and contr ol lines are
shown. Refer to the appropri ate Command Module User’s Guide (H P E1405/E1406)
for supported terminal types. The parameters displayed are:
--port number
--polarity
--handshake mode
--state of the control line
--state of the flag line
--values on the data lines in both decimal and hexadecimal
ExampleMEAS:DIG:FLAG1? reads the port 1 flag line.
Range of ValuesDefault
NONE to use these commands.
HP E1330B Digital I/O Module Command Reference 67Chapter 5
SyntaxMEMory
:DELete:MACRo
MEMory Subsystem
The MEMory subsystem defines the command set for enabling the use of external
VME memory for storing traces and macros. The addressable range is #H200000
through #HDFFFF8 in A24 space.
MEMory:VME:STATe? queries the state of the external memory.
CommentsThis command returns 0 or 1, indicating external memory is OFF or ON.
Related Commands:
MEMory:VME:ADDRess?, MEMory:VME:SIZE?
HP E1330B Digital I/O Module Command Reference 71Chapter 5
[SOURce:] Subsystem
The [SOURce:] subsystem defines the command set for the Digital I/O module
output statements . It also def ines the state an d polarit y of the c ontrol line (CTL), the
polarity of the flag line (FLG), the hands haking mode, and handshake del ay for both
data input and output. The root command,
•*RST Condition: Clears the control line; i.e ., sets the contro l line t o logical 0.
ExampleDIG:CONT2 1 sets the 8-bit port 2 control line true.
DIGital:CONTroln[:VALue]?
[SOURce:]DIGital:CONTroln[:VALue]? reads the state of the control line on port
n and returns a 0 or 1, indicating the logical condition of the CTL line.
Numericnone, 0, 1, 2, or 30
Boolean0 or 1, OFF or ONNone
Parameters
Parameter NameParameter TypeRange of ValuesDefault
CONTroln
Numericnone, 0, 1, 2, or 30
Comments•This command is only available when using the downloaded SCPI driver.
•This command is used to create custom handshakes when the HANDshake is
NONE.
set to
•The condition of the CTL line returned by this command is the logical true
value set by the
ExampleDIG:CONT2? returns the current state of the 8-bit port 2 control line.
DIGital:CONTroln:POLarity command.
HP E1330B Digital I/O Module Command Reference 75Chapter 5
DIGital:DATAn[:type]:BITm
[SOURce:]DIGital:DATAn[:BYTE]:BITm <value> sets bit m on 8-bit port n.
[SOURce:]DIGital:DATAn:WORD:BITm <value> sets bit m on 16-bit port n.
[SOURce:]DIGital:DATAn:LWORd:BITm <value> sets bit m on 32-bit port n.
Parameters
Parameter NameParameter TypeRange of ValuesDefault
DATA
BIT
value>
<
Comments•:DATAn and :BITm are the keywords used to write data to port n and bit m.
The port number n and bit number m must be the last character of the k eyword
without spaces.
n
m
NumericBYTE
WORD
LWORd
NumericBYTE
WORD
LWORd
Numeric0 or 1None
none, 0, 1, 2, or 3
none, 0 or 2
none or 0
0–7
0–15
0–31
0
0
•For 16-bit operations using :WORD, n must be 0 or 2.
•For 32-bit operations using :LWORd, n must be 0.
•The keyword :LW32 may be used instead of :LWORd when using the
ExampleDIG:HAND3:DEL . 005 sets the delay between the data output and the assertion of
the control line to true on 8-bit port 3 to 5ms.
78HP E1330B Digital I/O Module Command Chapter 5
DIGital:DATAn[:type]:HANDshake:DELay?
[SOURce:]DIGital:DATAn[:BYTE]:HANDshake:DELay? queries for the delay
time between data output and the control line for data output at 8-bit port n and
returns a decimal number between 0 and .015.
[SOURce:]DIGital:DATAn:WORD:HANDshake:DELay? queries for the delay
time between data output and the control line for data output at 16-bit port n and
returns a decimal number between 0 and .015.
[SOURce:]DIGital:DATAn:LWORd:HANDshake:DELay? queries for the delay
time between data output and the control line for data output at 32-bit port n and
returns a decimal number between 0 and .015.
Parameters
Parameter NameParameter TypeRange of ValuesDefault
DATAn
MIN|MAX|DEFDiscreteNone or MIN|MAX|DEFNone
NumericBYTE
WORD
LWORd
none, 0, 1, 2, or 3
none, 0 or 2
none or 0
0
Comments•The delay time must be set to the same value on all ports used in a multiple
port operation.
•The keyword :LW32 may be used instead of :LWORd when using the
download version of the SCPI driver.
•DIG:DATAn[:type]:HANDshake is the sequence used for commands relating
to data handshaking at ports defined by n. The port number n must be the last
character of the keyword without spaces.
•MIN or DEF returns 0.000002. MAX returns 0.015.
HP E1330B Digital I/O Module Command Reference 79Chapter 5
DIGital:DATAn[:type]:HANDshake[:MODE]
[SOURce:]DIGital:DATAn[:BYTE]:HANDshake[:MODE] <mode> selects the
type of handshake and defines the timing relationship between the control (CTL)
line, the flag (FLG) line , and when data is transf erred in eit her direction bet ween the
Digital I/O Module and a peripheral on the 8-bit port n.
[SOURce:]DIGital:DATAn:WORD:HANDshake[:MODE] <mode> selects the
handshake mode used on the 16-bit port n.
[SOURce:]DIGital:DATAn:LWORd:HANDshake[:MODE] <mode> selects the
handshake mode used on the 32-bit port n.
Parameters
Parameter NameParameter TypeRange of ValuesDefault
DATAn
<mode>
NumericBYTE
WORD
LWORd
DiscreteNONE, LEADing, TRAiling,
PULse, PARTial, or STRobe
none, 0, 1, 2, or 3
none, 0 or 2
none or 0
0
NONE
•Handshake modes are described in Chapter 3.
•The handshake mode must be the same on all ports used in a multiple port
operation.
•The keyword :LW32 may be used instead of :LWORd when using the
downloaded version of the SC PI driver.
•DIGital:DATAn[:type]HANDshake is the sequence used for commands
relating to data handshaking at port n. The port number n must be the last
character of the keyword without spaces.
• NONE deletes all automatic data handshaking between the Digital I/O module
and the peripheral. For custom handshaking, the control and the flag lines are
controlled by the
ExampleDIG:HAND3:DEL .005 sets the delay between the data output and the assertion of
the control line to true on 8-bit port 3 to 5 ms.
HP E1330B Digital I/O Module Command Reference 87Chapter 5
DIGital:HANDshaken:DELay?
[SOURce:]DIGital:HANDshaken:DELay? queries for the ti me be tween data valid
and the assertion of the con trol li ne to TRUE. Thi s command ope rates on 8-bit por ts
and returns a decimal value between 0 and 0.015.
Parameters
Parameter NameParameter TypeRange of ValuesDefault
HANDshaken
MIN|MAX|DEFDiscreteNone or MIN|MAX|DEFNone
Comments•The delay time must be set to the same value on all ports used in a multiple
port operation.
•:HANDshaken is the keyword used for commands relatin g to data
handshaking at 8-bit port n. The port number n must be the last character of the
keyword without spaces.
•MIN or DEF returns 0.000002. MAX returns 0.015.
ExampleDIG:HAND0:DEL? queries the delay time between data valid and the assertion of
the control line to TRUE on 8-bit port 0.
DIGital:HANDshaken[:MODE]
[SOURce:]DIGital:HANDshaken[:MODE] <mode> selects the type of handshake
mode to use to transfer data in either direction between the Digital I/O module and a
peripheral on 8-bit port n. Handshakes are i nitiated by execution of a
MEASure:DIGital:DATAn
or
operates only on 8-bit ports.
NumericNone, 0, 1, 2, or 30
DIGital:DATAn
?
command. This form of the HANDshake command
Parameters
Parameter NameParameter TypeRange of ValuesDefault
HANDshaken
mode>
<
NumericNone, 0, 1, 2, or 30
DiscreteNONE, LEADing, TRAiling,
PULSe, PARTial, or STRobe
NONE
Comments•:HANDshaken is the keyword used for commands relating to data
handshaking at port n. The 8- bit port number n must be the last character of the
keyword without spaces.
•NONE deletes all automatic data handshaking between the Digital I/O Module
and peripheral. For custom handshaking, the control and flag lines are
controlled by the
ExampleDIG:HAND3 LEAD sets the handshake mode to LEADing on 8-bit port 3.
88HP E1330B Digital I/O Module Command Chapter 5
DIGital:HANDshaken[:MODE]?
[SOURce:]DIGital:HANDshaken[:MODE]? returns a s tring indicating the current
handshake mode of 8-bit port n. This form of the
only on 8-bit ports.
Parameters
Parameter NameParameter TypeRange of ValuesDefault
HANDshake command operates
Comments•This command will return one of the following strings:
DIGital:IOn?
Parameters
HANDshaken
NumericNone, 0, 1, 2, or 30
NONE
LEAD
TRA
PULS
PART
STR
•:HANDshaken is the keyword used for commands relat ing to data
handshaking at port n. The port number n must be the last character of the
keyword without spaces.
[SOURce:]DIGital:IOn
line on port n.
?
returns a 0 or 1 i ndi cating the current condition of the I/ O
Parameter NameParameter TypeRange of ValuesDefault
IOn
NumericNone, 0, 1, 2, or 30
Comments•This command is only available when using the downloaded SCPI driver.
•The I/O line’s polarity is fixed and is as follows:
-- When Digital I/O module is programmed to output data, the I/O
low.
-- When Digital I/O module is programmed to input data, the I/O
high.
line is set
line is set
•:IOn is the keyword used for commands relating to the I/O line at port n. The
port number n must be the last character of the keyword without spaces.
HP E1330B Digital I/O Module Command Reference 89Chapter 5
DIGital:TRACe:CATalog?
[SOURce:]DIGital:TRACe:CATalog? lists the currently available data blocks.
ParametersNone.
Comments•This command catalogs all blocks in VME memory and all blocks in the
mainframe system memory .
•The command returns a string.
ExampleDIG:TRAC:CAT? would return this string if both alpha and beta had been
previously d efined; "alpha","beta".
DIGital:TRACe[:DATA]
[SOURce:]DIGital:TRACe[:DATA] <name>,<block_data> writes a block of data
to a previously defined user memory block.
Parameters
Parameter NameParameter TypeRange of ValuesDefault
<name
>
<block_data>
StringName of user memory
block (maximum 12
characters)
Numeric/StringNumeric header and
ASCII block data
None
None
Comments•<name> must have been previously defined by a DIGital:TRACe:DEFine
command.
•The maximum length for <name> is 12 characters.
•<block_data> is of the form <#digits
<#digits> tells how many digits are used to define <length
<length
<block
ExampleDIG:TRAC:DATA first_block,#210ABCDEFGHIJ sends the data “ABCDEFGHIJ”
to the user memory blo ck first_block. Since the ASCII characte r A has a decimal
value of 65, the equivalent of 65 is stor ed in the first byte of first_block (a nd s o on).
>
tells how many bytes are to be transferred in <block>;
>
contains the actual data to transfer.
><
length><block> where:
>
;
90HP E1330B Digital I/O Module Command Chapter 5
DIGital:TRACe[:DATA]?
[SOURce:]DIGital:TRACe[:DATA]? <name
previously defined user memory block.
Parameters
Parameter NameParameter TypeRange of ValuesDefault
Comments•name must have been previously defined by a DIGital:TRACe:DEFine
command.
•The maximum length for name is 12 characters.
ExampleDIG:TRACe? first_block reads data from a block named first_block. If the
previous command example is sent, this command will return the string
#210ABCDEFGHIJ.
DIGital:TRACe:DEFine
[SOURce:]DIGital:TRACe:DEFine <name>,<size>,[<fill>] defines a block of data
as a user memo ry block, names th e block for future reference, and fills the block with
the last parameter. If the last parameter is absent, the block is filled with zeros.
<name
>
reads a block of data from a
>
StringName of user memory blo ck
(maximum 12 characters)
None
Parameters
Parameter NameParameter TypeRange of ValuesDefault
name
<
size>
<
<
fill>
>
StringName of user memory blo ck
(maximum 12 characters)
NumericUp to 12 Mbytes (depending
on memory installed)
Numeric0–2550
None
None
Comments•The firmware can hand le blocks wi th a tot al memory sp ace of up t o 12 Mbytes
of memory space. The actual amount available depends on the memory
installed.
•If the MEMory:VME:STATe ON command has been used, this command will
create blocks in the external add-on memory.
MEMory:VME:STATe OFF command has been used, this command will
If the
create blocks in the system memory.
ExampleDIG:TRAC:DEF first_block, 256 defines a 256 byte user memory block named
first_block and fills each byte with a zero.
HP E1330B Digital I/O Module Command Reference 91Chapter 5
DIGital:TRACe:DEFine?
[SOURce:]DIGital:TRACe:DEFine? <name> returns the size of a previously
defined user memory block in byte s. The command return s a deci mal nu mber i n the
range of 0 to 12,582,912.
Parameters
Parameter NameParameter TypeRange of ValuesDefault
<name
>
Comments•<name> must have been previously defined by a DIGital:TRACe:DEFine
command. The maximum length for
DIGital:TRACe:DELete:ALL
[SOURce:]DIGital:TRACe:DELete:ALL deletes all previously defined user
memory data blocks.
ParametersNone.
DIGital:TRACe:DELete[:NAME]
[SOURce:]DIGital:TRACe:DELete[:NAME] <name> deletes a previously defined
user memory data block.
StringName of user memory blo ck
(maximum 12 characters)
<name> is 12 characters.
None
Parameters
Parameter NameParameter TypeRange of ValuesDefault
<
name
>
StringName of user memory blo ck
(maximum 12 characters)
None
Comments<name> must have been previousl y defined by a DIGital:TRACe:DEFine command.
The maximum length for
<name> is 12 characters.
ExampleDIG:TRACe:DEL first_block deletes a user memory block named first_block.
92HP E1330B Digital I/O Module Command Chapter 5
The STATus subsystem controls the SCPI-defined Operation and Questionable
Signal Status Registers and the Standard Event Registers. Each is comprised of a
Condition Register, an Event Register, an enable mask, and transition filters.
Each Status Register works as foll ows: when a condit ion occu rs, the a ppropri ate bi t
in the Condition Register is set or cleared. If the correspond ing transition filter is
enabled for that bit, the same bit is set in the associated Event Register. The contents
of the Event Register and t he enable mask are l ogically ANDed bit-f or-bit; if any bi t
of the result is set, the summary bit for that register is set in the status byte. The status
byte summary b it for the Operation Status Register is bit 7; for the Questionable
Signal Status Register, bit 3; and for the Standard Event Register, bit 5.
SyntaxSTATus
:OPERation
:PRESet
:QUEStionable
STATus Subsystem
:CONDition?
:ENABle
:ENABle?
[:EVENt]?
:CONDition?
:ENABle
:ENABle?
[:EVENt]?
NoteThis subsystem is provided for compatibility. The Digital I/O module does not use
the Operation Status or Questionable Status Registers.
HP E1330B Digital I/O Module Command Reference 93Chapter 5
:OPERation:CON Dition ?
STATus:OPERation:CONDition? returns the contents of the Operation Status
Condition Register. Readi ng the regi ster does no t affect its contents . This command
does not affect the HP E1330 Digital I/O module.
:OPERation:ENABle
STATus:OPERation:ENABle <mask> specifies which bits of t he associated Even t
Register are included in its summary bit. The summary bit is the bit-for-bit logical
AND of the Event Register and the unmasked bit(s). This co mman d does not affect
the HP E1330 Digital I/O module.
Parameters
Parameter NameParameter TypeRange of ValuesDefault
The non-decimal numeric forms are the #H, #Q, or #B formats specified by
IEEE-488.2.
mask
<
>
Numeric or
non-decimal
numeric
0 through +32767None
:OPERation:ENA B le?
STATus:OPERation:ENABle? returns the mask set for the Operation Status
Register. This command does not affect the HP E1330 Digital I/O module.
:OPERation[:EVENt]?
STATus:OPERation[:EVENt]? returns the contents of the Operation Event Status
Register. Reading the register clears all bits in the register. This command does not
affect the HP E1330 Digital I/O module.
:PRESet
STATus:PRESet clears both the Operation Status Enable and Questionable Status
Enable Registers. This command does not affect the HP E1330 Digital I/O module.
94HP E1330B Digital I/O Module Command Chapter 5
:QUEStionable:CONDition?
STATus:QUEStionable:CONDition? returns the contents of the Questionable
Status Condition Register. Reading the register does not affect its contents. This
command does not affect the HP E1330 Digital I/O module.
:QUEStionable:ENABle
STATus:QUEStionable:ENABle <mask> specifies which bits of the associated
Event Register are included in its summary bit. The summary bit is the bit-for-bit
logical AND of the Event Reg ister and th e unmasked bit( s). This command doe s not
affect the HP E1330 Digital I/O module.
Parameters
Parameter NameParameter TypeRange of ValuesDefault
<
The non-decimal numeric forms are the #H, #Q, or #B formats specified by
IEEE-488.2.
mask
>
Numeric or
non-decimal
numeric
0 through +32767None
:QUEStionable:ENABle?
STATus:QUEStionable:ENABle? returns the mask set for the Quest ionable Status
Register. This command does not affect the HP E1330 Digital I/O module.
:QUEStionable[:EVENt]?
STATus:QUEStionable[:EVENt]? returns the contents of the Questionable Status
Event Register. Reading the register clears all bits in the register. This command
does not affect the HP E1330 Digital I/O module.
HP E1330B Digital I/O Module Command Reference 95Chapter 5
SyntaxSYSTem
:CDEScription?
Parameters
SYSTem Subsystem
The SYSTem subsystem returns information about the module.
:CDEScription? <
:CTYPe? <
:ERRor?
:VERsion?
SYSTem:CDEScription? <number> returns the module description.
Parameter NameParameter TypeRange of ValuesDefault
number
number
>
>
Comments•This command is only available when using the downloaded SCPI driver.
:CTYPe?
Parameters
Comments•This command is only available when using the downloaded SCPI driver.
<number
>
Numeric1None
•<number> is the instrument number. Because each D igital I/O module is a
single instrument,
<number> is always 1.
•The command returns the following string:
Quad 8-bit Digital I/O
SYSTem:CTYPe? <number
Parameter NameParameter TypeRange of ValuesDefault
<
number
>
>
returns the module number and manufacturer.
Numeric0 to 99None
•The command returns the following string (revision number may vary and the
serial number is always set to 0):
HEWLETT-PACKARD,E1330B,0,A.05.00
96HP E1330B Digital I/O Module Command Chapter 5
:ERRor?
Comments•Returns the error number and error string. If no errors are in the error buffer,
ExampleSYST:ERR? queries the mainframe for errors.
:VERSion?
CommentsReturns a decimal value in the form:
SYSTem:ERRor? queries the Error Register for the error value and returns a string
error message to identify the error type. The errors are held in an error buffer and
read in a First-In-First-Out manner by this command.
returns:
+0,"No error".
•Related Commands:*ERR
•*RST Condition:None.
SYSTem:VERsion? returns the SCPI version to which this instrument complies.
YYYY.R
where YYYY is the year, and R is the revision number within that year.
HP E1330B Digital I/O Module Command Reference 97Chapter 5
IEEE 488.2 Common Commands
The following table lists the IEEE 488.2 Common (*) Commands that can be
executed by the HP E1330B Digital I/O Module. For more information on Common
Commands, refer to ANSI/IEEE Standard 488.2-1987.
NoteThese commands apply to many instruments a nd are not docu ment ed in det ail her e.
See ANSI/IEEE Standard 488.2-1987 for more information.
*IDN?Identification queryReturns identification string of the Digital I/O Module.
*RSTResetSets all ports to input mode, handshake NONE, and polarity POS.
*TST?Self-Test QueryAlways returns 0.
*OPCOperation CompleteSets the request for OPC flag when all pending operations have been
*OPC?Operation Complete QueryReturns a 1 to the output queue when all pending operations are complete.
*WAIWait to ContinueHalts execution of commands and queries until the "No Operation
*CLSClear statusClears all Event Registers, the Request for OPC flag, and all queues
mask>Event status enableSets the bits in the Event Status Enable Register.
*ESE<
*ESE?Event status enable queryQueries the Event Status Enable Register.
*ESR?Event status register queryQueries and clears the contents of the Standard Event Status Register.
mask>Service request enableSets the Service Request Enable Register bits, and corresponding Serial
*SRE<
*SRE?Service request enable queryQueries the contents of the Service Request Enable Register.
*STB?Read status byte queryQueries the contents of the Status Byte Register.
*TRGTrigger
n>Recall saved stateRecalls stored module configuration in the memory location set by <n>.
*RCL<
n>Save stateStores the module configuration in the memory location set by <n>.
*SAV<
*EMC <n>Enable macroEnable execution of macro <n>.
completed. Also sets the OPC bit in the Standard Event Register.
Pending" message is true.
(except output queue).
Poll Status Byte Register bits, to generate a service request.
*EMC? <
*RMCRemove macrosRemoves all macros.
*LMCList macrosLists macros by name.
*DMCDefine macroDefines a macro.
*GMCMenu queryGet results of menu query.
*PMCPurge macrosPurges all system macros.
n>Enable macro queryQueries execution state of macro <n>.
98HP E1330B Digital I/O Module Command Chapter 5
Command Quick Reference
The following tables summarize SCPI Commands for the HP E1330B Digital I/O
module.
Sets the displayed monitor port number.
Returns the monitored port number.
Turns the monitor mode of the display ON or OFF.
Returns the state of the monitor mode.
Reads the state on bit
handshake.
Reads port
Reads bytes f rom port n after completion of handshake.
Assumes decimal format of input data.
Reads the port
Used to implement custom handshakes.
Deletes a macro.
Sets the address for add-on VME system memory.
Returns the current add-on VME memory address.
Sets the size of the add-on VME memory.
n after completion of handshake and stores block.
m on port n after completion of
n FLAG line. Returns 0 or 1.
VME:SIZE? [<MIN|MAX>]
VME:STATe <state>
VME:STATe?
Returns the current size of the add-on VME memory.
Sets the state (ON or OFF) of the assigned VME memory.
When this is OFF, all memory commands refer to the base
system memory.
Returns the current state (0 or 1) of the add-on VME memory.
HP E1330B Digital I/O Module Command Reference 99Chapter 5
CommandDescription
[SOURce:]
DIGital:CONTroln:POLarity <POS|NEG>
DIGital:CONTrol
DIGital:CONTroln[:VALue] <0|1 or ON|OFF>
DIGital:CONTrol
DIGital:DA TA
DIGital:DA TA
DIGital:DA TA
DIGital:DA TAn[:type]:HANDshake:DELay?
DIGital:DA TA
<NONE|LEADing|TRAiling|
PULSe|PARTial|STRobe>
n:POLarity?
n[:VALue]?
n[:type]:BITm <0|1>
n[:type]:BITm?
n[:type]:HANDshake:DELay<time>
n[:type]:HANDshake[:MODE]
Sets logical true level of control line on port
Returns current logical true polarity of port
Sets or clears control line on port n. Command used to crea te
custom handshakes when HANDshake is set to NONE.
Returns the current state of the control line on port
(downloaded SCPI driver only).
Sets bit
Returns the programmed state of bit
(downloaded SCPI driver only).
Sets delay between data output and assertion of control line
for data output on port
output and input STRobe handshake.
Returns the time between data valid and assertion of control
line to TRUE.
Selects type of handshake to transfer data bet ween port
and peripheral. Handshakes are initiated by execution of
DIG:DATA
m on port n.
n. Also sets strobe pulse for both
n or MEAS:DIG:DATAn? commands.
n.
n.
n
m on the port n
n
DIGital:DATAn[:type]:HANDshake[:MODE]?
DIGital:DATAn[:type]:POLarity <POS|NEG>
DIGital:DATA
DIGital:DATAn[:type]:TRACe <name>
DIGital:DATAn[:type][:VALue][<base>]<value>
DIGital:DATA
DIGital:FLAG
DIGital:FLAG
DIGital:HANDshaken:DELay <time>
DIGital:HANDshaken:DELay?
DIGital:HANDshake
n[:type]:POLarity?
n[:type][:VALue]?
n:POLarity <POS|NEG>
n:POLarity?
n[:MODE]
<NONE|LEADing|TRAiling|
PULSe|PARTial|STRobe>
Returns the current handshake mode set on port n.
Sets logical true level of the data lines on port n.
Returns the logical true level set for the data lines on port
Writes the named block of data to the port n.
Writes the value, in the specified base, to port n.
Returns a decimal value indicating the programmed state of
the data lines on the port
Sets logical true level of the flag line on port n.
Returns the logical true level set for the flag line on port
Sets delay be tween da ta valid and as sertio n of c ontrol lin e for
data output on 8-bit port
output and input STRobe handshake.
Returns the time between data valid and assertion of control
line to TRUE on 8-bit port n.
Selects type of hands ha ke to tran sfe r data between 8-bit port
n (downloaded SCPI driver only).
n. Also sets strobe pulse for both
n.
n.
n and peripheral. Handshakes are initiated by execution of
DIG:DATA
n or MEAS:DIG:DATAn? commands.
DIGital:HANDshake
n[:MODE]?
Returns the current handshake mode set on 8-bit port n.
100HP E1330B Digital I/O Module Command Chapter 5
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.