Rockwell Automation 6008-SI User Manual

IBM PC I/O Scanner
(Cat. No. 6008-SI)
User Manual
Important User InformationImportant User Information
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 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 make notes to alert you to possible injury to people or damage to equipment under specific circumstances.
WARNING: Tells readers where people may be hurt if procedures are not followed properly.
CAUTION: Tells readers where machinery may be damaged or economic loss can occur if procedures are not followed properly.
Warnings and Cautions:
identify a possible trouble spot tell what causes the trouble give the result of improper action tell the reader how to avoid trouble
Important: We recommend that you frequently back up your application programs on an appropriate storage medium to avoid possible data loss.

Summary of Changes

Preface
Changes to Software
Use this document with revision 1.2 of the host software package for the IBM PC I/O Scanner. The host software has been updated to use Microsoft and Borland compilers.
The new information is marked with a vertical black bar in the margin.
You'll find this new information: On page:
Contents of host software package 41
Borland compiler
installing
compiling and linking
using the /d option
Microsoft compiler
installing
compiling and linking
43
412
411
45
414
i

Table of Contents

Important User Information
Summary of Changes
Changes
to Software
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using This Manual 11. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Manual's Audience 11 Related Required Hardware 11 Required Software 12 Source Code 12 Conventions 12
Objectives
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Publications
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
11. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
11. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
I/O Scanner Concepts 21. . . . . . . . . . . . . . . . . . . . . . . . . . . .
Chapter How Does the Scanner Relate to 1771-I/O 21 Terms 23 I/O Addressing 25 What the Scanner Does 26 Operating Modes 27 Global Data Paths 28 Scanner Commands 29 Host Watchdog 210 Scanner Watchdog 210
Objectives
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
RAM
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
21. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
27. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
I
i
i
Installation 31. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Chapter Using the Scanner with Other Products 31 Installation Procedure 35
Objectives
31. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Programming Overview 41. . . . . . . . . . . . . . . . . . . . . . . . . . .
Chapter Disk Inventory 41 Installing the Borland Version 43 Installing Writing Your Program 47 Compiling and Linking the Borland C++ 2.0 Version 412 Compiling and Linking the Borland Turbo C++ 1.0 Version 413
Objectives
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
the Microsoft V
41. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . .
ersion 45. . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . .
. . . . . . .
Table of Contentsii
Compiling and Linking the Microsoft C 5.1 or 6.0 Version 414. . . . . . . .
Further
Information
415. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Startup, Status, and Shutdown 51. . . . . . . . . . . . . . . . . . . . .
Chapter Overview 51 Startup 52 Host Watchdog 56 Scanner Shutdown 512
Discrete
Chapter Direct Image Table Access 61 Library Routines 64 Print or Display Image Table 69 Timing
Objectives
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Status
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
I/O
Objectives
. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
of Discrete I/O
51. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
57. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
61. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
61. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
610. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Scanner Management 71. . . . . . . . . . . . . . . . . . . . . . . . . . . .
Chapter Overview 71 Data Structure (Packet) 72 Executing a Management Request 73 Autoconfigure and Link Status Information 715 Configuration Fault and Fault Dependent Group Information Byte 717 Confirmation Status Codes 719 Print or Display Results 720
Objectives
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
Information Byte
. . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
71. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
716. . . . . . . . . . . . . . . . . . . . . . . . . .
Block Transfer 81. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Chapter Overview 81 QBT Data Structure (Packet) 82 Queueing a Block Transfer 84 Time Polling Confirmation Status Codes 811 Print or Display Results 812 Unsolicited Block Transfer 813 Block Transfer to PLC5's in Adapter Mode 813 Block Transfer to a 1771-DCM 817
Objectives
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
to Completion
for Completion
. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . .
81. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
86. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
88. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Table of Contents iii
General Support Features 91. . . . . . . . . . . . . . . . . . . . . . . . .
Chapter Timing Loops 91 Date and T Command Translation 95
Objectives
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ime Stamp
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
91. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
93. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
User Diagnostic Program 101. . . . . . . . . . . . . . . . . . . . . . . . . .
Chapter Starting the Program 102 Program Operation 103
Objectives
101. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Troubleshooting 111. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Chapter Troubleshooting the I/O Scanner 111
Objectives
111. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . .
Header Definitions A1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using This Manual
Chapter
1
Manual's

