Allen-Bradley 1784-KTX User manual

Because of the variety of uses for the products described in this
publication, those responsible for the application and use of this control
equipment must satisfy themselves that all necessary steps have been taken
to assure that each application and use meets all performance and safety
requirements, including any applicable laws, regulations, codes and
standards.
The illustrations, charts, sample programs and layout examples shown in
this guide are intended solely for purposes of example. Since there are
many variables and requirements associated with any particular
installation, Allen-Bradley does not assume responsibility or liability
(to include intellectual property liability) for actual use based upon the
examples shown in this publication.
Allen-Bradley publication SGI-1.1, Safety Guidelines for the Application,
Installation, and Maintenance of Solid State Control (available from your
local Allen-Bradley office), describes some important differences between
solid-state equipment and electromechanical devices that should be taken
into consideration when applying products such as those described in this
publication.
Reproduction of the contents of this copyrighted publication, in whole or
in part, without written permission of Allen-Bradley Company, Inc., is
prohibited.
Throughout this manual we use notes to make you aware of safety
considerations:
ATTENTION: Identifies information about practices or
circumstances that can lead to personal injury or death, property
damage or economic loss.
Attention statements help you to:
identify a hazard
avoid the hazard
recognize the consequences
Important: Identifies information that is critical for successful application
and understanding of the product.
Important User Information

About This Manual P1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Objectives of This Manual P1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Audience P1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Conventions P1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
About the Examples P1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Related
Publications
P2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Understanding I/O Scanner Concepts 11. . . . . . . . . . . . . . . .
Chapter Preview 11. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
How Does the Scanner Relate to I/O 11. . . . . . . . . . . . . . . . . . . . . .
I/O Addressing 13. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
What the Scanner Does 16. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Operating Modes 17. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Dualport
RAM
17. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Host
Responsibilities
18. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
What's
Next
19. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Startup and Shutdown 21. . . . . . . . . . . . . . . . . . . . . . . . . . .
Chapter Preview 21. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using the KTx Memorymapped Hardware 21. . . . . . . . . . . . . . . . . .
Running Diagnostics on the KTx Card 23. . . . . . . . . . . . . . . . . . . . .
Running
the Host Compatibility T
est 27. . . . . . . . . . . . . . . . . . . . . . .
Loading the Protocol File 210. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Initialization 212. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Shutdown 214. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
What's
Next
214. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Programming Overview 31. . . . . . . . . . . . . . . . . . . . . . . . . . .
Chapter Preview 31. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Dualport Layout 31. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Adapter
Status T
able 31. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
I/O Image Tables 32. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Command Interface 32. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Confirmation Handshaking 33. . . . . . . . . . . . . . . . . . . . . . . . . . .
Handling Host Interrupts 34. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Installing and Enabling the Interrupt 35. . . . . . . . . . . . . . . . . . . . . . .
Writing the Interrupt Service Handler 36. . . . . . . . . . . . . . . . . . . . . .
What's
Next
38. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Table of Contents
Allen-Bradley Parts

Table of Contentsii
Issuing Scanner Management Commands 41. . . . . . . . . . . . .
Chapter Preview 41. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Basic Command and Confirmation Structures 41. . . . . . . . . . . . . . . .
Host Commands 42. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
What's
Next
412. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Issuing Blocktransfer Commands 51. . . . . . . . . . . . . . . . . . .
Chapter Preview 51. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
How Block Transfer Works 51. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Adapter Decide Length (ADL) 52. . . . . . . . . . . . . . . . . . . . . . . . . . .
Host BT Write 52. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Host BT Read 56. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Time
to Completion
59. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Unsolicited Block Transfer 510. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
What's
Next
510. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Reporting KTx Scanner Status 61. . . . . . . . . . . . . . . . . . . . . .
Chapter Preview 61. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Operating Status Word 62. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Adapter
Status T
able 63. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
KTx Hardware Status Register 66. . . . . . . . . . . . . . . . . . . . . . . . . .
Using the LEDs as Status Indicators 66. . . . . . . . . . . . . . . . . . . . . .
Exception/Error Handling 66. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
What's
Next
69. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Understanding Discrete I/O 71. . . . . . . . . . . . . . . . . . . . . . . .
Direct Image Table Access 71. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
To access a single input terminal, 72. . . . . . . . . . . . . . . . . . . . . . . .
To
set a single output terminal,
72. . . . . . . . . . . . . . . . . . . . . . . . . .
To reset (clear) a terminal is a little trickier; 72. . . . . . . . . . . . . . . . . .
Timing
of Discrete I/O
73. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Input Change of State (COS) Detection 76. . . . . . . . . . . . . . . . . . . .
Interrupt at End of Scan List 77. . . . . . . . . . . . . . . . . . . . . . . . . . . .
What's
Next
77. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Dualport Layout A1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Appendix Preview A1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Programming Examples B1. . . . . . . . . . . . . . . . . . . . . . . . . . .
Appendix Preview B1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
About the Examples B2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Table of Contents iii
KTx Hardware Registers C1. . . . . . . . . . . . . . . . . . . . . . . . . .
Appendix Preview C1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Glossary D1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Appendix Preview D1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Support Services 1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Allen-Bradley Parts

