The information contained in this manual is believed to be accurate and reliable. However, Keithley
Instruments, Inc., assumes no responsibility for its use or for any infringements of patents or other
rights
of third parties that may result from ik use. No license is granted by implication or otherwise
under any patent
righk
of Keithley Instruments, Inc.
KEITHLEY INSTRUMENTS, INC., SHALL NOT BE LIABLE FOR ANY SPECIAL,
INCIDENTAL, OR CONSEQUENTIAL DAMAGES RELATED TO THE USE OF THIS
PRODUCT. THIS PRODUCT IS NOT DESIGNED WITH COMPONENTS OF A LEVEL OF
RELIABILITY SUITABLE FOR USE IN LIFE SUPPORT OR CRITICAL APPLICATIONS.
Refer to your Keithley hWrumenk license agreement and Conditions of Sale document for specific
warranty and liability information.
MetraByte is a trademark of Keithley hMru.menk, Lnc. AU other brand and product names are
&ademarks or registered trademarks of their respective companies.
@Copyright Keithley Instruments, Inc.
1991,1992,
1993,1994
Au rights reserved. Reproduction or adaptation of any part of this doctunentation beyond that
permitted by Section 117 of the 1976 United States Copyright Act without pem&zion of the Copyright
owner is unlawful.
Appendix A - Serial Communications Tutorial
Appendix B - Configuration Worksheets
- vii -
a
a
a
. . .
- VIII -
Chapter 1
INTRODUCTION
1.1
GENERAL
The MetraBus system provides a low-cost means of connecting real-world I/O devices to a
computer. The system is available in two configurations: (1) tightly coupled to an IBM PC bus
system or (2) remotely operated through RS-232/422 serial communications from any
computer.
Under the supervision of a PC, MetraBus digital, analog, and counter-timer measurement, and
control interfaces can control cost-effective industrial I/O systems. Each MetraBus system can
measure and control hundreds of analog, digital, and counter/timer I/O points. Several
MetraBus systems can simultaneously control thousand of I/O points.
MetraBus fills the gap between I/O plug-in boards and dedicated industrial controllers. Plugin boards and a personal computer are finding applications in process measurement and
control applications and product test stations. However, the large number of date I/O points
required, the proximity of the sensors to the control room combined Gith a finite number of
expansion slots available in a personal computer often require versatile systems that are
flexible, provide for enhanced expansion capability and are inexpensive. The MetraBus family
of industrial data acquisition products retains the close link of the personal computer to a data
acquisition system while offering extreme flexibility at a price that rivals many plug-in I/O
boards.
Key MetraBus features include:
1.2
l
Low cost I/O
l
Ease of programming
l
Simple packaging and interconnection
l
Reliability
l
100% personal computer compatible
l
Local, high speed interfaces
l
Remote capability, up to 1.2 km from computer
THE METRABUS
The MetraBus system is an extension of the computer bus to real world measurement and
control devices. All MetraBus I/O boards share the 5O-conductor cable illustrated in Figure l-
1. The MetraBus cable consists of:
l
6 Address lines
INTRODUCTION I- 1
l
8 Datalines
l
4
Control/status lines
l
3 Power supplies
l
Ground conductors between all address data and control
MDB-64: IBM PC compatible MetraBus controller board
l
MID-64: IBM PC compatible controller card with full optical isolation between PC and
MetraBus.
REM-64: Remote MetraBus controller. Communication via RS-232/422 serial. Multidrop
up 16 REM-64 per computer serial port.
l
INTMDB-64: Intelligent MetraBus controller board. This board is described in a separate
manual.
Both local and remote MetraBus systems control the same family of signal acquisition and
control boards. The boards and their various functions are as follows:
l
MID-16/M%-%: 16 solid-state relays
. MEM-8: 8 electromechanical relays
l
MEM-32: 32 electromechanical relays
l
MIO-32: 32-channel, optically isolated TTL output
l
MII-32: 32-channe1, optically isolated TT’L input
l
MAI-16: Wchannel, 12-bit A/D
l
MAO-8: &channel, 8-bit D/A
l
MAO-12: 12-Channel, 12-bit A/D
l
MCN-8: 8 Channel, &bit counter timer
l
MJ3B32: 32-bit prototype board with four fully decoded addresses
l
MDG-1: Diagnostic/training board with LEDs
l
MBUS-PWR: MetraBus power supply
l
MSSR-32:
l
MCPT-8X8: Cross-point relay board
l
MTHERM-20: 20-channel thermocouple
l
MTAP-1: Power supply tap board
32-channel,
solid-state reIay board
1.4 PACKAGING & INTERCONNECTION
All MetraBus I/O boards are 19” rack mountable using either the RMT-02 housing, a standard
NEMA cabinet, or any 7” x 6”~ 2” enclosure. A 50-way, 0.05” spacing ribbon cable connects the
MetraBus controller/driver card to the I/O boards. This MetraBus cable operates at lengths
of up to 100’. Connectors are standard, 50-pin insulation-displacement type; their parallel
architecture allows placement at any point along the MetraBus cable.
INTRODUCTION 1 -3
1.5 CONCEPTUAL VIEW OF METRABUS
MetraBus is an extension of the PC I/O control address space. The MetraBus controller card
implements three control functions, as follows:
* An address Ppinter
l
A data input/output path
l
A reset/clear line
An I/O OUT command from the PC sets the address pointer to a MetraBus I/O board at its
address. Data may then move to or from the selected I/O boards. A RESET/CLEAR may
come from the PC at any time, clearing all I/O boards and resetting the address pointer to
zero.
1.6 PROGRAMMING METRABUS
MetraBus is programmable from any PC-usable language having INPUT and OUTPUT
commands capable of manipulating the I/O bus. Examples of such languages are:
l c
l
BASICA
l
Microsoft PASCAL
l
Assembly
l
GWBASIC
l
TURBO PASCAL
In addition, the REM-64 MetraBus controller allows connection of a MetraBus’system to any
computer with an Rs-232/RS-422 interface. A REM-64 can be controlled from any language
capable of writing and reading the computer’s serial ports.
Programming the MetraBus is a two-step procedure: (1) set the address pointer then (2) read
or write the data. The following discussion wiIl use the variables DATAIO, ADRPTR, and
MRESET in order to help clarify MetraBus progr amming technique. These variables are
generally set at the beginning of your programs for ease of manipulation as follows:
lODATA = 768
20ADRPTR = 769
30MRESET = 770
4OOU-T ADRJ?TR, 01
‘Declare MetraBus data I/O path
'Declare address pointer location
'MetraBus reset location
'Set the address pointer to address #l
5OOUT DATAIO,45 'Write data 45 to address 1
Set the MetraBus address pointer by issuing a single comman d to the MetraBus controller
board. Once set, the address pointer is latched and need not be reset until a different address
is required.
l-4
Writing and reading data from a MetraBus I/O board is transparent once the address pointer
is set. Issuing an OUT command will write data to the targeted I/O board. Likewise, issuing
an INP command will retrieve data from the I/O board via the data I/O path.
OTJT ADRPTR,Ol 'Set address to 1
40
500UT DATAIO,45 'Write data 45 to address 1
6OVAL
= INP(DATAI0) 'Read back data from 1
The MetraBus controller board and all attached MetraBus I/O boards may be reset by writing
to the reset address. Here is an example in BASIC:
METRABUS USER MANUAL
40 OUT
MRESET, 00 ‘Clear the MetraBus
Examples of all MetraBus programming features are available on the MetraBus diskettes.
MDB-64 vs. REM-64 Programming
Direct bus plug-in controller boards (MDB-64 and MID-64) program differently than the
REM-64 MetraBus serial controller board. Commands to the MDB-64 and MID-64 are direct
statements to an I/O port. For example, in BASIC:
40 OUT ADRPTR, 01
5OOUT DATAIO, 44
REM-64 co
mmands are writes to a COMl or COM2 serial port. The REM-64 has an on-board
m&!roprccessor which interprets
‘Set address pointer to #l
‘Write data 44 to board #l
co
mmands from the personal computir. The REM-64 issues
commands to the I/O boards (via the MetraBus cable) identical to those issued by an MDB-64
or MID-64. For example, in BASIC:
10 PRINT #l,"B" ; 1 'Activate REM-64 #l
20
PRINT #1, "A" ; 4
30
PRINT #l, "W" ; 44 ‘Write data “44” to I/O board #l
'Set address pointer to MetraBus address 4
Since the MDB-64 and REM-64 use different hardware connections, programs for the MDB-64
are not compatible with those for the REM-64.
Programming l/O Boards
MetraBus I/O boards fall into three major categories:
l
Digital in and out
l
Analog in and out
l
Counter/timer
Digital MetraBus I/O boards program with byte wide (8 bits) write and read commands.
Driving a single digital line high or reading the status of a single line requires one bit.
Therefore, 8 lines (or bits) are controlled when writing to or reading from the digital I/O
boards.
Data to a MetraBus digital ouQut board is latchtid and may be read back from the board. This
data readable feature is usable when manipulating the I/O lines, thus making digita
programming easy.
Analog output boards are controlled as an g-byte port, one byte per channel. The analog
equivalent of the &bit data is output by the DAC on the MetraBus analog output board.
Analog input for the MetraBus is full-featured, allowing user control of application specific
parameters. Prior to reading A/D data from a MetraBus MAI-16, the range channel and type
(12-bit or 8-bit) must be set. An A/D conversion is triggered by software only.
INTRODUCTION
I- 5
I
The MCN-8 counter/ timer board has two functions available from software: clear counter
and read counter. Writing to a counter will clear it while reading a counter will retrieve the
current count in the register.
.7
SUMMARY
The remainder of this manual covers the individual MetraBus controller boards and I/O
function boards. The electrical interfacing and programming aspects of each board are
explained.
All explanations and example programs are as if the I/O board is under the control of an
MDB-64. The MIX-64 is a complete and simple implementation of the MetraBus concept.
The MID-64 and REM-64 embody additional features, and are treated in this manual with
programming examples for each.
The lNTMDI3-64 is an intelligent stand-alone driver/controller board for the MetraBus, It is
usable as a dedicated, low-cost controller, or as a satellite controller monitored/controkd by
a larger host computer. This board is described in the INTMDB-64 user’s manual.
Schematics for the MetraBus are available in the MetraBus schematic package.
I-6 METRAHJS USER MANUAL
Chapter 2: The Controller Boards
2A.l GENERAL
The MDB-64 driver board is the functional heart of the MetraBus system. This board
supervises all I/O operations between the computer and MetraBus I/O boards within your
system. Since the MBD-64 generates all necessary control signals, it controls system-level data
transfer. Because of its design, a single MDB-64 is capable of addressing up to 64 MetraBus
I/O boards. Figure 2A-1 is a functional block diagram of the MDB-64.
The MDB-64 is a ‘half-slot” board that installs in any PC expansion slot. A 50-pin connector
extends through the rear of the computer and connects to the MetraBus cable. Functionally,
MetraBus has a parallel-bus architecture with the MetraBus cable carrying all data, address,
and control signals, as well as distributing power to the MetraBus I/O boards. Ground
conductors are interleaved between all signal lines to reduce system noise. The MDB-64
allows MetraBus cable lengths of up to 100 feet.
The MetraBus industrial data acquisition and control interface allows higher speed, greater
accuracy, and total autonomous operation to otherwise slow and troublesome applications.
A.2 FEATURES
l
Interfaces with IBM PC/XT, PC AT or other bus-compatible computers.
l
Allows placement of MetraBus I/O boards at up to 100 feet from the computer.
l
Compatible with many off-the-shelf software packages.
l
Controls up to 512 digital I/O lines.
l
Controls up to 256 (8 or U.-bit) A/D.
Figure 2A-1. MDB-64 Functional Block Diagram
l
Controls up to 64 @-bit) DACs.
THE CONTROLLER BOARDS
MDB-64 DRIVER BOARD 2A-1
l
Extremely cost effective.
l
Adapts to your changing requirements.
2A.3 SPECIFICATIONS
Number of addressable MetraBus 64
ports:
Maximum MetraBus data transfer 80 kbytes/s
rate:
Maximum drivable cable length: 100 feet at full speed
200 feet at reduced speed
MetraBus cable type:
MetraBus connector:
Power required:
50 conductor ribbon cable
3M 3425-4050
-+ 5
V: 250 rr~4
typical, 325 n-4 maximum
2A.4 SE’TJING THE BASE ADDRESS SWITCH
The MD13-64 uses four consecutive locations in the PC I/O address space. This address space
extends from decimal 512 to 1023.
for 768 (3OOh), as shown in Figure 2A-2.
-2
The MDB-64 base address switch is preset by the factory
ADDRESS
ADDRESS UNE VALUES:
LINE DECIWL HEX
512
200
256 100
Figure ZA-2. Defautt Base Address Switch SettiRgs.
If I/O address 768 (300h) is occupied by another device, you must reset the base address
switch. Refer to your PC manual for available addresses in the I/O space.
Once you have selected an address, change the base address switch accordingly. For
assistance with the settings, use the INSTALLEXE program provided on your MetraBus
diskette.
NOTE: Setting the base address to a location used by another device
may cause erratic operation or PC system failure.
To run the INSTALLEXE program, change to the appropriate directory and at the DOS
prompt, and type
INSTALL
2A-2 METRABUS USER MANUAL
Switch settings indicate o voluc o!
512 i 256 = 768 Dccimoi
(768 decimal, 300h)
followed by [Enter]. When the program asks for the desired
base address, enter the new base address in decimal and press [Enter]. The program rounds
your address to the nearest 4-bit boundary and checks for conflicts with other devices.
Choosing an address less than 512 or greater than 1023 results in an error message. When the
program determines an address is suitable, it displays the settings you must make on the Base
Address Switch.
INSTALL.EXE performs an additional function: it generates a file named MBUS.ADR
containing the newly selected Base Address Switch settings. The address in the file
MBUS.ADR may then be read by application programs as an alternative to m-defining the
MDB-64 address in every program. The following short BASIC program shows how to obtain
the address from the MBUSADR file.
lOOPEN "KBUS.ADR" FOR INPUT AS #l
20
INPUT #~,BASADR
30 PRINT BASADR
40
CLOSE #l
The base address location is returned to the variable BASADR for use by your application
program.
2A.5 INSTALLING THE MDB-64 FUSE.(Fl)
MBD-64 fuse Fl allows the PC to supply +5 VDC to the MetraBus I/O boards via the
MetraBus cable. Large systems and those using +15 V will require an additional high-quality
power supply such as the MBUS-PWR (see Contents).
Failure to remove the fuse when using the MDB-44 with an external power supply causes the
fuse to blow.
If the MetraBus System is to draw power from the PC power supply, the fuse Fl must be
installed. This fuse is a Littlefuse #312001,3AG 2A fast blow.
In this case, Fuse Fl must be removed.
2A.6 INSTALLING THE MDB-64 DRIVER CARD
1. Unplug your computer.
Remove the cover of your computer and select any empty expansion slot. Remove the
2.
backplate from the selected slot. If you are using an IBM PC/XT, note that the MDB-64
does
not
operate correctly in the short expansion slot farthest to the right (I8) next to the
power supply. This slot is reserved for the IBM expander card and is not available for
peripherals since the bus signals are slightly different from the other slots.
Make certain that the base address switch is properly set and fuse Fl is installed/removed
3.
(as needed).
Lnsert the MDB-64 into a PC expansion slot. If needed, straighten the locking tabs on the
4.
ends of the connector prior to insertion.
Once the board is in place, plug the MeiraBus cable into the MDB-64. Make sure the
5.
locking tabs are locked around the mating portions of the MetraBus connector. The
mating portions of the connectors are keyed and should plug-in easily. Check the
keyways for correct alignment prior to insertion, Avoid applying force to the connector.
Secure the MDB-64 backplate to the computer frame with a screw and replace the
6.
computer cover.
THE CONTROLLER BOARDS
MDB-64 DRIVER BOARD 2A-3
NOTE: The MDB-64 is shipped with two resistor networks. These
termination resistors are to be installed in sockets RN1 and RN2 on the
last MetraBus I/O board in your system. These resistor networks are
used to minimize signal reflection due to long MetraBus cable lengths.
They are optional, however, and have little effect for cables of 50 feet or
less.
2A.7 THE MDB-64 METRABUS CONNECTOR
The MDB-64 passes information to and receives data from the MetraBus I/O boards via the
MetraBus cable. Figure ZA-3 shows the physical and functional layout of this cable.
NOTE: The +15 VDC pins are active only when the MDB-64 is used
in conjunction with an external power supply such as the MBUS-PWR.
As mentioned earlier, the PC has I/O address locations for such things as disk drives,
printers, serial ports, and other peripherals. The MDB-64 Base Address is located within this
I/O space. The three MDB-64 locations and their functions are as follows:
LOCATION I/O ADDRESS
(Decimal)
Base Address +-Oh
Base Address +lh
Base Address +2h
Base Address +3 h
768 Data I/O path (DATAIO)
769
‘770 Software reset (PRESET)
771 Unassigne4l
Address pointer (ADRPTR)
Function
For the sake of clarity, all references to specific address locations use the variable names
DATAIO, ADRFTR, and MRESET as specified in the table above. Normally, variable
assignments are made at the beginning of your application program. For example,
The following sections discuss address location
use. All references to the above locations assume a base address of 768 decimal
The Address Pointer
(ADRPTR)
functions
in order of typical programming
(300h).
The function of the MDB-64 address pointer is to point to the specific MetraBus I/O board to
be accessed. Each MetraBus I/O Board must
in order to identify it from other boards in the MeiraBus system.
have
a unique, non-overlapping board address
(Refer to the section “Setting
the board address” for the relevant I/O board.) Writing the board address to ADFUYIR sets
the current MetraBus address and targets the specific I/O board for use. Once the address
pointer is set to a particular board address, data can be written to or read from that board.
The BASIC commands IN? and OUT control the read and write functions respectively. It
should be noted that while the example are
written
using BASIC, many computer languages
supporting data I/O operations may be used. Refer to the programming manual for the
language that you are using for the correct syntax. The following example illustrates how to
set the address pointer to a MetraBus I/O board (MEM-8) at address 12.
10ADRPTR = 769
2QDATAIO = 76%
30MRELSET = 770
4OMBf8 = 12
5OOUT ADRPTR, MEM8 'Point to HEM-8 at address 12
Once the MetraBus address pointer is set, it does not change until another OUT command
changes it. Setting the address pointer is a fast operation on the personal computer bus,
taking less than 10 p.
Remember
that
the address pointer is used to point to a MetraBus I/O board address. Since
this address is latched on the MDB-64, it can be read back using the BASIC INP command, as
follows:
The BASIC variable ADDRESS contains the current MetraBus I/O board address. If the above
INP command were issued immediately after the previous OUT command, the ADDRESS
variable would contain a valued of 12. Reading the address pointer returns six bits of address
information and two bits of status information (R/W and BUSY), as shown below:
Address Byte
BIT D7
D6
D5
D4 D3 D2
Dl
DO
BUSY R/w A.5
A4
A3
A2
Al A0
NOTE: The driver board inverts the polarity of the actual bus control
signals.
Normally, the BUSY and R/W status bits are low (non-zero). When this is true, the data
returned is identical to the contents of the address pointer. See Programming The MDB-64 7’0
Covttiol The I/O Boar& for an example and an explanation of how to monitor the status bits.
The Data l/O Register (DATAIO)
Once the address pointer has been set, data may be written to and read from a MetraBus I/O
board. All data transfer takes place through DATAIO. Accessing specific functions on the
MetraBus I/O board and passing data back to the computer via DATA10 may be
accomplished using the BASIC OUT command
70 OUT DATAIO, 128
This command calls for a value of 128 which might activate a relay on the MEM-8 relay board.
The actual functions that it specifies is dependent on the board accessed.
You may read data from the data I/O with a single IN7 command, as follows:
EODAT = INP(DATAI0)
The BASIC variable DAT
contains
the ADRPTR. All MetraBus output boards latch data sent to them and therefore, have data
readable capability. This means that if the above IN? command were issued after the
previous OUT command, variable DAT would contain a value of 128.
The Sofiware RESET (MRESET)
A software reset causes alI MetraBus I/O boards connected to the MetraBus cable to be reset
to a known state. See the description of the I/O board for more details. The following shows
how to use the software RESET feature for all MetraBus I/O boards.
80 OUT HRZSET, 00
90 START = TIMER
100 IF (TIZGR - START) < .02 THEN 100
The BASIC Timer command is used to insure a wait of 20 ms for the reset pulse to finish.
214-6 METRABUS USER MANUAL
data from the MetraBus I/O board previously targeted by
Notes On The Use Of Compiled Or Assembled Languages
Execution speeds with compiled and assembled languages may call for precautions. As
mentioned earlier, when reading the currently latched MetraBus I/O address, the lowest six
bits contain address information while the two most significant bits carry status information.
Prior to any BASIC Inp or Out command, check the status bits (R/W and Busy). The
following example shows the proper status checks.
DATA10 = 768
10
ADRPTR = 769
20
MRESET = 770
30
MA116 = 8
40
OUT MRESET, 00
50
60 START = TIMR
IF (TIKER - START) <
70
IF (INPUDRPTR) AND 192)
80
90 OUT ADRPTR, HAI16+2
IF (INP(ADFU?TR) AND 192)
100
OUT DATAIO, 18
110
IF (INP(ADRPTR) AND 192)
120
130 OUT ADRPTR, HAI16+1
140 IF (INP(ADRPTR) AND 192) THEN 140
150 AIN = INP(DATAI0)
'Input Time
'Wait 20 ms
'Check status
'Point to
'Check status
'Set gain to +5 V range on than 2
'Check status
'Point to result of conversion
'Check status
'Return result to computer
g-bit
A/D resolution
Programming The MDB-64 To Control The l/O Boards
As described above, the three MDB-64 I/O locations have quite distinct
of execution generally follows a consistent pattern when programming any MetraBus I/O
board. The following examples illustrate programming techniques used with both digital and
analog
I/O Boards. For prograrnmin
g information on a specific board, refer to the board
description.
Digital l/O Boards
functions.
Their order
Digital I/O boards are the easiest to control. Data can be written to DATAIO
setting the address pointer. Digital output boards typically have several &bit ports. In the
following example, a digital output board (MIO-32) is at board address 0 and the MDB-64 is at
computer I/O Address 768 decimal (3OOh).
Lines 10 through 40 declare the locations of the MetraBus DATAIO, ADRF’TR, and
MRESET functions, as well as declare the MIO-32 board address. Line 50 sets the address
pointer to the MIO-32 digital output board. Line 60 outputs a value of 255 to the MIO-32,
setting all outputs high.
THE CONTROLLER BOARDS
'Declare data
'Declare
address pointer location
I/O
location
'Declare MetraBus REXXT location
'Point to MIO-32
at
address 0
'Output bit pattern 1111 1111
MDB-64 DRIVER BOARD
soon
after
the
2A-7
Digital input board (Mu-32) programmin
g is similar to that for digital output boards. Digital
input boards typically have several B-bit ports. After the address pointer has been set, data
can be read from the DATAIO, as follows:
lODATA = 768 'Declare Data I/O Location
20ADRPTR = 769 'Declare Address Pointer Location
30MRBSET = 770 'Declare MetraBus RESET Location
40MII32 = 4 'Declare MII-32 Board Address
5OOUT ADRPTR, MI132 'Point to MII-32 at Address 4
60DATIN = INP(DATAI0) 'Get data from DATA10
Lines 10 through 40 declare the locations of the MetraBus DATAIO, ADKPTR, and
the
MRESET functions, as well as declare the MU-32 board address. Line 50 sets the address
pointer to the MIl-32 digital input board. Line 60 reads the contents of one of the four &bit
ports on the m-32 and stores the result in the BASIC variable DATIN.
Analog I/O Boards
Analog output boards (MAO-8) use one MetraBus I/O address per channel. Setting the
Address Pointer to the appropriate address and writing data to the DATAIO will produce an
analog output. The following example shows how to set the address pointer and output a
voltage.
Lines 10 through 40 declare the locations of the MetiaBus DATAIO, ADRPTR, and the
MRXSET functions, as well as declare the MAO-8 board address. Line 50 sets the address
pointer to channel 0 of the MAO-8 board. Line 60 outputs the highest voltage possible for its
selected range.
'Declare Data I/O Location
'Declare Address Pointer Location
'Declare MetraBus RESET Location
'Declare MAO-8 Board Address
'Point to HAO-8 at Address 8
'Output Pull Range Voltage
'Start A/D Conversion
'Select the MSB's address
Analog Input boards (MAI-16) require additional steps, however, in order to set the gain and
resolution for the desired channel prior to taking data. Assume an MAI- board has been set
at Board Address 8.
Line 50 sets the gain to + 5V full scale range on channel 2.
Line 60 points to the B-bit conversion mode for the board and channel previously selected.
Line 70 starts the A/D conversion process.
Line 80 points to the results of the A/D conversion.
Line 90 returns the result to the computer and stores the data in the variable AJN.
THE CONTROLLER BOARDS
MDB-64 DRIVER BOARD 2A-9
cl
P
2A-10 METRABUS USER MANUAL
Chapter 2: The Controller Boards
2B.l GENERAL
Part 2B
MID-64 DRIVER BOARD
The MID-64 driver board optically isolates the computer bus from
acquisition and control
computer and MetraBus I/O boards within your
system.
The MID-64 supervises all I/O operations between the
system.
All necessary control signals are
the
MetraBus data
generated within the MID-64, so you don’t have to worry about system level data transfer.
Because of its design, a single MID-64 is capable of addressing up to 64 MetraBus I/O boards.
The MID-64 contains an on-board, programmable counter/timer capable of periodic
system
interrupt generation. This allows the MetraBus operation in a foreground/background mode
emulating many common multitasking environments. A functional block diagram of the
MlD-64 is provided in Figure 2B-1.
When installed, a 50-pin connector extends out the rear of the computer and connects to the
MetraBus cable. Functionally, the MetraBus has a parallel bus architecture with the MetraBus
cable carrying all data, address, and control signals, as well as distributing power to the
MetraBus I/O boards. Ground conductors are interleaved between all signal lines to increase
system noise immunity. The MID-64 has been designed to allow MetraBus cable lengths of up
to loo feet.
The MetraBus industrial data acquisition and control interface, in conjunction with your
present computer, allows higher speed, greater accuracy, and total autonomous operation to
previously slow, troublesome, applications.
THE CONTROLLER BOARDS
MID-64 DRIVER BOARD
2B-1
2B.2 FEATURES
l
Connects with IBM PC/XT, PC AT, or other bus compatible computers.
l
Allows placement of MetraBus I/O at up to 100 feet from the PC.
l
Full optical isolation to 500 Volts.
l
Fully compatible with software written for the MDB-64 driver board.
l
Interrupt generation capability.
l
Controls up to 512 digital I/O lines.
l
Controls up to 256 (8 or 12-bit) A/D.
l
Controls of 64 @-bit) DACs.
l
Controls up to 64 counter/timers.
l
Extremely cost effective.
l
Adapts to your changing requirements.
28.3 SPECIFICATIONS
Number of Addressable MetraBus
64
Ports:
2B.4
Maximum MetraBus Data TrmR;yz
80 kbytes/s
Maximum Drivable Cable Length: 100 feet at full speed
200 feet at reduced speed
+ 5
Power Required:
PC to MetraBus Isolation:
V: 250 mA typical, 325 rnA maximum
500 volts (minimum)
SETTING THE BASE ADDRESS SWITCH
The MID-64 uses four consecutive locations in the PC I/O address space. This address space
extends from decimal 512 to 1023. The MID-64 Base Address Switch is preset by the factory
for 768 (3OOh), as shown in Figure 2A-2.
ADDRESS
LINE
qs iedicote 0 value o!
i 256 = 766 Decimal
or
+ iOD = 300 Hex
Figure 2B-2. Default Base Address Switch Settings.
2B-2 METRABUS USER MANUAL
(768 decimal, 300h)
If I/O address 768 (300h) is occupied by another device, you must reset the base address
switch. Refer to your PC manual for available addresses in the I/O space.
Once you have selected an address, change the base address switch accordingly. For
assistance with the settings, use the INSTALLEXE program provided on your MetraBus
diskette.
NOTE:
may cause erratic operation or PC system failure.
To run the INSTALL.EXE program, change to the appropriate directory and at the DOS
prompt, and type INSTALL followed by [Enter]. When the program asks for the desired
base address, enter the new base address in decimal and press [Enter]. The program will
round your address to the nearest 4-bit boundary and check for conflicts with other devices.
Choosing an address less than 512 or greater than 1023 results in an error message. When the
program determines an address is suitable, it displays the settings you must make on the base
address switch.
INSTALL.EXE also generates a file named MBUSADR containing the newly selected base
address switch settings. The address in the file &!fHJS.ADR may then be read by application
programs as an alternative to redefining the MID-64 address in every program. The
following short BASIC program shows how to obtain the address from the MBUS.ADR file.
1OOPKN "MBUS.ADR" FOR INPUT AS #1
20 INPUT #l,BASADR
30PRINT BASADR
40
CLOSE #l
The base address location is returned to the variable BASADR for use by your application
program.
Setting the base Aadress to a location used by another device
2B.5 USE OF THE AUXILIARY POWER SUPPLY
An auxiliary power supply such as the MBUS-Pm is required for operation of the MID-64,
since it does not distribute power from the computer’s supply. See the chapters of this
manual dealing with the MBUS-PWR for specifications and installation instructions.
2B.6 INSTALLING THE MID-64 DRIVER CARD
1. Unplug your computer.
2. Remove the cover of your computer and select any empty expansion slot. Remove the
back-plate from the selected slot.
3. Make certain that the base address switch is properly set.
4. Insert the MID-64 into the expansion slot. It may help to straighten the locking tabs on the
ends of the connector prior to insertion.
THE CONTROLLER BOARDS MID-64 DRIVER BOARD 28-3
5. Once the board has been inserted, plug the MetraBus cable into the MID-64. Make sure
that the locking tabs are locked around the mating portions of the MetraBus connector.
The mating portions of the connectors are keyed and should plug-in easily.
Check the
keyways for correct alignment prior to insertion. Avoid applying force to the connector.
6. Secure the MID-64 back-plate to the computer frame with a screw and replace the
computer cover.
NOTE:
The MID-64 is shipped with two resistor nehvorks.
termination resistors are to be installed in sockets RN1 and RN2 on the
last MetraBus I/O board in your system. These resistor networks are
used to minimize signal reflection due to long MetraBus cable lengths.
They are optional, however, and have little effect for cables of 50 feet or
less.
2B.7 THE MID-64 METRABUS CONNECTOR
The MID-64 passes information to and receives data from the MetraBus I/O boards via the
MetraBus cable. Figure 2B-3 shows the physical and functional layout of this cable.
The
+15
NOTE:
conjunction with an external power supply such as the MBUS-PWR.
DATA m
BUS
CONTROL
ADDRESS /
BUS
POWER +5 v
VDC pins are active only when the MID-64 is used in
As mentioned earlier, the PC has I/O address locations for such things as disk drives,
printers, serial ports, and other peripherals. The MID-64 base address is located within this
I/O space. The eight MID-64 locations and their associated functions are as follows:
LOCATION
I/O ADDRESS
(DecimaI)
Base Address +Oh
Base Address +lh
Base Address
+2h
Base Address +3h
Base -4~Uress 4h
Base Address +5h
Base Address +6h
Base Address +7h
768
769
770
771
772
773
774
775
NOTE: Most applications do not require counter/timer interrupt
implementation.
For those that do, a short section is included in this
manual. The discussion below will deal with the majority of
applications and wiIl, for the moment, ignore interrupt
implementation.
There are three important address locations:
Address pointer (ADRF’TR)
Data I/O path (DATAIO)
Software reset (MRESET)
Function
Data I/O pPath (DATAIO)
Address pPointer (ADRXR)
Software rReset (MRESET)
Unassigned
counter 0 (COUNTO)
Counter 1 (COTJNTI)
Unassigned
Counter cContro1 (CNTCTRL)
The following sections discuss address location functionality in order of typical programming
use. All references to the above locations will assume a base address of decimal 768. For the
sake of clarity, all references to specific address locations will use the variable names
DATAIO, ADRPTR, and MRESET as specified in the table above. Normally, variable
assignments are made at the beginning of your application program, as follows:
1ODATAIO = 768 'Declare Data I/O Location
20ADRPTR = 769 ‘Declare Address Pointer Location
30MRESET = 770
The Address Pointer (ADRPTR)
The function of the MID-64 address pointer is to point to the specific MetraBus I/O board to
be accessed. Each MetraBus I/O board must have a unique, non-overlapping board address
in order to identify it from other boards in the MetraBus system. (Refer to the section “Setting
the Board Address” for the relevant I/O board.) Writing the Board Address to ADRPTR sets
the current MetraBus address and targets the specific I/O board for use. Once the address
pointer is set to a particular board address, data can be written to or read from that board.
The BASIC commands INP and OUT control the read and write functions respectively. It
should be noted that while the examples are written using BASIC, many computer languages
supporting data I/O operations may be used. Refer to the programming manual for the
THE CONTROLLER BOARDS
‘Declare RELSET Location
MID-64 DRIVER BOARD
28-5
language that you are using for the correct syntax. The following example illustrates how to
set ADRF’TR to address 12 for a MEM-8 board:
Once the MetraBus address pointer is set, it does not change until another OUT command
changes it.
Setting the Address pointer is a fast operation on the personal computer bus,
taking less than 10 microseconds. Since this address is latched on the MID-&, it can be read
back using the BASIC INF’ command, for example:
60
ADDRESS = INPCADRPTR)
The BASIC variable ADDRESS contains the address of the MetraBus I/O board currently
targeted. If the above INP co
mmand is issued soon after the previous OUT command, the
ADDRESS variable would contain a value of 12. Reading the address pointer returns 6 bits of
address information and two bits of status information (R/W and BUSY), as follows:
Address Byte
BIT D7 D6 D5 D4
BUSY Pu’W A5
A4
D3 D2 Dl
A3
A2 Al A0
DO
NOTE: The driver board inverts the polarity of the actual
signals.
bus control
Normally, the BUSY and R/W status bits will be low (non-zero>. When this is true, the data
returned is identical to the contents of the address bus. See Programming The MID-64 To
Control The I/O Boards for an example and an expknation of how to monitor the status bits.
The Data I/O Register (DATA/O)
Once the address pointer has been set, data may be written to and read from a targeted
MetraBus I/O board. All data transfer takes place through DATAIO. Accessing specific
functions on the MetraBus I/O board and passing data back to the computer via DATA10
may be accomplished using the BASIC OUT command:
7OOUT DATAIO, 128
This command outputs a value of 128 which might activate a relay on the
The actual functions that it specifies is dependent on the board accessed.
Data
can be read from the
80DAT
= INP (DATAIO)
Data I/O with a single lNP con-man
d, as follows:
The BASIC variable DAT wiIl contain data from the MetraBus I/O board previously targeted
by the ADRM’R. All MetraBus output boards latch data sent to them and therefore, have data
MEM-8
relay
board.
2B-6 METRABUS USER MANUAL
Loading...
+ 170 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.