Audience

Objectives
This manual describes the operation and use of the IBM PC I/O Scanner (cat. no. 6008-SI) with the supplied host software driver. After reading this manual, you should be able to:
install the scanner board in your computer
write a program that runs on your computer to control the scanner for
your application
diagnose and correct most of the problems that might occur.
This manual begins with an introduction to I/O scanner concepts and proceeds to detailed instructions on how to install and program your scanner.
We assume that you have experience in system development and integration and in writing software for the IBM Personal Computer family or compatibles. We also assume that you have a working knowledge of the C programming language, including the concepts of structures and pointers. Prior knowledge of Allen- Bradley 1771 Series I/O products is helpful but not essential.

Related Publications

Required Hardware

Use this manual with its companion manual, the I/O Concepts Manual. Refer to the manuals that accompany the 1771 Series I/O modules and hardware you intend to use with your system.
You need a computer from the IBM Personal Computer series, such as the PC/AT or PC/XT, or a compatible such as the Allen-Bradley Industrial Terminal T50, T60, and T35. The scanner board is installed inside the computer.
The choice of 1771 Series I/O modules depends on your application.
A printer attached to your computer may be helpful but is not required.
1-1
Chapter 1
Using This Manual
Required
Software

Source Code

Conventions

You need the MS–DOS operating system, version 3.0 or higher. If you’re using the Microsoft C version of the scanner driver software, you’ll need a Microsoft C compiler, version 5.1 or higher (version 6.0 recommended). If you’re using the Borland C version of our software, you’ll need a Borland C compiler, Turbo C++ 1.0 or higher (Borland C++ 2.0 recommended).
Source code for library routines and the interrupt handler is available for a nominal charge. To obtain source code, you must contact Order Services and request 6008-SIDC software. They will ship you a license agreement. Return the signed agreement. A-B source code will be supplied on
3.5-inch and 5.25-inch diskettes.
In this manual, this type is used for special names, such as names of files and C language identifiers.
The hexidecimal equivalent of selected error codes and commands are given in the header definition files found in appendix A at the back of this manual.
Numbers in this document are in decimal unless otherwise noted. Binary numbers are marked with a trailing (binary), and hexadecimal numbers with a trailing (hex); for example, 11010(binary) = 26 = 1A(hex).
Bits are numbered so that bit 0 is the low-order bit. For example, bit 4 is four bits left of bit 0 and has a value of 2
4
=16. Following C conventions,
array subscripts start at 0.
1-2
I/O Scanner Concepts
Chapter
2
Chapter
Objectives

How Does the Scanner Relate to 1771-I/O