Preface
P-1
About This Manual
Use this document to understand, program, and employ the scanner
function of the 1784-KTX, 1784-KTXD, and 1784-KTS Communication
Interface cards.
In this document, we refer to the 1784-KTX, 1784-KTXD, and 1784-KTS
cards collectively as “1784-KTx” or “scanner.”
To use this product effectively, you must be familiar with:
C programming
Allen-Bradley programmable controllers
We wrote this document for application programmers.
We use these conventions in this manual:
command names look like this: Set Mode
variables and function names look like this: get_scan_list
program constants and macros look like this: SUCCESS or
INIT_IN_PROGRESS
We designed the examples in this manual to introduce the application
programmer to the host-to-KTxinterface and commands. The examples
demonstrate all of the host-to-KTxcommands as well as other common
tasks, such as:
reading and writing the I/O image tables
reading the status table
start-up and shutdown
watchdog timer
Unlike a typical application program, these example programs are not
designed to take advantage of the KTx’s ability to interrupt the host when a
host-to-KTxcommand reaches completion. Some commands, such as
block transfers, are given 4 seconds by the KTxto complete their tasks
before the KTxdeclares a timeout error. For most applications it would be
impractical to suspend processing for this length of time.
Objectives
of This Manual
Audience
Conventions
About the Examples

Preface
About This Manual
P-2
Source code for an interrupt service routine has been included to
demonstrate how an application might handle KTxinterrupts. The interrupt
service routine has not been integrated with the rest of the example source
code. That task has been left to the application programmer.
Publication Title Pub. No.
1784KTxDualport Interface Specification Reference Manual 17846.5.21
1784KTxCommunication Interface Card User Manual 17846.5.22
1784CP12 Cable Packing Data 17842.41
1784CP13 Cable Packing Data 17842.44
I/O Concepts Manual for Industry Bus Products 6008-6.5.1
Data Highway/Data Highway Plus/Data Highway II/
Data Highway485 Cable Installation Manual
17706.2.2
Related
Publications
Allen-Bradley Parts

Chapter 1
1-1
Understanding I/O Scanner Concepts
This chapter explains basic concepts and provides an overview of the
operation of the PC I/O scanner. After reading this chapter you should
understand how:
information moves between your program and the outside world
your program can issue commands to affect operation of the scanner
The scanner uses the remote I/O protocol to communicate with
Allen-Bradley I/O modules. You don’t have to know the specifics of the
protocol to use the scanner with the I/O modules, but you do need to know
a few terms.
The scanner is an Allen-Bradley communication card, which requires a
16-bit backplane, that you install in a compatible host computer (or host).
PC Hardware
Host
PC
I/O Protocol
1784KTx
I/O Hardware
Processor
(e.g., 80486)
Remote I/O
Module
Chapter
Preview
How Does the Scanner
Relate to I/O

Chapter 1
Understanding I/O Scanner Concepts
1-2
I/O modules sit in one or more chassis. An I/O chassis is a housing that
holds one adapter and as many as 16 I/O modules. The adapter is the
communication interface between the scanner and the chassis. The scanner
communicates with the adapter through Allen-Bradley-approved cable.
In turn, the adapter monitors and controls the I/O modules through the
backplane of the chassis. You can combine chassis in any way that results
in as many as 32 adapter addresses.
Host
KTx Scanner
Remote I/O Cable
Adapter
I/O Chassis
14652
Processor
Adapter
Adapter
Adapter
I/O Chassis
I/O Chassis
I/O Chassis
I/O chassis can contain 8bit, 16bit, or 32bit
discrete I/O modules, analog, and/or intelligent
I/O modules.
EISA/ISA Bus
We can divide I/O, and therefore I/O modules, into discrete and
intelligent modules.
Allen-Bradley Parts

