The text of a manual · part 10 of 15
Communication Adapter Module (cat. no. 1771-KA2) User's Manual, pages 91 to 100
Pages 91 to 100 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 91
Chapter 7 Command Initiation, Execution, and Monitoring communication adapter module. (REMOTE and LOCAL FAULT bits at other stations indicate the same types of faults that can be detected using a user-programmed timeout.) A programmed timeout would not be necessary for each command from a station. Instead, a single command at each station can be monitored in this manner. Select a command that is sent regularly for this type of monitoring. There may be other instances where program monitoring of commands is useful. In some cases, a user-programmed timeout may be used to monitor the execution time of critical commands. An application may require that a critical message, such as a priority command, be sent within a certain limited amount of time. A programmed TON instruction can be used for this purpose; here, however, its preset interval will generally be shorter than the interval entered as the timeout preset for the module. Chapter Summary
This chapter dovetailed with chapter 6. It discussed command initiation, execution, and monitoring and their association with: START/DONE bit timing Normal operation START/DONE bit status Faulty operation Control of START bit ON/OFF input status Transition of an input device from ON to OFF and OFF to ON Timed start bits Diagnostic FAULT rungs Timeout preset values Programming a preset code Optional user-programmed timeouts Chapter 8 discusses interfacing a KA2 with other modules on a Data Highway, mastership of the highway and Data Highway computer commands.
7-19
Page 92
Chapter 7 Command Initiation, Execution, and Monitoring
7-20
Page 93
Chapter
8
Station Interfacing
General
To execute commands, a 1771-KA2 communication adapter module at one station interacts with all other stations interface modules on the Data Highway. This chapter describes this interaction of station interface modules. Because much of this interaction is transparent to user programming, the information given here is largely for background. However, an understanding of station interaction is useful in optimizing use of each individual communication adapter module and of the Data Highway as a whole. Specifically, the information aids in an understanding of the following: Floating master operation and polling Message types Sequence of messages for command execution Acknowledgements Re-tries of transmitted messages Priority command designation Automatic disconnection of faulted master Commands that can be sent by computer
Floating Master
Central to the interaction of station interface modules is the concept of shared mastership--the floating master. With this arrangement, no single station controls the Data Highway communication link at all times. Instead, each station vies for mastership based on its need to send messages. The advantage of this arrangement is that Data Highway operation can continue even if one or more stations are unable to maintain communication. Thus, disconnection of a station or a fault at a station processor or communication adapter module does not disable communication between other operating stations. This minimizes the need for redundancy in many applications.
8-1
Page 94
Chapter 8 Station Interfacing
Mastership A Data Highway cable links as many as 64 stations. Because this cable has a single pair of wires, only one station can transmit at a time. When a station interface module gains control of this data link to transmit messages, that station has mastership. When one station interface module is master, all other station interface modules assume a “slave” or receive mode. This enables these stations to receive and acknowledge messages sent to them. The relationship between the master station interface module and all other stations is shown in Figure 8.1.
Figure 8.1 Master Station Functions
All Other Stations
Master Station
1. Send Command/Reply Messages Acknowledgment
2. Send Polling Message Sequence
Signal if Ready
12360
As master, a communication adapter module can send the following types of messages: Command Reply Polling 8-2
Page 95
Chapter 8 Station Interfacing
The function of both command and reply messages is the transfer of data between stations. As soon as the communication module attains mastership, it sends its command and reply messages (up to a maximum number--16 for the 1771-KA2). After the module sends its command and reply messages, it transmits a sequence of polling messages. By this sequence, it selects the next station to be master of the Data Highway communication link. Command Messages A command message from the master communication adapter module instructs another station interface module to execute a command. In general, a command from a communication adapter module can do one of the following: Write data table data to another station Write bit status to another station Request data table data from another station through a read command The command rung, entered in the communication zone of user program, instructs the communication adapter module to format a command message. Once this message is sent, execution of the command begins. (Command types, execution, and programming are described in chapters 4 through 7.) Each command message causes a reply message to be generated by the receiving station. Reply Messages Reply messages are generated by a station in response to command messages that it receives. The reply message indicates whether the command message was received and whether the station interface module has completed the sequence of events required of it for command execution. For commands that write data, the reply message indicates whether the write operation has been completed at the receiving station. For commands that read data the reply message contains the data specified by the command. If the command was not executed successfully, the reply message contains an indication of the error in the STS byte.
8-3
Page 96
Chapter 8 Station Interfacing
The reply message is an automatic function of communication adapter module operation, transparent to the user program. To send a reply message, a station must have mastership. Acknowledgement When a station receives a message addressed to it, whether it is a command or reply message, the receiving station sends an acknowledgement. The acknowledgement is merely a signal that confirms that a message has been received. Transparent to the user program, the acknowledgement is an automatic function of communication adapter module operation. The acknowledgement serves 2 basic functions: it indicates that the receiving station is operating and has received the message, and it indicates that the received command or reply message is in intelligible format. Should the proper acknowledgment not be received, a fault in the receiving module may be indicated. In this event, the master station communication adapter module re-tries transmission of the message. The communication adapter module attempts several re-tries for a command or reply message. Re-tries are automatic, transparent to the user program. If re-tries are unsuccessful, a LOCAL FAULT bit may be set ON at the local (sending) station processor. (LOCAL FAULT bits are described in chapter 6.) Acknowledgements are sent only by a station that is in the receive mode, not the current master station. Message Priority Each message transmitted over the Data Highway communication link has one of these priority levels: normal and priority. These priority levels determine the order in which stations obtain mastership and the order in which messages are transmitted. Priority messages of a given type (either command, reply, or polling) will always be transmitted before normal messages of the same type. The programmer designates a priority level for each command message. The command code, an element in each command rung, specifies the priority level of the command message. The station that receives a command message automatically establishes the same priority level for its 8-4
Page 97
Chapter 8 Station Interfacing corresponding reply message. (The command code is described in chapter 5.) Priority commands are executed ahead of normal commands throughout the command/reply message cycle. For this reason, a command should be given priority designation only when special handling of specific data is required. Using an excessive number of priority commands defeats the purpose of this feature and could delay or inhibit the transmission of normal messages. When a station communication adapter module has a priority command or reply message ready for transmission, the module responds to the next priority poll to gain mastership. Polling No single station is permanent master of the Data Highway communication link. Each station bids for mastership when it needs to send a message. The station interface module at the current master station conducts a poll to select the next master station. A poll is an orderly, systematic method to determine which stations have messages to send, and to select one of these stations as master. The mechanics of the polling algorithm are essentially transparent to you. This is because the communication modules handle this automatically. However, the polling algorithm does lead to the following basic rules that you should follow to optimize Data Highway performance: Number your stations sequentially whenever possible, and Keep the number of high priority messages as low as possible. Large numbers of high priority messages slow all traffic on the network. In general, you should limit the number of high priority messages to less than 1% of the total traffic on the Data Highway. Commands From A Computer
A communication adapter module can execute commands from a computer connected through a communication controller module (cat. no. 1771-KE or -KF). The command set of the computer includes the command set of the 1771-KA2 module: Protected write Protected bit write Unprotected read Unprotected write 8-5
Page 98
Chapter 8 Station Interfacing
Unprotected bit write These commands have the same execution sequence and memory access as the same commands from a communication adapter module. In addition to these commands, the command set from the computer includes the following, which can be executed by a PLC-2 family processor: Privileged read Privileged write Diagnostic loop Enter download mode Enter upload mode (New for 1771-KA2) Exit upload/download mode Diagnostic read Diagnostic counters reset Set data table size (New for 1771-KA2) Diagnostic Status Privileged commands give the computer the capability to read from or write into the entire processor memory. This includes both data commands and user program areas. Privileged commands are used chiefly to load programs from a computer to a station processor on the Data Highway. During program downloading, outputs are held in their last state by the processor. However, at the computer programmer’s option, privileged write commands can also be used to change data table values during a download of program. (Refer to publications 1771-6.5.8 and 1771-6.5.15.) Diagnostic commands affect only the communication adapter module at a station, not the station processor. These commands access the read/write memory of the communication adapter module. They provide a check of module activity and permit computer control of specific aspects of communication adapter module behavior. A summary of diagnostic commands and their functions is given in Table 8.A.
8-6
Page 99
Chapter 8 Station Interfacing
Table 8.A Diagnostic Command Summary Command
Function
Diagnostic loop
Echoes transmitted data back in reply message
Diagnostic read
Copies up to 245 bytes of data from module memory
Diagnostic counters reset
Resets all diagnostic error counters n the module
Diagnostic status
Allows access to 28 bytes of processor and module status information
Other commands are available for communication with other processors, but will return an error code if sent to a PLC-2 family processor. Indications of Upload, Download (Earlier revisions) If you are using a revision of the 1771-KA2 module before revision D, or a revision of the 1770-T3 terminal before revision G, and are uploading or downloading, the 1770-T3 terminal will: display a mode select menu and a communication fault message clear all force instructions (Later Revisions) When you connect a 1770-T3 terminal (revision G or later) to a 1771-KA2 module (series A, revision D or later) and perform program uploads with the 1770-T3 terminal in the PLC-2 mode, the terminal does the following: Uploads 1.
Displays the prompt: UPLOAD IN PROGRESS - PLEASE WAIT FOR COMPLETION
2.
disables the PLC-2 mode
3.
displays the prompt: UPLOAD COMPLETED - PRESS ANY KEY TO CONTINUE
4.
re-enables the PLC-2 mode and forces are maintained after you press any key 8-7
Page 100
Chapter 8 Station Interfacing
Downloads For program downloads with the 1770-T3 terminal in the PLC-2 mode, the terminal: 1.
displays the prompt:
DOWNLOAD IN PROGRESS - ALL FORCES CLEARED 2.
displays a mode select menu
3.
displays the prompt:
DOWNLOAD COMPLETED - ALL FORCES CLEARED 4.
displays a mode select menu
When you connect a 1770-T3 terminal (revision G) to a 1771-KA2 module (series A, revision D) and perform program uploads when the 1770-T3 terminal is not in PLC-2 mode, the terminal displays a mode select menu and the following prompts: 1.
UPLOAD IN PROGRESS - PLEASE WAIT FOR COMPLETION
2.
UPLOAD COMPLETED
If you perform program downloads when the terminal is not in PLC-2 mode, the terminal displays a mode select menu and the following prompts:
8-8
1.
DOWNLOAD IN PROGRESS - PLEASE WAIT FOR COMPLETION
2.
DOWNLOAD COMPLETED