This chapter explains basic concepts and provides an overview of the operation of the IBM PC I/O Scanner. After reading this chapter you should understand:
how we use certain words with special meanings in this manual how information moves between your program and the outside world how your program can issue commands to affect operation of the
scanner
how the safety features, called watchdogs, work
The scanner uses the 1771 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 card that you install in the host computer (or host). Typical hosts are the IBM PC/AT class (including the Allen–Bradley T50, T60, and T35 Industrial Terminals and 6121 Industrial Computer) and the IBM PC/XT class of machines (including the Allen–Bradley 6120 Industrial Computer).
IBM PC Hardware
Host
Processor
(i.e. 80286)
IBM PC
1771-I/O Protocol
6008-SI
1771-I/O Hardware
1771-AS
or
1771-ASB
or
1771-DCM
1771-I/O Bus
1771-JAB
Universal I/O
Single
Point
I/O
2-1
Chapter 2
I/O Scanner Concepts
I/O modules sit in one or more chassis. An I/O chassis is a housing that holds one adapter and 1, 2, 4, 8, 12, or 16 I/O modules. The adapter is the communication interface between the scanner and the chassis. The scanner communicates with the adapter through shielded two–conductor twisted–pair cable (the “blue hose”). In turn, the adapter monitors and controls the I/O modules through the backplane of the chassis. You can connect up to 16 chassis to the scanner on the blue hose. You can combine chassis in any way that results in 8 or less rack addresses.
Adapter
Industry
Host
Processor
I/O Chassies can contain 8 bit, 16-bit, or 32-bit discrete I/O modules. Analog, and/or intelligent I/O modules.
You address them using 1/2 slot, 1-slot or 2-slot addressing
Bus
I/O Chassis
SI Scanner
Remote I/O Cable
I/O Chassis
Adapter
I/O Chassis
Adapter
2-2
I/O Chassis
Adapter
14652
Chapter 2
I/O Scanner Concepts
We can divide I/O, and therefore I/O modules, into discrete and intelligent modules.
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 1024 input and 1024 output image table bits (64 x 16 bits = 1024 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 (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.

Terms

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 or read BT transfers information (typically analog input and status data) from the module to the host; a BT write or write BT transfers data (typically analog output and configuration data) from the host to the module.
You should become familiar with these terms used to describe the I/O subsystem.
Input image table: An area of memory that monitors input terminals of input modules. When an input switch is closed, its corresponding input bit is set. 64 16–bit words (1024 points) are available.
Output image table: An area of memory that controls output switches of output modules. When a bit is set, its corresponding output is energized. 64 16–bit words (1024 points) are available.
Discrete I/O: I/O characterized by one terminal per image table bit (terminal and point are the same).
Standard density module: Discrete I/O module having four, six, or typically eight input or output points.
High density module: Discrete I/O module having 16 input or output points.
2-3
Chapter 2
I/O Scanner Concepts
Quad density module: Discrete I/O module having 32 input or output points.
I/O chassis: One of four different housings sized to hold either four, eight, twelve, or sixteen discrete I/O modules.
Slot: Position in an I/O chassis the width of one discrete I/O module. I/O group: An addressing concept representing 16 input bits (one input
image table word) and
16 output bits (one output image table word).
In hardware, an I/O group can represent one or two slots in an I/O chassis. It has an address number.
Half–slot addressing: Addressing where an I/O group represents a half of a slot.
One–slot addressing: Addressing where an I/O group represents one slot. Two–slot addressing: Addressing where an I/O group represents two
slots. I/O rack number: An addressing concept representing 8 I/O groups. An
I/O rack number can be distributed over one, two, three, or four I/O chassis; or two rack numbers can be assigned to one I/O chassis, depending on chassis size and your application requirements.
Module address: An address that defines the physical location of the module in the I/O chassis by its I/O rack number and starting slot number.
I/O update: The scanner’s serial scan of all I/O chassis in the I/O subsystem. This scan is asynchronous to scans between the scanner and host processor.
Scan list: A list specifying the order in which I/O adapters are to be scanned. It is specified by the host and sent to the scanner module as a scanner management command. Although a maximum of 16 I/O adapters is allowed, the scan list can specify a maximum of 64 I/O adapters. This is done to allow the scanner to scan adapters more than once during its scan cycle if more frequent updates are desired.
2-4
Block transfer: The transfer of data to or from an intelligent I/O module up to 64 words at a time.
Scanner management request: A command from the host to the scanner used to control and configure the scanner board.
Chapter 2
I/O Scanner Concepts
Fault dependent group: A group of I/O adapters treated as a single entity for the purposes of fault detection. If one of the defined group faults all in the group are in fault.

I/O Addressing

You assign each adapter an I/O rack number (0 to 7) by setting switches on the adapter. A rack may be single chassis; or two to four chassis may be comprised in 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 from 0 to 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. (Please refer to the I/O Concepts Manual for more information.) In most applications, only the input word or only the output word is used in any given I/O group.
Here is an example layout of the output image table:
Group
word # (hex) rack
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
0 1 2 3 4 5 6 7
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, What the Scanner Does, below). 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 to 7 as shown above. If you prefer, you can think of 1/4 racks being numbered from 0 to 3, and then the adapter address is (rack x 4) + (quarter).
2-5
Chapter 2
I/O Scanner Concepts
A slot is a position in an I/O chassis for one I/O module. In one–slot or single–slot addressing, an I/O group represents a single slot. In two–slot or double–slot addressing, an I/O group represents two slots.
What
the Scanner Does
The scanner runs asynchronously in relation to the host. When either one wants to get the other’s attention, it must issue a hardware interrupt. Information is passed through a global RAM. Both the host and the scanner have the ability to 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 AUTOCONFIGURE at which point AUTOCONFIGURE puts every adapter in the list once.) The scan list starts as simply the list of adapters, each occurring once, but your program can issue a scanner command to alter the 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.
After servicing each adapter, the scanner looks at its command queue to see if any commands are waiting. If so, and if the current operating mode allows, the scanner executes one command. If the scanner has a confirmation of this command or of a previously executed command, it puts the confirmation in the global RAM and interrupts the host.
2-6
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.
Every time the host interrupts the scanner, the scanner puts a marker in the scan list at the point of the adapter most recently scanned. If the scanner works its way through the scan list to the same point without receiving an interrupt from the host, the scanner interrupts the host. (If the scan list contains no adapters, the scanner waits for 5 ms before interrupting the host.)
Chapter 2
I/O Scanner Concepts
Thus you can be certain that the I/O image tables are refreshed once per scan list. Partial refreshes take place more frequently if your program executes a lot of block transfers or management requests: whenever the global ram is transferred the I/O image tables are refreshed as far as the scanner has got in the scan list since the last interrupt. Your program can also force a partial refresh: see the update function in chapter 6, Discrete I/O.
Operating
Modes