Chapter 1
Understanding I/O Scanner Concepts
1-3
Discrete I/O is characterized by one terminal (or point) per I/O image table
bit. Your program handles discrete I/O through I/O image tables, where
each input or output terminal corresponds to one of the 4096 input and
4096 output image table bits (256 x 16 bits = 4096 bits).
The input image table is an area of memory that monitors the terminals of
discrete input modules. When an input switch is closed, the corresponding
bit is set to 1. The output image table is an area of memory that controls
output terminals of output modules. After a bit is set to 1, the
corresponding switch is closed or the terminal is energized.
A standard-density module is a discrete input or output module that has 4,
6, or typically 8 input or output terminals. A high-density module is a
discrete input or output module that has 16 input or output terminals. A
quad-density module is a discrete input or output module that has 32 input
or output terminals.
Intelligent I/O is characterized by the transmission of one or more 16-bit
words in a particular format to or from an I/O module. A block transfer
(BT) is the transmission of data to or from an intelligent I/O module.
A BT read transfers information (typically analog input and status data)
from the module to the host; a BT write transfers data (typically analog
output and configuration data) from the host to the module.
You assign each adapter an I/O rack number (0 – 31) by setting switches
on the adapter. A logical rack may be a single chassis; or two to four
chassis may comprise one rack number; or a single chassis can be
addressed as two racks. It is not necessary to assign rack numbers
sequentially: for instance, you could have a full rack 0, half a rack in rack
3, and a quarter rack in groups 6-7 of rack 7.
For addressing purposes, each rack is equivalent to a block of 8 I/O groups
in the I/O image table. Groups within a rack are numbered 0 through 7.
An I/O group is two 16-bit words, one from the output image table and one
from the input image table, with the same address. Refer to the I/O
Concepts Manual, publication 6008-6.5.1, for more information. In most
applications, only the input word or only the output word is used in any
given I/O group.
I/O Addressing

Chapter 1
Understanding I/O Scanner Concepts
1-4
Here is an example layout of the output image table showing the first
8 racks:
Group
word #
(hex) rack
0 1 2 3 4 5 6 7
00-07 0 xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
08-0F 1 xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
10-17 2 xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
18-1F 3 xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
20-27 4 xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
28-2F 5 xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
30-37 6 xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
38-3F 7 xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx
The word numbers above can be used as subscripts. (We’ll look closely at
that in chapter 6, Discrete I/O.) Each 16-bit word corresponds to 16
discrete I/O terminal positions, terminal 17 octal (15 decimal) to the
high-order bit and terminal 00 to the low-order bit.
Just as each I/O group has an address, so does each adapter. Adapter
addresses are used in the scan list (see page 1-6, What the Scanner Does).
The adapter address is the address of the first I/O group covered by the
adapter, divided by 2. This is numerically the same as (rack x 4) + (starting
group / 2), where the rack and group are both numbered from 0 through 7
as shown above. If you prefer, you can think of 1/4 racks being numbered
from 0 through 3, and then the adapter address is (rack x 4) + (quarter).
A slot is a position in an I/O chassis for one I/O module. In 1-slot
addressing, an I/O group represents a single slot. In 2-slot addressing,
an I/O group represents two slots.
Logical Rack / Starting Quarter and Link Addresses
Adapter link addresses are composed of a rack number concatenated with a
starting quarter for a given rack. The two low-order bits of the address are
the starting quarter of the rack, and the next 5 bits are the rack address.
The high bit is always zero when using the KTx.
Example: rack 7, starting quarter 3 has a link address of 00011111binary,
or 1F hexadecimal. In viewing the binary representation, the address
breaks down as follows: 0 – 00111 – 11. The high order bit is 0, the rack
address is 00111, and the starting quarter is 11.
Examine the examples on page 1-5.
Allen-Bradley Parts

