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

The text of a manual · part 9 of 15

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

Pages 81 to 90 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 81

Chapter 7 Command Initiation, Execution, and Monitoring

In this example, a storage bit, called the “transition” bit, is manipulated to control the sending of the command. This bit is LATCHED whenever a transition of input 11111 is detected, UNLATCHED only when the DONE bit is set ON. A “compare” bit, 01111 in this example, is used to manipulate the transition bit. In rung 2, the compare bit is controlled to match the ON/OFF status of the input. Because the input and the compare bit are programmed to have matching states, both ON or both OFF, the conditions of RUNG 1 can be TRUE only when the input has just changed from ON to OFF or from OFF to ON. Thus rung 1 conditions set up a “one-shot,” TRUE only long enough to LATCH the transition bit. Note that these rung conditions are FALSE as soon as the processor scans rung 2. The order of these rungs is important for this reason. With the transition bit LATCHED, the START bit, in turn, is LATCHED in rung 3. This initiates the command. In normal operation, the DONE bit UNLATCHES the START bit in rung 4 and then UNLATCHES the transition bit in rung 5. In faulted operation, however, rungs 3 and 4 repeatedly re-try the command in much the same manner as in the example of Figure 7.3. Timed The START bit may be LATCHED periodically to send a command at a user-determined time interval. Figure 7.5 shows example rungs for this type of command initiation.

7-9

Page 82

Chapter 7 Command Initiation, Execution, and Monitoring

Figure 7.5 Timer-Initiated Command

Done 032 02 /

046 TON 1.0 PR 010 AC 000

Timed Bit 046 15

Start 032 12 L

Done 032 02

Start 032 12 U

Local Fault 033 02

Remote Fault 033 12

In this example, timed bit 04615 is used to initiate the command at every preset interval, 10 seconds. This bit is examined to LATCH the START bit. The DONE, LOCAL FAULT, and REMOTE FAULT bit are examined in parallel branches to UNLATCH the START bit. In normal operation, after the command is executed, the DONE bit is set ON by the communication adapter module. This causes the program to UNLATCH the START bit. The timer then begins timing again once the DONE bit is set OFF. (As Figure 7.1 shows, the DONE bit is reset only after the START bit is reset.) Note that this programming causes continuous re-try of a command in the event of faulted operation. REMOTE/LOCAL FAULT Bit Monitoring

7-10

When it cannot execute a command, the Communication adapter module sets a REMOTE or LOCAL FAULT bit ON. These bits, in the data table of the station processor, are located in the word immediately following the START/DONE bit word. They indicate not only that a command was not

Page 83

Chapter 7 Command Initiation, Execution, and Monitoring executed, but also point to the general type of fault condition that prevented command completion. The user program must monitor the REMOTE and LOCAL FAULT bits for each command. The recommendations of this section describe two methods for monitoring FAULT bits and using these bits to signal a fault condition. Diagnostic FAULT Rungs The purpose of monitoring REMOTE/LOCAL FAULT bits is to control one or more output indicators to signal a fault condition. Fault indicators controlled for this purpose may be as simple as a warning light or an annunciator, or as complex as a line printer or CRT terminal used to display a fault message. By controlling the fault indicator device, the user program can alert user personnel to the nature and location of a fault condition. To monitor the REMOTE and LOCAL FAULT bits, a programmer must understand their timing relationship to the corresponding START bit. Figure 7.2 summarizes this relationship. The section titled “Controlling the Start Bit” showed how the FAULT bit can be programmed to UNLATCH the START bit in a fault situation and thus provide automatic re-tries through the program. When used in this manner, however, a FAULT bit will be rapidly cycled ON and OFF if a fault is detected. Because the fault bit can be constantly changing state at a rapid rate, the program must use some method of detecting this transient state of any FAULT bit and of controlling the output device based on this state. Figure 7.6 shows a simple method for the control of a fault indicator. Here, either the REMOTE or LOCAL FAULT bit can LATCH the output indicator ON. The indicator remains ON until the DONE bit is energized. This then UNLATCHES the output indicator in the second rung of Figure 7.6. This example allows for the transience of the FAULT bits, since the first rung need only be TRUE once for the output indicator to be latched.

7-11

Page 84

Chapter 7 Command Initiation, Execution, and Monitoring

Figure 7.6 FAULT Bit Diagnostic Rungs (Single Command Example) Remote Fault 03310

Output Indicator 01000 L OFF

Local Fault 033 00

Done 03200