Global RAM

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.
When your program first starts up scanner operation, the scanner is in program mode. Your program must issue a command to change to run mode.
The scanner has a 2048–byte area of RAM that we call a global RAM, shared by both the IBM PC and the scanner. This is not a true global RAM, because the host and the scanner can’t access it at the same time. Instead, the host and the scanner exchange control of the global RAM by means of interrupts. When the scanner interrupts the host, the scanner is turning over control of the global RAM to the host. When the host interrupts the scanner, either the host has the global RAM and wants to return it or the host doesn’t have the global RAM but wants access to it.
Access to the global RAM is ultimately controlled by hardware and by scanner firmware. For the host side, we supply an interrupt handler or interrupt service routine that is automatically invoked whenever the scanner interrupts the host. Our interrupt service routine copies information as needed between your program’s data area and the global RAM.
2-7
Chapter 2
I/O Scanner Concepts
Because our interrupt handler takes care of all details of the global RAM, you don’t have to be concerned with the bits and bytes. You should know that the global RAM contains two kinds of information:
the I/O image tables are comprised of an output image image table and
an input image table. Every time control of the global RAM is transferred, the interrupt routine copies new inputs to your program’s data area from the global RAM and new outputs from your program’s data area to the global RAM.
a mailbox area is where the host can send commands to the scanner and
the scanner sends back confirmations and data. A list of commands is given later in this chapter.
Data
Paths
Here is the path followed by a discrete input bit:
An external device causes an input 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 global RAM by setting the bit corresponding to the particular input point.
The host interrupt handler reads the input image information in the
global RAM and copies it to a duplicate input image table available to your program. Your program now knows that an input on a particular input module is “on.”
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 on a particular output module.
2-8
The scanner interrupts the host, the interrupt handler copies your
program’s output image for that rack to the global RAM.
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.
Chapter 2
I/O Scanner Concepts
The discrete output module turns on the output. Any external device
attached to the output module then activates.
For timing information, please see Timing of Discrete I/O in chapter 6, Discrete I/O.

Scanner Commands

There are two types of scanner commands, block transfers and management requests. There are two block transfer commands (BT commands):
block transfer read
block transfer write
A management request affects the operation of the scanner itself. There are six management requests:
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
scan list changes the order in which adapters are scanned, and their
relative frequency
link status asks the scanner to report all information it has about the
adapters that are connected
setup changes the baud rate and connects or disconnects the line
termination resistor
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 control/status and general data areas are used to transfer scanner management commands to the scanner and provide status information to the host. In addition, this area of the global RAM is used for block transfers between the host and intelligent I/O devices in the I/O system.
2-9
Chapter 2
I/O Scanner Concepts

Host Watchdog