Chapter 1
Understanding I/O Scanner Concepts
1-5
This
physical rack assumes 2 link addresses and
contains 3/4 of logical rack 2 and 1/4 of logical rack 3.
Rack 2 Rack 2 Rack 2 Rack 3
Quarter 2 Quarter 3 Quarter 4 Quarter 1
Link address
09H Link address
0CH
Full rack starting in first I/O group" 1
(second quarter) of rack number 2,
using 2slot addressing.
Here
2 physical racks, each with a link address,
comprise 3/4 of logical rack 4.
Link address
10H
Link address
11H
Rack 4
Quarter 1 Rack 4
Quarter 2 Rack 4
Quarter 3
Quarter rack starting in first I/O group" 0
(first quarter) of rack number 4, using
2slot addressing.
Half rack starting in first I/O group" 1
(second quarter) of rack number 4.
This
physical rack assumes 2 link addresses and
contains 2 full logical racks, 7 and 8.
Rack 7 Rack 7 Rack 8 Rack 8
Quarter 1,2 Quarter 3,4 Quarter 1,2 Quarter 3,4
Link address
1CH Link address
20H
Full
rack starting in first I/O group" 0
(first quarter) of rack number 7, using
1slot addressing

Chapter 1
Understanding I/O Scanner Concepts
1-6
Address Conversion
You can use the following macros to quickly perform conversions between
link and logical addresses and back again. The parentheses are necessary
to ensure operations are performed in the right order.
Link-to-Logical Address Conversion
To convert a link address to a logical address, shift right twice.
#define LINK_TO_LOGICAL(link,logical) ((logical)=((link)>>2))
Logical-to-Link Address Conversion
To convert a logical address to a link address, shift left twice and add the
starting quarter.
#define LOGICAL_TO_LINK(link,logical,sq) ((link)=(((logical)<<2)+sq))
Address Range
The 1784-KTxscanner will service as many as 32 logical racks (32
physical node addresses) with a maximum of 4096 discrete inputs and
4096 discrete outputs.
The scanner runs asynchronously in relation to the host, a personal
computer. When either one wants to get the other’s attention, it must issue
a hardware interrupt. Information is exchanged through dual-port RAM.
Both the host and the scanner can postpone servicing an interrupt if in the
middle of another interrupt-driven task.
The scanner maintains a scan list, which is a list of adapters to be serviced
by the scanner. A given adapter may appear once, several times, or not at
all in the scan list. The scan list is empty until you perform the scanner
commands to Autoconfigure or Set Scan List.
An exchange (or an adapter scan) is the scanner’s interchange of
information with one adapter. During an exchange, the scanner may
receive data or status information from the adapter or send data or
commands to the adapter, or both. Both block transfers and discrete I/O
transfers can be done during the same exchange if the adapter’s chassis
contains both kinds of I/O modules.
The host issues commands by writing to the dual port. The scanner
services commands as they arrive. If the current operating mode allows,
the scanner executes the command. If the scanner has a confirmation of
this command or of a previously executed command, it puts the
confirmation in the dual-port RAM and interrupts the host.
What
the Scanner Does
Allen-Bradley Parts

Chapter 1
Understanding I/O Scanner Concepts
1-7
The scan list is circular: each time the scanner reaches the end of the scan
list it starts again at the beginning. An I/O scan (sometimes called just a
scan) is one complete cycle by the scanner through the scan list, from any
point to the same point. Thus you can be certain that the I/O image tables
are refreshed once per cycle through the scan list.
The scanner has three modes of operation: Program, Test, and Run modes.
Discrete inputs are read in all three modes.
In Program mode, no discrete outputs are sent to the adapters, and the
adapters are instructed to hold all discrete outputs reset (zero).
The scanner holds any block transfer requests in its queue without
servicing them.
In Test mode, the adapters are still instructed to hold discrete outputs
reset, but the scanner sends discrete information to them. Block transfers
can proceed in test mode, but their outputs will be held reset.
In Run mode, discrete output information is sent to the adapters, and the
adapters are permitted to update the output modules. Block transfers
may be performed.
No link activity occurs until you send an Autoconfigure or Set Scan List
command. Then, when your program begins scanner operation, the scanner
is in Program mode. Your program must issue a command to change to
Run mode.
Dual-port RAM gives you almost 100% access to the interface at all times,
therefore your entire operation runs more quickly. The only time you will
be denied access is when the host and the KTx try to access the same
memory location at exactly the same time.
DATA
ADDRESS
DATA
ADDRESS
Host
processor
Dualport
RAM
2K
memory
KTx
processor
KTxcard
Operating
Modes
Dualport RAM

