The text of a manual · part 6 of 15
Communication Adapter Module (cat. no. 1771-KA2) User's Manual, pages 51 to 60
Pages 51 to 60 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 51
Chapter 4 Commands
Chapter Summary
This chapter told you about the 1771-KA2’s: Station terminology Commands, protected and unprotected, reads & writes Processors’ input image table addresses, locations In chapter 5 you will learn about rungs, codes, and more commands.
4-15
Page 52
Chapter 4 Commands
4-16
Page 53
Chapter
5
Communication Zone Rungs
General
At the beginning of the ladder-diagram program, you enter a special set of rungs that dictate communication adapter module activity. The KA2 scans this set of rungs at power-up for operating information.
WARNING: Do not make on-line edits of the communication zone. Since the module scans the communication zone only when it powers up or when the processor changes state (from program to run), the changes will not affect module operation until you cycle power to the 1771-KA2 module or change the operating mode of the processor. Attempting such edits may cause unexpected communication on the Data Highway.
Communication zone rungs use the standard controller instruction set. However, the meaning of these instructions and addresses differs significantly from their meaning in standard ladder-diagram programming. For this reason, each programmed element in a communication zone rung must be understood as it is described in this chapter, not as it would normally be understood in a ladder- diagram logic context. In several instances, the 3- or 5-digit number entered above the communication zone rung element has no relation to an actual data table address. This chapter specifically identifies this type of number as either a station number or code. Where one of these designations is given, the actual data table bit or word at that address is not affected by KA2 module operation and may be used in the balance of the user program. For the purpose of this description, the reference point is termed the local station. All other stations are then considered remote stations. These rungs are entered at the local station so that it can send commands to, or receive commands from a remote station. Obviously, this reference point is not fixed. Each station - as it is being programmed - is considered the local station at that time. 5-1
Page 54
Chapter 5 Communication Zone Rungs
Overall Format The overall format for the communication zone of program is shown in Figure 5.1. This figure shows each type of rung that can be entered in this zone. The actual communication zone rungs for any station processor may vary significantly from those shown in Figure 5.1. The length of this program area is a function of the number of remote stations processors with which the local station processor communicates and the number of transmissions of data with these remote stations.
Figure 5.1 Communication Zone Format (general)
Header Rung 1
Memory Access Rung
Start 011 [G ]
077 [G ]
015 [G ]
020 [G ]
070 [G ]
076 [G ]
017 [G ]
022 [G ]
022 [G ]
017 [G ]
063 [G ]
065 [G ]
010 [G ]
060 [G ]
062 [G ]
03210 02000 ] [ ] [
016 [G ]
022 [G ]
024 [G ]
02707 ( L ) OFF 02707 ( )
Command Rungs Read/ Write
Bit Write
03211 01702 12000 12001 12002 12003 ] [ ] [ ] [ ] [ ] [ ] [
02707 ( )
02707 ( )
12004 12005 12006 12007 ] [ ] [ ] [ ] [ 12010 12011 13511 12600 ] [ ] [ ] [ ] [ Delimiter Rung 1
5-2
02707 ( U ) 1
Header and delimiter rungs are required for each station processor. Memory access and command rungs are programmed as needed.
Page 55
Chapter 5 Communication Zone Rungs
The order of these communication zone rungs is as follows: 1.
Header rung
2.
Memory access rung(s) (as needed)
3.
Command rung(s) (as needed)
4.
Delimiter rung
These rungs must always appear in this order at the beginning of the ladder diagram program. If you are using two KA2 modules, or a combination of KA2 and -KG modules with the same processor, enter one immediately after the other. As a minimum requirement, each station processor must have a header rung and a delimiter rung. This provides the advantage of an ERROR CODE storage word, controlled by the module as a diagnostic indicator. If you are using two communication modules with the same processor, (possible with 1771-KA2 and 1771-KG series B modules only) you must program a separate and complete communication zone for each module. Modules must have different station numbers. The figures in this chapter show 3-digit addresses above most GET instructions, but not the 3-digit data value displayed below the GET symbol. This convention is used for clarity, since, for the most part, only the 3-digit GET address is significant when entering a program. In entering communication zone rungs, you needn’t program any data into GET instructions. Header Rungs
A header rung, as shown in Figure 5.2, indicates the beginning of the communication zone. For the communication adapter module (cat. no. 1771-KA2), the output position of this rung is always the LATCH 02707 instruction.
5-3
Page 56
Chapter 5 Communication Zone Rungs
Figure 5.2 Header Rung Local Station Number
Address of Error Code Storage Word 011 [G ] 000
077 [G ] 000
Timeout Preset Code 015 [G ] 000
02707 ( L ) OFF
The 3 GET instructions in the header rung list the following: Local station number Address of ERROR CODE storage word Timeout preset code The local station number is a 3-digit number switch-selected on the 1771-KA2 module. This is an octal number from 0108 to 0778 or from 1108 to 3768. The ERROR CODE storage word is a status word in the data table of the local station processor, controlled by the communication adapter. (Section titled “Error Code Storage Word,” chapter 6, describes the significance of the ERROR CODE storage word.) The timeout preset code gives a programmed timeout interval for command completion. Based on the 3-digit value entered in the address field of this GET instruction, the communication adapter module monitors command execution for all commands sent from a station. In the examples in this publication, the number 015 is entered as the timeout preset code. This value, which designates a 5-second timeout preset, is suitable for most applications. The significance of this preset code, its computation, and timeout considerations are described in section titled “Timeout Preset Value,” chapter7. Memory Access Rungs
The memory access rung defines data table words that you can access with the following commands: Protect write Protect bit write Protected commands, received from a remote station, may control only those local station processor memory areas listed in memory access rungs.
5-4
Page 57
Chapter 5 Communication Zone Rungs
(Note that memory access rungs are not needed to allow unprotected commands; only protected commands require a memory access rung.) A memory access rung is composed of one or more memory access branches, as shown in Figure 5.3.A. In this format, a BRANCH START precedes a group of 3 GET instructions. The first GET instruction address is the station number of a remote station. The next 2 GET addresses define the word boundaries of the accessible data table area in the local station processor. The specified remote station may control any bit or word within three boundaries through protected commands. Figure 5.3.B. illustrates the memory area that is now accessible to protected commands from remote station 010, due to the memory access branch of Figure 5.3.A. Multiple memory access branches can be listed in a single memory access rung. Each group of 3 GET instructions must be preceded by a BRANCH START instruction. (This is true in all cases, even when only one memory access branch is defined.) BRANCH END instructions can be used to fit the memory access rung into the ladder diagram-display format. Use output instruction, OUTPUT ENERGIZE 02707, to fit the memory access rung into the proper display format. (This output instruction has no significance in memory access rung logic.)
5-5
Page 58
Chapter 5 Communication Zone Rungs
Figure 5.3 Memory Access Example
Area Accessible to Protected Commands From Remote Station No. 010
Memory Access Boundaries in Local Station Data Table Remote Station No.
Starting Address
010 G
020 G
Words 020
Ending Address
ÉÉÉÉÉÉÉÉÉÉ ÉÉÉÉÉÉÉÉÉÉ ÉÉÉÉÉÉÉÉÉÉ ÉÉÉÉÉÉÉÉÉÉ ÉÉÉÉÉÉÉÉÉÉ
023 G
Branch Start Instruction (Required)
ÉÉÉÉÉÉÉÉÉÉ ÉÉÉÉÉÉÉÉÉÉ ÉÉÉÉÉÉÉÉÉÉ ÉÉÉÉÉÉÉÉÉÉ ÉÉÉÉÉÉÉÉÉÉ ÉÉÉÉÉÉÉÉÉÉ
023
Branch End Instruction (Required) a) Memory Access Branch b) Local Station Processor Data Table
Figure 5.4 shows a memory access rung with multiple branches. This rung lists the remote station that may control specific data table words with protected commands, as follows: Station no. 020 can control words 070-076 Station no. 017 can control words 063-065 and word 022 Station no. 010 can control words 060-062 As shown in Figure 5.4, a single remote station processor may be identified in more than one memory access rung branch.
Figure 5.4 Memory Access Rung (typical)
Branch Start Instructions Begin Each Branch
5-6
020 [G ] 000
070 [G ] 000
076 [G ] 000
017 [G ] 000
022 [G ] 000
022 [G ] 000
017 [G ] 000
063 [G ] 000
065 [G ] 000
010 [G ] 000
060 [G ] 000
062 [G ] 000
Use Branch End Instructions as Needed One Branch End Instruction Must Precede Output Instruction
02707 ( )
Page 59
Chapter 5 Communication Zone Rungs
For practical reasons, do not exceed the display area of the programming terminal when entering these rungs. You can program more than one memory access rung if needed. Note, however, that should multiple memory access rungs be required, you must enter them in succession in the communication zone, immediately following the header rung and before any command rung. Command Rungs
The command rungs direct the data transfer operations of the communication adapter module. The command rung lists the type of command and the memory areas affected and allows command execution to be initiated in the user program. There are 2 basic command rung formats that differ only in terms of the unit of memory which they control. The basic command rung formats are: Word command format Bit command format Use the word command format for commands that transfer one or more data table words between stations. These are unprotected write, read, and protected write commands. Use the bit command format for commands that control, from one station, one or more data table bits at another station processor. These are unprotected bit write and protected bit write commands. In both formats the command rung begins in a similar manner. (Refer to Figure 5.5). The first rung element is an EXAMINE ON instruction, addressing the START bit. The second rung element, termed the command code, tells the remote station number, type, and priority of the command. (Section titled “Message Priority,” chapter 8, describes command priority.) For most commands, normal priority is preferred.
5-7
Page 60
Chapter 5 Communication Zone Rungs
Figure 5.5 Command Rung Format
Command Code
Start Bit
[
]
AAAPX [ ]
REFER TO FIGURES 5.6 AND 5.7
02707 ( )
AAA – REMOTE STATION NO. P – PRIORITY INDICATOR 1 = PRIORITY MESSAGE 0 = NORMAL MESSAGE X – COMMAND TYPE 0 = PROTECTED WRITE 1 = UNPROTECTED READ 2 = PROTECTED BIT WRITE 3 = UNPROTECTED WRITE 4 = UNPROTECTED BIT WRITE
After the command code, the command rung then lists the memory areas affected by the command. The format of this area varies, based upon the type of memory area controlled by the command. The length of the communication zone in PLC-2 family PCs is limited by the memory available inside the communication module. Very few applications approach this limit, but if you program too many command rungs, the value 26 will appear in the error code word when you place the processor in RUN or RUN/PROGRAM mode. Each command rung ends with an OUTPUT ENERGIZE 02707 element. This instruction is used solely for the purpose of fitting the command rung into the proper display format. The output instruction of the command rung has no significance in program logic. Examine START Bit Each command rung has a unique START bit in a memory word selected by the programmer. (Refer to section titled “START/DONE Word,” chapter 6). The START bits are examined by the communication adapter module. When a START bit is on, the communication adapter module carries out the programmed command. 5-8