Scanner W
atchdog
Suppose that your program crashes, either because of logic errors or because of operator intervention. Or suppose that through logic errors your program gets into an infinite loop. In these cases the program is no longer sending meaningful information to the scanner through the interrupt handler. There is no way for the interrupt service routine (ISR) to recognize all possible host program failures reliably, so instead a “host watchdog’’ scheme has been implemented.
In essence, your program must take a particular action every so often (by default, every second). If the ISR recognizes that the required action has not been taken recently enough, the ISR infers that your program has failed and simply stops talking to the scanner. The scanner in turn recognizes this as a host failure and goes off the link within 50 ms; all the adapters go inactive and output terminals go to last state or reset as determined by switches you set on the chassis.
We’ll tell you about the necessary programming steps in chapter 5, Startup, Status, and Shutdown.
If the host computer doesn’t respond to an interrupt from the scanner within 100 ms or less, the scanner assumes that the host hardware and BIOS is no longer active. In this case the scanner goes off the link, and 50 ms later the adapters set the output modules in last state or reset according to your switch settings. The scanner then goes into its power–up sequence, waiting for new startup commands from the host.
This scanner watchdog feature lets you end one program run and start another without cycling host power. Even if your program locks up the host computer, if you are able to do a soft reset (
Ctrl–Alt–Del) the scanner
is ready and waiting for your program. More importantly, if your program fails or is interrupted, even by a reboot of the computer, all discrete outputs are in last state or reset, according to the switches you set on the adapters.
2-10
Installation
Chapter
3
Chapter
Objectives

Using the Scanner with Other Products