Output Indicator 010 00 U

The method of Figure 7.6 can be extended to monitor multiple commands from a station, controlling multiple output indicators as necessary. However, where more than one command is being sent from a station, the use of multiple output indicators may not be practical. In this instance, a single output indicator can be used to signal all REMOTE or LOCAL FAULT conditions for commands from that station. Figure 7.7 shows a method for fault indicator control assuming multiple commands.

7-12

Page 85

Chapter 7 Command Initiation, Execution, and Monitoring

Figure 7.7 FAULT Bit Diagnostic Rungs (Multiple Commands Example) Rung 1 033 07 /

033 06 /

033 05 /

033 04 /

033 03 /

033 02 /

033 01 /

033 00 /

Rung 2 033 17 /

033 16 /

033 15 /

033 14 /

033 13 /

033 12 /

033 11 /

033 10 /

Local Fault Status 055 00

Remote Fault Status 055 01

Rung 3 Local Fault Status 055 00 / Remote Fault Status 055 01 /

Rung 4 Timed Bit 030 15

030 TOF 0.1 PR 020 AC 000

Output Indicator 010 00

This example shows the FAULT bit monitoring for 8 commands. The 8 LOCAL FAULT bits are monitored in rung 1. As long as all 8 bits are OFF, status bit 05500 remains ON. However, should any LOCAL FAULT bit be ON, status bit 05500 is de-energized. In rung 2, the 8 REMOTE FAULT bits are monitored in the same manner, to control status bit 05501. The status bits controlled by rungs 1 and 2 are, in turn, used to control an OFF-DELAY timer in rung 3. The OFF-DELAY timer begins to time when either of the status bits goes from OFF to ON, that is, when rung conditions go from TRUE to FALSE. Bit 03015, the timed bit of the timer, controls the output indicator. As soon as the conditions of the timer in rung 3 are TRUE, this bit is set ON causing the indicator to be energized. Once ON, this bit remains on as long as the timer is timing, that is, for at least as long as the preset interval. In the example of Figure 7.7, this preset is set at 2 seconds. This value is not critical but should exceed 0.5 seconds for practical purposes.

7-13

Page 86

Chapter 7 Command Initiation, Execution, and Monitoring

The OFF-DELAY timer is useful in this application because it is continually reset when its rung conditions go TRUE. This means that the timed bit, 03015, remains on for as long as any FAULT bit is changing state during programmed re-tries. This keeps the output indicator on until after the DONE bit indicates command completion. NOTE: Using the rungs of Figure 7.7, the indicator goes ON automatically at power-up, or whenever the mode select switch on the processor is changed from the PROGRAM LOAD (or PROG) mode to any other mode. However, the indicator only remains on initially for the preset interval; after this time, the indicator is valid for fault conditions. Rungs 1 and 2 examine all 8 FAULT bits of each type. Should fewer than 8 command rungs be programmed at a station processor, fewer bits need be examined. Then, should command rungs be added subsequently, the appropriate bits could be addressed in rungs 1 and 2. Conversely, if more than 8 command rungs were programmed at a station, additional rungs would be needed to examine both REMOTE and LOCAL FAULT bits for the additional commands. Status bits controlled by these additional rungs could then be examined in branches of rung 3, parallel to those shown. Of course, other methods can be used to monitor REMOTE and LOCAL FAULT bits. Such factors as availability of output terminals, memory space, and type of application dictate the specifics of FAULT bit monitoring and program response. Use of FAULT bits in start-up and troubleshooting procedures is described in chapter 9. Timeout Preset Value

In addition to its REMOTE/LOCAL FAULT bit control, a 1771-KA2 module also provides an automatic timer for monitoring command completion. While it functions automatically during module operation, the timer uses a preset value entered in the user program. This feature enables the module to monitor command execution time without using timer (TON) instructions in the user program. Figure 7.8 shows the significance of the timeout preset interval. From the time the START bit is set ON, the module must set either a DONE bit or a REMOTE or LOCAL FAULT bit within the timeout preset interval. Should the module detect no DONE or FAULT bit response within the preset interval, some type of fault is assumed. As a response to this type of timeout situation, the module sets the LOCAL FAULT bit ON and

7-14

Page 87

Chapter 7 Command Initiation, Execution, and Monitoring enters the value 37 in the lower byte of the ERROR CODE storage word of the header rung.

Figure 7.8 Timeout Preset Significance Code

Header Rung (Representation)

QQQ

G

G

G

(L)

X37

