Browse
(440) 299-7778
Menu
(440) 299-7778
One-year parts and labor warranty30-day money-back guaranteeContact

The text of a manual · part 5 of 15

Communication Adapter Module (cat. no. 1771-KA2) User's Manual, pages 41 to 50

Pages 41 to 50 of 144

The original document is the PDF (2.0 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.

For the Allen-Bradley 1771-KA2

Page 41

Chapter 4 Commands

A write command can control data table words at any station processor. However, certain data table areas at each type of processor have a special function and should not be controlled by write commands. (Sections titled “Accessible Data Table Locations-PLC-2 Processors” and “Accessible Data Table Locations-PLC Processors” cover data table control.) Bit Write Commands

Bit write commands control the ON/OFF status of bits in a remote station data table. Unlike read or write commands, bit write commands do not transfer data table memory data. Instead, the programmed command rung itself specifies which bits are to be set on or off when the command is executed. (Refer to chapter 5.) There are 2 types of bit write commands that can be sent from a communication adapter module: Protected bit write Unprotected bit write The distinction between these commands is their memory access. Protected bit write commands are not executed by the receiving station unless a memory access rung defining the appropriate memory area is programmed at that station and switch 1 is set. Because this write protection feature allows added control over command execution, use of protected commands is recommended. A bit write command can control data table areas at any station processor. However, certain data table words at each type of processor have a special function and should not be controlled by bit write commands. (Data table control is the subject of sections titled “Accessible Data Table Locations-PLC-2 Processors” and “Accessible Data Table Locations-PLC Processors”). On each 1771-KA2 communication adapter module, the sending and receiving of write messages can be enabled or disabled by switch settings. (Refer to chapter 3.) Bit Write Access The bit write command can be used to control any accessible data table bit. However, this command must not be used to control the following: Any bit whose status is controlled by a programmed output instruction. Any bit in a byte that also contains program-controlled bits. 4-5

Page 42

Chapter 4 Commands

This first restriction simply states that no bit should be directly controlled, that is, addressed, by both an output instruction at its local station processor and a bit write command from some remote station processor. Bit write commands are generally used to set storage bits in a station processor data table. These storage bits may then be examined in the user program as conditions to energize an output bit. This indirect programming technique allows control using bit write commands, but helps to prevent the confusion that can result if an individual bit is controlled from both an OUTPUT ENERGIZE instruction and a bit write command. Figure 4.3 gives an example of an indirect programming technique used to control bit 01001, which is addressed by an output instruction, with a bit write command. Here storage bit 12104 is controlled by the bit write command. This bit is then examined by the program to control the status of bit 01001. The output bit, 01001, cannot be directly addressed by the bit write command. However, by controlling the storage bit and examining it in the program, the same effect is achieved.

Figure 4.3 Bit Control Use (example)

Control of this output desired. However bit already addressed by output intructions

Input 11113

Output 01001 a. Original Rung

Input 11113

Storage Bit 12104

Output 01001

Control bit through bit write command to control output 01001. b. Recommended Technique

4-6

Page 43

Chapter 4 Commands

The second restriction listed above applies when the destination station is a PLC-2 family PC. For these processors, when the station communication adapter module receives a bit write command it manipulates the 8-bit byte of the 16-bit memory word in which the addressed bit is located. (This may be the low byte, containing bits 00-07, or the high byte, containing bits 10-17.) Should program instructions control other bits within the same byte, there is a slight possibility that the communication adapter module may write over programmed status for these program-controlled bits. This would occur only if the program caused a bit to be altered during the time the communication adapter module was executing a received bit write command. Therefore, when using the bit write command, address only bits within a byte that is set aside exclusively for control by these commands. Read Command

The unprotected read command transfers word data from a remote station processor to the local station data table. A single unprotected read command can access from 1 to 122 consecutive data table words. The unprotected read command is not restricted by user programming. This command can read data table words from any remote station processor, regardless of either memory access rung programming or module switch settings. Because this command controls data table words at its local station processor, the rules for data table control apply when using this command. (Data table control is the subject of sections titled “Accessible Data Table Locations-PLC-2 Processors” and “Accessible Data Table Locations-PLC Processor”).

Accessible Data Table Locations When it executes a read, write, or bit write command, the communication - PLC-2 Processors adapter module controls data table locations at a station processor. This section outlines the recommendations for control of data table locations in PLC-2 family processors. A KA2 module executes read, write, or bit write commands to control any accessible data table words in any of these processors. It also controls user-selected status words in the data table of these processors. (Status words are described in chapter 6.) A KA2 can access most data table words. However, certain memory areas in these processors have special functions that prevent control of these areas by the module. The following are data table areas with a special function in these processors: 4-7

Page 44

Chapter 4 Commands

Processor work areas Input image table Word 027 Later paragraphs describe the limitations in controlling each of these areas. Access to all other data table areas is subject to the requirements of the programmer. Processor Work Areas The processor work areas for PLC-2 family processors are addresses 000-007 and 100-107. These areas are used for specific processor functions and are not accessible to commands from a station communication adapter module. The processor prevents an attempt to write data into this area from a remote station KA2. Note also that an attempt to read data from this area causes all 0’s to be read. Only privileged commands from a computer can write into or read from this area of the data table. Input Image Table The input image table areas for these processors are addressed as follows: PLC-2 processor: 110-127 PLC-2/30 processor: 110-177 PLC-2/20 processor: 110-177 Mini-PLC-2 processor module: 110-117 Mini-PLC-2/05 processor: 110-117 Mini-PLC-2/15 processor: 110-117 Please see appropriate processor manuals (Table 1.B) for details. This area of memory is updated each input scan. Any data written into it will be cleared on the next input scan. This limits use of the input image table as a storage area for values or bits. Note, however, that the input image table may be read from or written to another station. This control restriction applies only when attempting to write data into the input image table using a command from a communication adapter module. Word 027 Word 027 has a special function with PLC-2 family processors. For example, bits 02710-02717 are used for report generation; bit 02700 4-8

Page 45

Chapter 4 Commands indicates a low-battery condition. Because of these special functions, care must be exercised in controlling word 027 with a write or bit write command. The processor does not prevent data from being written to this data table word. Accessible Data Table Locations When it executes a read, write, or bit write command, the communication - PLC Processors adapter module controls data table locations at a station processor. When addressing a command to a Bulletin 1774 PLC processor, note that there are certain data table areas with a special function. These data table areas are not to be used for control by communication adapter module commands: Any input image table word that has a corresponding input module in a Bulletin 1778 or 1771 I/O rack Word 377 Word 000 Input Image Table When an input image table word in the PLC processor data table is unused, that is, has no corresponding input module in an I/O rack, that word can be used for storage. However, should an input module correspond to that word, the data in the word is updated from the input module each I/O scan. Note that this restriction does not prevent any word of the input image table from being written to another station. This control restriction applies only when attempting to write data into input image table locations. Word 377 Word 377 has special status functions within the PLC processor. For this reason, the communication adapter module must not execute write or bit write commands into this word. A read command from a local station can address word 377 at a remote station PLC processor.

4-9

Page 46

Chapter 4 Commands

Word 000 Reserve word 000 of the PLC processor output image table when using a KA2. This means that commands from another station must not be programmed to control word 000 or any of its bits. Accessible Data Table Locations Each PLC/PLC-2 station on a Data Highway can read from or write to - PLC-3 Processors only one specific buffer file at a PLC-3 station. That is the PLC-3 input file with a number that corresponds to the station number of the PLC/PLC-2 station. For example, the read/write files assigned to PLC/PLC-2 stations 1 to 100 (octal) would be as follows: PLC/PLC-2 Station Number (octal)

Assigned PLC-3 Input File for Read/Write Access

000 001

I001

002

I002

003

I003

004

I004

005

I005

006

I006

007

I007 I008 I009 (Not assigned)

010

I010

011

I011

012

I012

.

.

.

.

.

.

0770

I077

100

I100

PLC/PLC-2 station numbers are octal, while PLC-3 input files have decimal addresses. This means that PLC-3 input files with an 8 or 9 in their addresses are not used for read/write access by a PLC/PLC-2 station. The only exception to these rules is that station number 000 is assigned input file I008.

4-10

Page 47

Chapter 4 Commands

The PLC/PLC-2 station can use either protected or unprotected commands to access its assigned PLC-3 file. Note, however, that the PLC/PLC-2 station cannot access its assigned file until you create and allocate that file. To create a PLC-3 file, use the CREATE command described in the PLC-3 Programming Manual (publication 1775-6.4.1). Accessible Data Table Locations Programmable controllers can send the following non-privileged - PLC-4 Microtrol Processors commands to a 1773-KA interface module: unprotected read unprotected write unprotected bit write protected write protected bit write A 1773-KA module accepts non-privileged commands like other Data Highway interface modules with one exception: the 1773-KA module does not have memory protection rungs. Instead, you set switches that allow or disallow the module to receive protected and unprotected commands. The PLC-4 Microtrol controller uses a four-digit address for its input, output, flags, store, timer and counter bits. (Timer and Counter status bits require an additional two digits.) When you issue a command from another programmable controller or computer, do not enter these addresses; instead, enter an address code. It is important that you understand these addresses, however, to see how they relate to address codes.

4-11

Page 48

Chapter 4 Commands

The addressing scheme is summarized in this chart:

Table 4.A Internal Addressing of a PLC-4 Microtrol Controller Type of Address

Controller I.D.

Bit Address Range

I=Input

1-8

01-20

O=Output

1-8

01-12

X=Flags

1-8

01-32 (1)

S=Stores

1-8

01-99

Type of Address

Controller I.D.

Timer/Counter Number

T = Timer

1-8

01-32

Bit Description 15 - Timer Clock 16 - Enable 31 - Timer Timing 32 - Done

C = Counter

1-8

01-32

15 - Count -Down Enable 16 - Count-Up Enable 31 - Overflow Underflow 32 - Done

(1) Flag bits 31 and 32 have a special significance. See the PLC-4 Microtrol Product Guide (publication 1773-800).

The memory map for a PLC-4 Microtrol controller, ID #1, shown in Figure 4.4, includes data on inputs, outputs and flags of each active controller on the loop. Each member of the PLC-4 Microtrol loop, including the interface module, shares the status of the input, output, and flag bits for each controller on the loop. This becomes significant when you want to determine response time. Each time you enter a non-privileged command, you must enter an address code. This becomes significant when you want to determine response time. 4-12

Page 49

Chapter 4 Commands

Figure 4.4 Memory Map for Controller 1

Controller 1

20 inputs 1101–1120

Controller 2 Controller 3 Inputs, Outputs and Flags for each Controller on Loop

Controller 4

12 Outputs O101–O112

Controller 5 Controller 6

32 Flags X101–X132

Controller 7 Controller 8 S101–S199 Controller 1’s Stores

Timer/Counter 1

Accumulated Value 16

Controller 1’s Timers/Counters 1–32

15 Preset Value

32

31

Timer/Counter 32

Your Program

Sequencer Tables

Each time you enter a non-privileged command, you must enter an address code. This code designates what part of the controller’s memory the command will affect. Note that this is a code, and not a true memory address. A memory address code is a 3-4 digit code that represents a word (16 bits) in the data table of a PLC-4 Microtrol controller. The right-most digit of an address code represents the controller ID number in octal. For example,

4-13

Page 50

Chapter 4 Commands address code 010 addresses the first controller - controller 1 - while address code 011 addresses the second controller - controller 2. A PLC-4 Microtrol uses a decimal addressing scheme (Table 4.A). The PLC-2 family of programmable controllers use an octal addressing scheme. Thus, you must convert the PLC-4 Microtrol’s decimal addresses to octal. Address codes are divided into four sets: 1.

store words

2.

input, output, and flag words

3.

input, output and flag area

4.

timer/counter words

When using these address codes, observe these restrictions:

4-14

1.

Do not address more than one set at a time. For example, if you want to read both the store and the input words of controller 1, send one command to read the store area, and a second command to read the input words.

2.

Do not address more than one controller at a time. For example, if you want to read the store area of both controller 1 and controller 2, send two separate read commands.

3.

Do not send a command to a controller that is in program mode. A controller in program mode is not an active member of the loop, because its data table is not being updated.