This chapter explains how to install the IBM PC I/O Scanner. After reading this chapter you should be able to:
determine whether you already have hardware or software products
installed that would conflict with the scanner
configure the scanner board for a suitable address in your host’s RAM
install the scanner board in the host
connect the 1771 Series I/O cable to the scanner.
In this manual, we do not explain how to cable and configure 1771 Series I/O products. For that information, please refer to the manuals that came with those products.
You need to be aware of possible hardware or software conflicts between other products and the scanner. In this section we point out the hardware and software features in the scanner that might lead to conflict with other products, and where possible we tell you how to avoid those conflicts. However, there are so many add-ons available that we cannot guarantee that the scanner works with any particular one.
Hardware Interrupt
On the system board, the scanner can use interrupt request lines IRQ3, IRQ5, IRQ10, and IRQ12. These interrupt request lines are selected by positioning the jumper located on the scanner board. Results are unpredictable if any other devices use these lines. In particular, you can’t have two IBM I/O scanners operating in the same host, since the host software cannot direct Allen-Bradley I/O calls to a particular scanner board.
Allen-Bradley products that use the IRQ3 include the 1784-KTP and the 6121-CBB ‘combo’ card (used with the 6120 and 6121 Industrial Computers).
3-1
Chapter 3
Installation
IBM’s Technical Reference Manuals show line IRQ3 used by the secondary serial port (COM2 device). If you have 2 serial ports active on your host computer and you have selected IRQ3, you must disable COM2 before installing the scanner board. (Many multi-junction cards have jumpers to disable this port; see your manufacturer’s documentation for details.)
CAUTION: If you have other cards that use the interrupt line you have selected, (IRQ3, IRQ5, IRQ10, or IRQ12), physically disconnect them to avoid damaging the 6008-SI or other cards.
To change the interrupt request line setting, complete these steps:
1. Remove the cover from the computer that contains the I/O scanner.
2. Remove the I/O scanner from the computer.
3. Remove the four screws securing the daughterboard to the main
board. Unplug and remove the daughterboard.
4. Locate the double row of stake pins on the main board (see
Figure 3.1). A jumper plug connects 2 pins to select the interrupt request line.
Figure 3.1 Location
of Interrupt Request Line Jumper Plug
Note: Interrupt line designations are
not actually shown on the board.
11 20
Default setting
IRQ3
35
3-2
Chapter 3
Installation
5. To change the setting, pull the jumper off the pins and reposition it on
the pins for the interrupt line you desire. See Table 3.A for interrupt request line definitions.
Table 3.A Interrupt
Request Line Definitions
Interrupt Line: Explanation:
IRQ3 Default setting. Conflicts with COM2 port on machines so equipped.
Conflicts with the KTP card.
IRQ5 This setting conflicts with the hard disk controller when the card is
used in an IBMXT or AT clone. This setting would also conflict with the LPT2 port on machine so equipped.
IRQ10 Not available on IBMXT. Not assigned on 1784T50 or IBMAT, but
may conflict with 3rd party boards.
IRQ12 Not available on IBMXT. Not assigned on 1784T50 or IBMAT, but
may conflict with 3rd party boards.
6. Write your application software to use the newly selected interrupt
request line setting.
Software Interrupt
The host receives interrupts from the scanner through the selected line (IRQ3, IRQ5, IRQ10, or IRQ12). Table 3.B lists the software interrupt vectors.
Table 3.B Software
Interrupt Line: Software Interrupt Vector:
IRQ3 0Bh
IRQ5 0Dh
IRQ10 072h
IRQ12 074h
Interrupt V
ectors
Results are unpredictable if you have any other hardware that uses interrupt IRQ3, IRQ5, IRQ10, or IRQ12 (It is likely that the other software simply ceases functioning while your scanner 0 interface program is running, but we cannot guarantee that this is the only result).
The scanner driver routines also use the timer follow–on interrupt, number 1Ch. After its own processing, the scanner code will call any previously set follow–ons to interrupt 1Ch. If the other software is taking too great a portion of system resources, your scanner application program may not operate correctly.
3-3
Chapter 3
Installation
Despite IBM recommendations to the contrary, some resident software uses the system timer hardware interrupt, number 8, rather than the follow-on described in the preceding paragraph. The scanner may work erratically or may fail to work at all if such programs are active when a scanner program is started.
I/O Ports
The scanner does not use any I/O ports.
RAM Address
DIP switches on the scanner board let you configure it to any starting address in RAM, from 0400(hex) to FC00(hex), in increments of 4000(hex) = 16 K bytes. (The scanner cannot be configured to operate in extended or expanded memory.) The scanner board occupies 1801(hex) (6K+1) bytes beginning at the address you select. You are responsible for selecting an address that starts at a free 6K+1 byte range.
The documentation for each of your add-on boards should tell you which addresses (if any) it uses in system RAM. In addition, we can tell you about the following common memory uses:
monochrome display memory: B000(hex)-B7FF(hex)
color/graphics display memory: B800(hex)-BFFF(hex)
Enhanced Graphics Adapter memory: C000(hex)-C3FF(hex) for the
BIOS, plus an area that could be as large as A000(hex)-BFFF(hex), depending on the display mode
hard disk BIOS (on the PC XT, not the PC AT):
C800(hex)-CBFF(hex) for the first controller, CC00(hex)-CFFF(hex)
for the second controller if a second one is installed
cartridge ROM reserved area: E000(hex)-EFFF(hex) on some systems
ROM BIOS: F000(hex)-FFFF(hex)
Use the above information, and documentation from the manufacturers of your add-on boards, to select an area of memory that is available for the scanner. During the installation process you’ll set switches according to the memory area you select.
3-4
Chapter 3
Installation
Installation
Procedure
The procedure of installing the scanner board in the host has three main steps:
1. Set the scanner board switch block for the memory address you
selected earlier.
2. Plug the scanner into a slot in the host computer.
3. Connect the I/O cable to the scanner.
In this section we’ll look at those steps in detail.
Switch Settings
The scanner board has one block of ten DIP switches to be set at installation time.
Figure 3.2
Switch Location on Scanner Board
Dip
Switches
(Close)
on
(Open)
off
Set switches 710 open for PC/XT (6120) Set switches 710 closed for PC/AT (T50, 6121, 6122)
(photo shows switches set for PC/AT)
Set switches 1-6 set for RAM address. (photo shows switches set for RAM address C4000)
3-5
Chapter 3
Installation
The factory sets the switches for memory address C000(hex) for an IBM PC AT or other machine with a 16-bit bus. If you’re running on a PC XT or another 8-bit bus machine, or if you want to configure the scanner at an address other than C000(hex), you’ll have to change the switches.
First set switches 7 through 10 to all closed for a PC AT or similar, all open for a PC XT or similar. The factory setting is all closed, for a PC AT or other machine with a 16-bit bus.
Next set switches 1 through 6 for the memory address you selected. Table 3.C shows the correct setting of switches 1 through 6, in that order, for every hex address below F000, where
O is an open switch and c is a
closed switch:
Table 3.C Dip
Switch Settings for Memory Address (Switches 1 through 6)
Hex
Address
0400 Occ ccc 5000 ccO cOc A000 ccc OcO
0800 cOc ccc 5400 OcO cOc A400 Occ OcO
0C00 OOc ccc 5800 cOO cOc A800 cOc OcO
1000 ccO ccc 5C00 OOO cOc AC00 OOc OcO
1400 OcO ccc 6000 ccc OOc B000 ccO OcO
1800 cOO ccc 6400 Occ OOc B400 OcO OcO
1C00 OOO ccc 6800 cOc OOc B800 cOO OcO
2000 ccc Occ 6C00 OOc OOc BC00 OOO OcO
2400 Occ Occ 7000 ccO OOc C000 ccc cOO
2800 cOc Occ 7400 OcO OOc C400 Occ cOO
2C00 OOc Occ 7800 cOO OOc C800
3000 ccO Occ 7C00 OOO OOc CC00 OOc cOO
3400 OcO Occ 8000 ccc ccO D000 ccO cOO
3800 cOO Occ 8400 Occ ccO D400 OcO cOO
3C00 OOO Occ 8800 cOc ccO D800
4000 ccc cOc 8C00 OOc ccO DC00 OOO cOO
4400 Occ cOc 9000 ccO ccO E000 ccc OOO
4800 cOc cOc 9400 OcO ccO E400 Occ OOO
4C00 OOc cOc 9800 cOO ccO E800 cOc OOO
1
Not available for the IBM PC XT
2
Recommended for IBM PC AT computers with EGA and VGA graphics
Switch
Setting
Hex
Address
9C00 OOO ccO EC00 OOc OOO
Switch Setting
Hex
Address
1
cOc cOO
2
cOO cOO
Switch Setting
3-6
Chapter 3
Installation
Plugging in the Board
The scanner board requires two slots. (Any two adjacent slots will do: the board doesn’t have to be plugged into any particular slot.) The Installation and Setup manual from IBM, or the corresponding manual from the maker of your host computer, explains in detail how to install any add-on board. (See the Internal Option Installation Instructions section in the IBM manual.)
Host Bus Speed
The scanner is designed to operate on a standard 6 to 8 Mhz IBM AT bus. Newer 386 PC compatibles operate their busses at faster rates (11 or 12 Mhz) with no wait states. The scanner will not synchronize properly at these higher rates and will return a 102 error code at the completion of the setup command. Most of the faster 386 PC compatibles have a setup screen that allows you to choose the standard IBM AT bus speed. The standard bus speed must be chosen in order for the scanner to operate properly.
Attaching the I/O Cable
The 1771 Series I/O cable (the “blue hose”) terminates in a 15-pin female D-shell connector, and the scanner has a 15-pin male connector accessible through the rear cover of the host computer. Connect the cable to the scanner and your installation is complete.
Table 3.D
I/O Cable Connections
1771
Scanner: Cable: Adapter:
pin 8 blue terminal 1
pin 7 shield terminal 2
pin 6 clear terminal 3
3-7
Chapter 3
Installation
Line Termination Resistor
1 2
3 4
5
6 7
8
9 10 11
12
Figure 3.3 Connecting
1 2
3 4
5
6 7
8
9 10 11
12
1771 I/O Cable in Parallel
Pin 8
Blue
Shield
White
Pin 1
D-shell
Connector
(back view)
Twinaxial Cable
Blue
Shield
White
1 2
3 4
5
6 7
8
9 10 11
12
1 2
3 4
5
6 7
8
9 10 11
12
Swingarm 1771WB
Swingarm 1771WB
Swingarm 1771WB
Note:
Use the setup command to disconnect the shunt
line termination resistor in the scanner.
You can connect a maximum of 16 swingarms.
Use termination resistor on the last swingarm.
Swingarm 1771WB
14864
3-8
Chapter 3
Installation
D-shell
Connector
(back view)
Figure 3.4 Connecting
Pin 1
White
Blue
Twinaxial Cable
Pin 8
1771 I/O Cable in Series
Blue
Shield
Twinaxial Cable
White
Swing-Arm Swing-Arm
1771-WB 1771-WB
Note:
Use the setup command to disconnect the shunt
line termination resistor in the scanner.
You can connect a maximum of 16 swingarms.
Use termination resistor on the last swingarm.
14865
3-9
Chapter
Programming Overview
4
Chapter
Objectives

