The text of a manual · part 7 of 15
Communication Adapter Module (cat. no. 1771-KA2) User's Manual, pages 61 to 70
Pages 61 to 70 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 61
Chapter 5 Communication Zone Rungs
The START bit is controlled by the program. This allows a command to be initiated only when necessary. (Programming methods for START bit control are given in chapter 7.) Command Code The second element in a command rung, the command code, identifies the following: Remote station number Priority status of the command (priority or normal) Type of command NOTE: The command code uses the address of an EXAMINE ON instruction, but does not examine or control any bit in the data table of the local station processor. Figure 5.5 shows the coding for this rung element. Word Command Format When the command code specifies a protected write, read, or unprotected write command, use the format shown in Figure 5.6.
Figure 5.6 Word Command Format
Start Bit
032 10
Local Station Processor Data Table Boundaries
Command Code
020 00
AAA G
BBB G
CCC G
027 07
Remote Station Processor Data Table Address
Legend AAA Beginning word address of remote station processor for write/read operation BBB Beginning Word Address of local station processor for write/read operation CCC Ending Word Address at local station processor for write/read operation
5-9
Page 62
Chapter 5 Communication Zone Rungs
This format uses 3 GET statements. The address position of the first GET statement lists a remote station data table word. The specified command operation begins at this memory location. The second and third GET statements define the starting and ending boundaries of the data table words in the local station processor. These words are the beginning and ending data table locations for the words to be transferred in the write or read operation. In write operations, data words are written to a remote station from the local station data table. For a write command, the first GET element in the command rung lists a beginning address at the remote station. Data is to be written into this word, and succeeding words from the local station data table. The second and third GET elements in this type of rung list starting and ending boundaries for the word or words to be written from the local station data table. In a read operation, data words are read from a remote station processor into the local station data table. The first GET element in the unprotected read command rung lists the beginning address from which data is to be read. Remote data table words are read in succession, beginning with this address. Words are read only into the area of the local data table bounded by the second and third GET elements in the rung. Only one set of GET instructions, as shown in Figure 5.6, can be programmed in a single command rung. Bit Command Format When the command code specifies a protected bit write or unprotected bit write command, use the format shown in Figure 5.7.
5-10
Page 63
Chapter 5 Communication Zone Rungs
Figure 5.7 Bit Command Format Area May Contain Any Legal Combination Of These Instructions:
. .
. Start Bit
/
Command Code
Branch Start (If Needed)
EEEEE
FFFFF /
GGGGG /
HHH HH
IIIII /
JJJ JJ
027 07
Legend: EEEEE –] [– Set bit EEEEE in remote station data table on FFFFF –] / [– Set bit FFFFF in remote station data table off
This format uses EXAMINE elements that address bits in the remote station processor. These elements control remote station data table bits as follows: -] [- EXAMINE ON - This rung element instructs the remote station communication adapter module to turn the addressed bit on. -]/[- EXAMINE OFF - This rung element instructs the remote station communication adapter module to turn the addressed bit off. Program these elements immediately after the command code. Any combination of these elements may make up this type of command rung. Where necessary, BRANCH START instructions and a BRANCH END instruction can be used to fit these elements into the display area of the programming terminal. For practical reasons, do not exceed this display area. Multiple rungs of this type can be used as necessary. Delimiter Rung
The delimiter rung ends the communication zone of program. With PLC-2 family processors, this rung always has the format shown in Figure 5.8.
5-11
Page 64
Chapter 5 Communication Zone Rungs
Figure 5.8 Delimiter Rung 027 07 U
Chapter Summary
Chapter 5 was the RUNG chapter; it discussed: Communication zone rungs Communication zone of program Header rungs Memory access rungs Command rungs Start bit, command code and word command format Bit command format with EXAMINE ON, EXAMINE OFF elements In chapter 6 you will read about bit storage, fault words, and error codes.
5-12
Page 65
Chapter
6
Status Words
General
A 1771-KA2 communication adapter module controls certain data table words specified in the local station processor by the programmer. These data table words indicate the status of command execution and provide various types of diagnostic information for start-up and troubleshooting. These locations are: One or more pairs of adjacent words for START/DONE and REMOTE/LOCAL FAULT bit storage An ERROR CODE storage word Refer to Figure 6.1. The programmer specifies the locations of these status words when entering the communication zone rungs, as described in chapter 5. Two START/DONE and REMOTE/LOCAL FAULT bit storage words are defined by selection of the START bit in a command rung. You specify the ERROR CODE storage word in the header rung. Figure 6.1 Adjacent Status Word Start Bit 03210
02707 G
G
G A. Command Rung
Selection of Start Bit Automatically Desig– nates Bits in Two Adjacent Words
ÉÉ ÉÉ
Start Bits
Word 032
Program Controlled
ÉÉ ÉÉ
ÉÉ ÉÉ
Communication Adapter Controlled
Word 033
Bits for Command Rung Shown
Done Bits
Remote Fault Bits
ÉÉ ÉÉ
Local Fault Bits
ÉÉ ÉÉ
B. Start/Done and Remote/Local Fault Words
6-1
Page 66
Chapter 6 Status Words
Any accessible data table words can be used as status words in the station processor. Note that the same recommendations for data table control given in section titled “Accessible Data Table Locations - PLC-2 Processors,” chapter 4, should be followed when selecting status words. That is, processor work areas, input image table words and word 027 should not be used as status words. START/DONE Word
The START/DONE word is the first of a pair of adjacent status words for communication adapter module use. This word stores a START bit and corresponding DONE bit for each of up to 8 commands. (NOTE: should more than 8 command rungs be programmed at a station, additional pairs of START/DONE and REMOTE/LOCAL FAULT words can be used.) The START bit for any command is always in the upper byte (bits 10-17) of the START/DONE word. The DONE bit for this command is then the corresponding bit in the lower byte (bits 00-07) of the same word. In Figure 6.1.A the sample command rung examines bit 03210 as its START bit. As Figure 6.1.B shows, the corresponding DONE bit is bit 03200. Note that the 5-digit address of START/DONE bits for each command differs only in the fourth digit: the START bit always has a “1” in the fourth digit, the DONE bit always has a “0.” As its name implies, the START bit initiates command execution. This bit, controlled by the user program, is set ON to initiate the sending of a command. The communication adapter module monitors the status of START bits and executes the corresponding command when its START bit is set ON. The DONE bit as its name implies, indicates command completion. This bit, controlled by the KA2, is set ON when a command is executed. Each command rung examines a unique START bit. Thus, one pair of START/DONE and REMOTE/LOCAL FAULT words has enough bits for up to 8 command rungs. Should more command rungs be programmed, select additional word pairs as necessary. To optimize memory use and minimize the time required by the communication adapter module to scan START bits, use all 8 START bits in one word pair before using another START/DONE word. For the same reason, when programming communication zone rungs, group in sequential fashion command rungs that use the same START/DONE word.
6-2
Page 67
Chapter 6 Status Words
REMOTE/LOCAL FAULT Word
As Figure 6.1 shows, the selection of a START bit in the program not only causes a corresponding DONE bit to be controlled in the same word, but also causes REMOTE and LOCAL FAULT bits to be controlled in the next data table word. A REMOTE FAULT and LOCAL FAULT bit are controlled for each command. For a command, the position of each of these FAULT bits within their respective bytes corresponds directly to the position of START and DONE bits for that command. The KA2 controls REMOTE and LOCAL FAULT bits. The module sets a FAULT bit ON when a command cannot be executed due to a hardware-related fault either between stations or between the remote station communication adapter module and its station processor. Figure 6.2 summarizes the significance of these bits. Figure 6.2 REMOTE/LOCAL FAULT Bit Significance Processor
PLC 2/20
Local Fault Possible Sources: • Disconnected data highway cable
• Power off at receiving station interface module
• Unused remote staiton no. address AC FUSE
• Station interface moduel at local or remote station has disconnected itself as a result of link monitoring
• Automatic timeout at sending station Sending Station
Remote Fault Possible Sources: • Remote station processor in program load (or prog) mode
Processor
PLC 2/20
• Command not executed due to module switch setting at receiving station
• Fault at remote station processor
AC FUSE
• Power off at remote station processor • Disconnected data highway/processor cable • Error detected in communication zone of program at remote station proccessor
Receiving (Remote) Station 10866-I
6-3
Page 68
Chapter 6 Status Words
REMOTE FAULT bits are in the upper byte of this word. A REMOTE FAULT bit is set ON when a command is received at a remote station but cannot be executed by the remote station. This may mean one of the following: Remote station processor has detected a fault in its own operation or has shut down. Remote station processor has power OFF. Remote station processor has mode select switch in PROGRAM LOAD (or PROG) mode. Cable between remote station adapter and processor is disconnected or faulty. Module switch setting prevents execution of the received command. Error has been detected in communication zone of program at remote station processor (PROG indicator may be ON). A REMOTE FAULT bit indicates that the remote station communication adapter or controller module received a message, but could not communicate with its station processor to execute that command. LOCAL FAULT bits are in the lower byte of this word, bits 00-07. A LOCAL FAULT bit is set when the local station cannot confirm delivery of the message to the remote station. This may mean one of the following: Automatic timeout of command completion by communication adapter module. Disconnection of the local or remote station interface module from the Data Highway cable Loss of power to the remote station communication adapter module Unused station number addressed by the command. Excessive noise along the Data Highway cable caused by other equipment in the industrial environment. At the same time it sets a REMOTE or LOCAL FAULT bit ON, the KA2 enters a 2-digit ERROR CODE into the ERROR CODE storage word. (The ERROR CODE storage word is described in the following section.) By monitoring these bits in the program, operators can be alerted to hardware conditions that prevent normal transmission and execution of commands. (Programming techniques for monitoring FAULT bits are described in chapter 7.)
6-4
Page 69
Chapter 6 Status Words
Error Code Storage Word
When a command cannot be carried out due to a user programming error or a discrepancy in data handled by the communication adapter module, an ERROR CODE may be written into a data table memory word. The programmer selects the error code storage word and lists it in the header rung of the communication zone of program. This word stores the most recent error code written by the KA2. Figure 6.3 shows the structure of the ERROR CODE storage word. The lower byte of this word (bits 00-07) stores any ERROR CODE entered by the module. In this byte the ERROR CODE is represented as a 2-digit binary coded decimal (BCD) number from 00-99. Table A.1 (Appendix A) lists and describes these ERROR CODES.
Figure 6.3 ERROR CODE Word Format
2–Digit Value:
17
Error Codes 00–99 in BCD Format (Refer to Table 6–A)
Reference Number (for codes 01–26) Counter (for codes 30–99)
16
15
0–9
14
13
12
11
10
07
0–9
06
05
0–9
04
03
02
01
00
0–9
ERROR CODES can be grouped as follows: Codes 01-29 generally indicate that some programming error has been detected in the communication zone of program. These codes are intended to indicate errors or processor communication faults detected at power-up. The program status indicator (PROG) may be on if one of these codes is displayed. Codes 30-99 generally indicate that some programming or hardware related fault has been detected during attempts at communication between stations. Codes 30-99 serve as diagnostic indicators after the initial power-up checks of program have been completed. A code in this 30-99 group is displayed whenever a REMOTE or LOCAL FAULT bit is set ON.
6-5
Page 70
Chapter 6 Status Words
The upper byte of the ERROR CODE storage word (bits 10-17) stores a 2-digit BCD value. This value gives supplemental error or fault information, depending on the type of ERROR CODE displayed. It may have one of two meanings: Reference number Counter For ERROR CODES 01-29, the upper byte stores a 2-digit reference number. This number points to the location of a programming error within the communication zone of program. This error may be an incorrect instruction or an improper address entered within a rung of the communication zone. In this numbering scheme, the header rung of the communication zone of program is designated as “00.” Subsequent communication zone rungs are numbered sequentially. Note that ERROR CODES 01-29 are intended as aids in start-up debugging of the communication zone of program. Thus, the reference number stored in this word can be a valuable tool for debugging purposes. For ERROR CODES 30-99, the upper byte stores a 2-digit counter. This counter shows the number of ERROR CODES 30-99 written into the storage word by the communication adapter module. The counter increments each time a different ERROR CODE storage word. These codes are generally to be displayed on a programming terminal rather than used in application programming. They have special value in station start-up, when programming errors are detected in the communication zone of program. By viewing the header rung of the communication zone, the programmer can examine a displayed ERROR CODE and the least significant digit of the counter in this word. (Section titled “Header Rung,” chapter 5, describes a header rung.) In some instances, however, it may be preferable to display the 2-digit error code using a 7-segment BCD numerical display controlled from output modules of the controller. This 7-segment display, mounted at an operator’s station, can provide a useful troubleshooting aid for quickly locating fault conditions.
6-6