Chapter 1
Understanding I/O Scanner Concepts
1-8
The KTxscanner has built-in collision detection; an arbitrator governs
traffic in the dual-port RAM. When the KTxprocessor and the host
processor try to access the same dual-port RAM location simultaneously,
the processor that made the first request receives access.
The host has two primary responsibilities; it:
changes and monitors the flow of discrete data
issues scanner commands
Data Flow and Data Paths
Here is the path followed by a discrete input bit:
An external device causes an input terminal of a discrete input module
to turn “on.”
When next asked by the adapter, the input module reports the new input
information. The adapter updates its internal input image table by
setting the bit corresponding to the particular input point.
When next scanned by the scanner, the adapter reports the new input
information. The scanner updates the input image table in the dual-port
RAM by setting the bit corresponding to the particular input point.
Host may read the dual port (discrete data) at any time.
The path of an output bit is essentially the reverse of the input path:
Your program sets a bit in its output image table. Your program knows
that this bit maps to an output terminal on a particular output module.
When the scanner next scans the adapter controlling the particular
output module, it tells the adapter to update its output image table with
the new information.
The adapter tells the discrete output module to update its outputs with
the new information.
The discrete output module turns on the output. Any external device
attached to the output module then becomes active.
For timing information, see Timing of Discrete I/O in chapter 7,
“Understanding Discrete I/O.”
Host
Responsibilities
Allen-Bradley Parts

Chapter 1
Understanding I/O Scanner Concepts
1-9
Scanner Commands
As its second primary responsibility, the host issues these types of
scanner commands:
management commands
block-transfer commands
A management command affects the operation of the scanner itself. There
are five management commands:
Command Action
Set
Mode
changes the scanner's operating mode to Program,
Test, or Run mode
Autoconfigure goes on the link to see what devices are attached
Set Scan List changes the order in which adapters are scanned,
and their relative frequency
Get Scan List obtains a copy of the current scan list
Set Fault Dependent Group designates one or more groups of adapters such
that, if one adapter in a group is faulted, the
scanner instructs the others to be faulted also
The command/confirmation buffers are used to transfer scanner
management commands to the scanner and provide status information to
the host. In addition, this area of the dual-port RAM is used for block
transfers between the host and intelligent I/O devices in the I/O system.
Refer to chapter 4 for information about management commands.
There are two block-transfer (BT) commands:
Command Action
Host BT Read reads data from an intelligent I/O module and
returns data to the host
Host BT Write writes data supplied by the host into an intelligent
I/O module
Refer to chapter 5 for information about block transfers.
Chapter 2 describes scanner start-up and shutdown procedures.
What's
Next

Chapter 2
2-1
Startup and Shutdown
This chapter describes the start-up and shutdown phases of operation,
including:
using the KTx memory-mapped hardware
running diagnostics on the KTx card
running the host compatibility test (M16 diagnostics)
loading the protocol file
initialization
shutdown
Before you begin building your driver, you must be familiar with the KTx
card’s memory-mapped hardware. The following sections describe
memory-mapped hardware bytes :0800h through :080Fh, which may be
needed by your driver.
Assert (Release) Z80 (byte :0802h)
Write a 01h to this address to assert (release) the Z80 and begin execution
of the loaded binary file. Subsequent writes to this address while the Z80
is asserted will have no effect.
Deassert (Reset) Z80 (byte :0803h)
Write a 01h to this address to de-assert (reset) the Z80 and halt execution
of the loaded binary file. Subsequent writes to this address while the Z80
is de-asserted will have no effect.
Chapter
Preview
Using the KTx
Memorymapped Hardware
Allen-Bradley Parts