Disk Inventory

This chapter gives you a general overview of the programming process. After reading this chapter you should be able to:
identify the purpose of every file on your distribution disk
install the software on your hard disk (if you have one)
recognize the special features of source code for a program that
interfaces with the scanner
select names for your variables that won’t conflict with the names in the
programs we supply
select the necessary options to compile and link a scanner interface
program.
The host software is shipped on a single 720K (3.5”) diskette, for use with Borland and Microsoft compilers. The disk contains an include file required with all your programs; run–time libraries in the small, compact, medium, large, and huge memory models; and source and executable code for the diagnostic program described in chapter 10, User Diagnostic Program.
The host software package also includes two 360K 5.25-inch diskettes, one for use with Borland compilers and the other for use with Microsoft compilers. The combined contents of these two diskettes is identical to the contents of the 720K diskette.
Table 4.A lists the contents of the host software package.
Table 4.A
Contents
File: Contents:
H_6008SI.H include file
6008SI?M.LIB run-time libraries compiled with Microsoft C 6.0A
6008SI?B.LIB run-time libraries compiled with Borland C++ 2.0
U_D1M.EXE user diagnostic program (Microsoft C version)
U_D1B.EXE user diagnostic program (Borland C version)
of Host Software Package
4-1
Chapter 4
Programming Overview
Table 4.B lists the rest of the files that make up the source code for the user diagnostic program:
Table 4.B
Code for the User Diagnostic Program
Source
File: Contents:
U_D1.C main program
U_D1.H include file for the U_*.C files
U_BT.C single block transfers
U_BTC.C continuous block transfers
U_BTM.C multiple block transfers
U_DISC.C fullscreen discrete I/O
U_GET.C keyboard handler
U_GROUP.C singlegroup discrete I/O
U_MR.C management requests
U_PICK.C main menu
We provide the diagnostic program source files so that you have extended examples of successful programming for the scanner. You should feel free to experiment by modifying them, though we cannot support any modified program versions.
Important: All of the files on the diskettes are Copyright
(C)Allen-Bradley Company and may not be distributed or copied (other
than from the distribution disk to your hard-disk or working diskette) without our permission.
All of the source files are identical between the two diskettes. The run-time libraries are different and have different names, as explained below. The executable programs work the same, but contain different code because they were compiled with different compilers.
If your system is equipped with a hard disk, please read the installation hints for the Borland or Microsoft version, below. (We provide hints rather than firm instructions because your hard disk could be organized in many ways for system development.)
If your system doesn’t have a hard disk, you can write and run scanner programs using just floppy drives. Please consult your compiler and linker manuals for instructions on organizing your floppy disks.
4-2
Chapter 4
Programming Overview