Code ”37” Entered if Timeout Occurs

Start Bit

On Off

Timeout Preset Interval, Within this Period Done or Fault Bit Expected

ÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉ ÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉÉ

On Done Bit

Remote Fault Bit

Local Fault Bit

Off

On Off

On Off

Local Fault Bit Set if Timeout Occurs

ÉÉÉÉ ÉÉÉÉ Time

7-15

Page 88

Chapter 7 Command Initiation, Execution, and Monitoring

Timeout preset monitoring is intended as a backup for the other communication monitoring functions of the module. It is designed to signal any condition where the module has not completed its communication with another station or detected some fault condition within a short time. Because this timer is primarily intended as a backup for some LOCAL FAULT type of situation, its preset value is not critical. In the examples in this manual, a nominal value of 5 seconds, coded 015, is programmed as the timeout preset value. This value is appropriate for most applications. Programming the Preset Code The timeout preset code for Data Highway communication is entered in the header rung of the communication zone of program. The address field of the third GET instructions in this rung is used for the timeout preset code. Figure 7.8 shows the position of this rung element. The 3-digit address of a GET instruction is an octal (base 8) number. Because only octal values can be entered in this address field the timeout preset value is a code, computed as outlined in this section. As section titled “Timeout Preset Value” points out, the timeout preset is not a critical value. For most applications, a 5-second present is acceptable. The code for this timeout preset is 015. However, there may be instance where another timeout preset interval is desired. Table 7.B lists the 3-digit codes for intervals from 1 to 10 seconds. Note that values listed provide nominal values that will vary with activity level in the KA2. Table 7.B Timeout Preset Codes

7-16

Timeout Interval (Sec,)

Code

1

011

2

012

3

013

4

014

5

015

6

016

7

017

8

020

9

021

10

022

Page 89

Chapter 7 Command Initiation, Execution, and Monitoring

If it is necessary to use a value other than those provided in Table 7.B, compute the 3-digit timeout preset code as follows: 1.

Select a timeout preset interval. This interval must be at least one second.

For the purpose of computing the code, label this number “S.” EXAMPLE: desired interval = 7 seconds = S 2.

Compute a decimal (base 10) number using the desired interval of step 1 in the following formula:

S+8 EXAMPLE: S + 8 = 15 3.

Convert this value to a 3-digit octal (base 8) value.

EXAMPLE: 1510= 178 For a brief description of decimal-to octal conversion, refer to chapter 13 of publication 1772-821, Programming and Operations Manual, Mini-PLC-2 Programmable Controller. You can disable the timeout by using the value 010. User-Programmed Timeout (Optional) The automatic timeout of a 1771-KA2 communication adapter module has a backup function. This automatic monitoring routine continuously checks module interaction with other Data Highway stations, timing the execution of commands. This automatic timeout does not check module communication with its own station processor. For a backup check on module/processor communication, an optional programmed ON-DELAY timer instruction (TON) can be used. With proper module/processor communication, the module sets either a DONE bit or a REMOTE or LOCAL FAULT bit as a response to a command. However, in the event of faulted module/processor communication or faulted module operation, a response bit might not be set. Instead, the START bit would remain on in this instance until the fault situation was corrected. Several programming methods can be used 7-17

Page 90

Chapter 7 Command Initiation, Execution, and Monitoring to detect such a condition; the simplest of these methods uses an ON-DELAY timer. Figure 7.9 shows typical rungs that can be programmed for this purpose.

Figure 7.9 Typical User-Programmed Timeout Start 032 12

Done 032 02 / Remote Fault 033 12 /

060 TON 0.1 PR 100 AC 000

Local Fault 033 02 /

Timed Bit 060 15

Output Indicator 01002

In the first rung of this figure, timer 060 times the interval between the setting of the START bit for a command and the DONE, LOCAL FAULT, or REMOTE FAULT response of the module. If no response is received within the preset interval of this timer, here 10 seconds, a fault may be indicated and bit 06015 set ON. The second rung examines this bit to turn on a warning indicator. Depending on the individual application, this bit could also be used to enable or disable various parts of the program. The preset value of this programmed TON instruction is not critical. For this type of backup monitoring, the programmed preset must exceed the timeout preset interval entered as a code in the header rung. (Remember that the automatic timeout of the module gives a LOCAL FAULT response to a command, which would indicate normal module/processor communication, but faulted communication with some other station.) As with automatic timeout preset monitoring, a user-programmed timeout is useful as a backup to the other monitoring functions of the 7-18