Chapter 2
Startup and Shutdown
2-2
KTxStatus Register (byte :0804h)
Important: This is a read-only byte.
This byte reports the status of several properties of the KTxcard.
This table describes what each bit contains.
Bit Status Code Meaning
70 = Z80 is deasserted
1 = Z80 is asserted
6 0 = Z80 is in the halt state
1 = Z80 is not in the halt state
5 0
4 0
3 0
2 0
1 0
00 = no hardware interrupt is currently asserted
1 = a hardware interrupt is currently asserted
(stays active till host writes 0x1 to 808)
Host Interrupt Acknowledge (byte :0808h)
Write a 01h to this address to acknowledge an interrupt from the KTx.
This will reset bit 0 of the status register.
Card Control Write Register (byte :080Ah)
Important: This is a write-only register.
Bit Status Code Meaning
7 unused
6
5
4
3
2
11 = puts the KTxinto E/ISA 16bit mode; will not work
with 8bit devices in the same 128K block of memory
0 = extended 16bit mode; can mix 8 and 16bit devices;
0 is the default.
01 = E/ISAlevel interrupts
0 = edgetriggered interrupts; 0 is the default.

Chapter 2
Startup and Shutdown
2-3
Card Control Read Register (byte :080Ch)
Important: This is a read-only register.
Bit Status Code Meaning
7state of LED
1 = on
0 = off
6color of LED
1 = red
0 = green
5blink state of LED
1 = blink
0 = no blink
4 reserved
3baud rate
00 = 230.4K baud
01 57 6K baud
201 = 57.6K baud
10 = 115.2K baud
11 = 230.4K baud
11 = puts the KTxinto E/ISA 16bit mode; will not work
with 8bit devices in the same 128K block of memory
0 = extended 16bit mode; can mix 8 and 16bit devices;
0 is the default.
01 = E/ISAlevel interrupts
0 = edgetriggered interrupts; 0 is the default.
When you cold boot the host PC, you also restart the KTxcard and place it
in a reset state. At this point, the KTxcard is ready for your driver to start
the power-on self-diagnostic tests before loading the protocol binary file to
the KTxcard.
Important: Since the self-diagnostic tests execute from the dual port,
you must run the dual-port functionality test before you run any of the
self-diagnostic tests.
Dualport Functionality Test
To check the functionality of the dual-port interface, follow these steps:
1. Clear the dual-port memory by writing 00h to dual-port locations
:0000h through :07FFh.
2. Read and check :0000h through :07FFh for compliance.
Running
Diagnostics
on the KTxCard
Allen-Bradley Parts

Chapter 2
Startup and Shutdown
2-4
3. Write FFh to dual-port locations :0000h through :07FFh.
4. Read and check :0000h through :07FFh for compliance.
Three Poweron Selfdiagnostic Tests: RAM, CTC, and SIO
Your driver must run these three power-on self-diagnostic tests (and they
must be performed in this order):
1. Random Access Memory (RAM) Test — file KTXST0.BIN
This test performs a pattern write to all of RAM and verifies this with
a read cycle. The test order is RAM1, RAM0, Dual-port RAM.
2. Counter Timer Circuit (CTC) Test — file KTXST1.BIN
This program performs a timing test on all KTxcard CTC channels.
3. Serial Input Output (SIO) Test — file KTXST2.BIN
This program performs a loopback test on the KTxcard SIO.
Table 2.A shows the diagnostics memory map associated with these tests.
Table 2.A
Diagnostics
Memory Map of Dual Port
Host Dualport Address Dualport Contents
:0000h - :07FDh KTXST0.BIN or
KTXST1.BIN or
KTXST2.BIN
:07FEh Status Code
:07FFh Done
These bytes are memory-mapped hardware addresses:
:0800h Reserved
:0801h Interrupt KTxby writing a 1
:0802h Assert (Release) Z80
:0803h Deassert (Reset) Z80
:0804h KTxstatus register
:0805h - :0807h Reserved
:0808h Ack KTxinterrupt by writing a 1
:080Ah Card Control Write Register
:080Ch Card Control Read Register
RAM CTC
SIO
This manual suits for next models
2
Table of contents
Other Allen-Bradley Scanner manuals

Allen-Bradley
Allen-Bradley 1747-SN User manual

Allen-Bradley
Allen-Bradley ControlNet 1747-SCNR User manual

Allen-Bradley
Allen-Bradley DeviceNet 1784-PCIDS Instruction sheet

Allen-Bradley
Allen-Bradley 1747-SN User manual

Allen-Bradley
Allen-Bradley Guardmaster SafeZone 3 User manual

Allen-Bradley
Allen-Bradley SafeZone typical User manual

Allen-Bradley
Allen-Bradley 857-RAA User manual