Installing the Borland Version

This section provides installation suggestions. Feel free to modify this procedure according to your own configuration.
Important: We recommend that you make backup copies of the distribution disks and keep the originals in a safe place, away from your computer and away from stray magnetic fields.
Please make sure that your compiler is installed according to Borland’s instructions before you follow the procedure below.
If you have a: Then:
3.5inch floppydisk drive Write protect the supplied 720K diskette (or your backup copy) by sliding the write-protect tab so that a hole shows through the diskette casing. Insert the diskette in the floppydisk drive.
5.25inch floppydisk drive Write protect the supplied 360K diskette labeled `Borland C version' (or your backup copy) by applying a standard adhesive foil write-protect tab. Insert the diskette in the floppydisk drive.
In the command examples below, we assume you’re using the a: drive, so please substitute b: if appropriate. We also assume that your hard disk is drive c: –– again, please substitute another drive letter if appropriate.
There are two main approaches: either copy the scanner’s include file and libraries into the directories with the compiler–supplied files, or copy the scanner files into the work directory where you’ll be developing software.
Method 1: Scanner files in same directories as compiler files
1. Change to the root directory for the compiler. If you used Borland’s
default installation, the command will be one of the following:
for Borland C++ 2.0: cd \borlandc
for Turbo C++ 1.0: cd \tc
The command will be different if you performed an installation to a directory other than Borland’s default.
2. Copy the header file and libraries, like this:
copy a:h_6008si.h c:include copy a:6008si?b.lib c:lib
You’ll see five libraries copied, for the small, compact, medium, large, and huge memory models.
3. Create your development directory using the md command, and
change to that directory by using the cd command.
4-3
Loading...
+ 106 hidden pages