The text of a manual · part 10 of 19
Classic 1785 PLC-5 Programmable Controllers User Manual (1785-LT, -LT2, -LT3, -LT4), pages 91 to 100
Pages 91 to 100 of 186
The original document is the PDF (1.4 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 1785-LT2, Allen-Bradley 1785-LT3, Allen-Bradley 1785-LT4 and Allen-Bradley 1785-LT B
Page 91
Chapter 7 Selecting Interrupt Routines
If you do not specify a program file number, the processor immediately enters fault mode after detecting a fault. Changing the Fault Routine File Number from Ladder Logic You can change the specified fault routine from ladder logic by copying a new fault routine file number into word 29 of the processor status file. Figure 7.5 shows an example program for changing the fault routine file number. Figure 7.5 Example of Changing the Fault Routine File Number MOV MOVE Source
12
Dest
S:29
ATTENTION: Do not corrupt the program-file number of the fault routine or use the same file for any other purpose. If the file number that you specify results in a non-existent fault routine, the processor immediately enters fault mode after detecting a fault. Unexpected machine operation may result with damage to equipment and/or injury to personnel.
Clearing a Major Fault You can clear a major fault with one of the following methods. Use the programming software to clear the major fault. For more information about using the programming software to clear major faults, see the chapter on clearing faults in the programming software documentation set. Turn the keyswitch on the PLC-5 processor from REM to PROG to RUN. Important: Clearing a major fault does not correct the cause of the fault. The PLC-5 processor might continue to repeat the fault cycle until you correct the cause(s) for the major fault.
7-9
Page 92
Chapter 7 Selecting Interrupt Routines
Setting Power-Up Protection You can set your processor so that after a power loss the processor does not come up in run mode. Bit 1 in word 26 of the processor status file sets power-up protection. Table 7.I shows the states for this bit. Table 7.I Setting and Resetting the Power-Up Protection Bit If word 26, bit 1 Is:
After power loss, the processor:
Set (1)
Scans the fault routine before returning to normal program scan
Reset (0)
Powers up directly at the first rung on the first program file
Set word 26, bit 1 manually from the processor status screen (see the chapter on using status data in programming software documentation). Or you can latch this bit through ladder logic. When set, the processor scans the fault routine once to completion after the processor recovers from a power loss. You can write the fault routine to determine whether or not the processor’s current status permits the processor to respond correctly to ladder logic - i.e., whether to allow or inhibit the startup of the processor.
Allowing or Inhibiting Powerup Bit 5 of status word 11 indicates whether or not you want to power up the processor after a loss of power. After a power loss, the processor automatically sets this bit; Table 7.J shows how you can change it from your fault routine. Table 7.J Setting and Resetting the Startup Bit If the fault routine makes word 11, bit 5:
Then the processor:
Set (1)
Faults at the end of scanning the fault routine. Leave this bit set to inhibit startup.
Reset (0)
Resumes scanning the processor memory file. Reset this bit to allow startup
Important: You can use JMP and LBL instructions to scan only the portion of the fault routine associated with a particular fault or power-up condition. For information about startup protection on SFCs, see the programming software documentation set.
7-10
Page 93
Chapter 7 Selecting Interrupt Routines
Understanding Processor-Detected Major Faults
In general, if the processor detects a hardware fault, it sets a major fault and resets I/O. If the processor detects a run-time error, it sets a major fault bit and the remote I/O racks are set according to their last state switch. Module outputs in remote racks remain in their last state or they are de-energized, based on how you set the last state switch in the 1771 I/O chassis. To decide how to set this switch, evaluate how the machines in your process will be affected by a fault. For example, how will the machine react to outputs remaining in their last state or to outputs being automatically de-energized? What is each output connected to? Will machine motion continue? Could this cause the control of your process to become unstable? To set this switch, see the Classic 1785 PLC-5 Family Programmable Controllers Hardware Installation Manual, publication 1785-6.6.1. Important: In the PLC-5 processor local chassis, outputs are reset - regardless of the last state switch setting - when one of the following occurs: processor detects a run-time error you set a status file bit to reset a local rack you select program or test mode
Fault in a Processor-Resident Local I/O Rack The chassis that contains the Classic PLC-5 processor is the processor-resident local I/O chassis. If a problem occurs with the chassis backplane, the input and output data table bits for the resident local I/O rack are left in their last state. The processor sets a minor fault and continues scanning the program and controlling extended-local and remote I/O. Your ladder program should monitor the I/O rack fault bits and take the appropriate recovery action (covered later in this section).
ATTENTION: If a resident local I/O rack fault occurs and you have no recovery methods, the input image table and outputs for the faulted rack remain in their last state. Potential personnel and machine damage may result.
7-11
Page 94
Chapter 7 Selecting Interrupt Routines
Fault in a Remote I/O Chassis In general, when a remote I/O chassis faults, the processor sets an I/O rack fault bit and then continues scanning the program and controlling the remaining I/O. The outputs in the faulted rack remain in their last state or they are de-energized, based on how you set the last state switch in the 1771 I/O chassis.
ATTENTION: If outputs are controlled by inputs in a different rack and a remote I/O rack fault occurs (in the inputs rack), the inputs are left in their last non-faulted state. The outputs may not be properly controlled and potential personnel and machine damage may result. Make sure that you have recovery methods.
Recovering from a Processor-Resident Local I/O or Remote I/O Rack Fault In the PLC-5 processor, you can monitor I/O rack faults using processor status bits and then recover from the fault using a fault routine or ladder logic. Using Status Bits to Monitor Rack Faults There are two types of status bits used to display information about your I/O system: global status bits and I/O rack status bits. The global status bits are set if a fault occurs in any one of the logical racks. Processor
Possible Logical Rack Bits
PLC-5/10-5/12, or -5/15
4
PLC-5/25
8
Each bit represents an entire rack, no matter how many chassis make up a rack. (Remember that you can have up to four chassis configured as quarter racks to make up one logical rack.) These bits are stored in the lower eight bits of words 7, 32, and 34 of the status file. For more information on these global status bits, see your programming software documentation set.
7-12
Page 95
Chapter 7 Selecting Interrupt Routines
The I/O rack status bits, also known as the “partial rack status bits,” are used to monitor the racks in your I/O system. The software automatically creates an integer data file to store this information when an I/O status file is defined. This file contains 2 words of status bits for every rack configured in your system. The number of the data file that contains this I/O information is stored in word 16 (low byte) of the status file. You must enter this information on the processor status screen. For more information on monitoring I/O status with I/O rack status bits, see your programming software documentation set. Using Fault Routine and Ladder Logic to Recover You may want to configure a I/O rack fault as a minor fault if you have the appropriate fault routine and ladder logic to perform an orderly shutdown of the system. You can program ladder logic in several ways to recover from a I/O rack fault. These methods are: user-generated major fault reset input image table fault zone programming Methods:
Description:
User-generated You jump to a fault routine when a remote I/O rack fault occurs. In other words, if the status bits major fault indicate a fault, you program the processor to act as if a major fault occurred (i.e., jump to the fault routine). You then program your fault routine to stop the process or perform an orderly shutdown of your system. When the processor executes the end-of-file instruction for the fault routine, a user-generated major fault is declared. Reset input image table
You monitor the status bits and, if a fault is detected, you program the processor to act as if a minor fault occurred. After the status bits indicate a fault, use the I/O Status screen to inhibit the remote rack that faulted. You then use ladder logic to set or reset critical input image table bits according to the output requirements in the non-faulted rack. If you reset input image table bits, during the next I/O update, the input bits are set again to their last valid state. To prevent this from occurring, your program should set the inhibit bits for the faulted rack. The global inhibit bits control the input images on a rack-by-rack basis; the partial rack inhibit bits control the input images on a 1/4 rack basis. For more information on these bits, see the programming software documentation set. This method requires an extensive and careful review of your system for recovery operations. For more information on inhibiting I/O racks, see your programming software documentation set
Fault zone programming method
Using fault zone programming method, you disable sections of your program with MCR zones. Using the status bits, you monitor your racks; when a fault is detected, you control the program through the rungs in your MCR zone. With this method, outputs within the MCR zone must be non-retentive to be de-energized when a rack fault is detected. For more information, see your programming software documentation.
7-13
Page 96
Chapter
8
Transferring Discrete and Block-Transfer Data
Chapter Objectives
This chapter covers discrete and block transfer of I/O data when a processor is configured for either adapter or scanner mode. Discretetransfer data are words transferred to/from a digital discrete I/O module. Block-transfer data is transferred, in blocks of data of up to 64 words, to/from a block-transfer I/O module (such as an analog module).
If you want to read about:
System Design Determined
Go to page:
Adapter mode:
8-1
Discrete-transfer data
8-4
Block-transfer data
8-7
Example ladder logic
8-10
Scanner mode:
Choosing Hardware
Selecting Interrupt Routines
Placing System Hardware
Transferring Discrete and Block Data
Assigning Addressing Mode, Racks, and Groups
Calculating Program Timing
8-16
Discrete-transfer data
8-16
Block-transfer data
8-17
Programming considerations
8-21
Choosing Communication Planning Your System Programs
Transferring Data Using Adapter Mode
You can transfer data in adapter mode in two ways. If you want to transfer:
Use this method:
Words to/from a digital I/O module
Discrete-data transfer
Blocks of data (up to 64 words) to/from a block-transfer module (such as an analog module)
Block transfer
The processor transfers discrete and block I/O data in a similar way. The adapter-mode processor and the supervisory processor automatically discrete transfer I/O data between themselves via the supervisory processor’s remote I/O scan.
8-1
Page 97
Chapter 8 Transferring Discrete and Block-Transfer Data
During each remote I/O scan: the supervisory processor transfers 2, 4, 6 or 8 words - depending on whether the adapter-mode processor is configured as a 1/4, 1/2, 3/4 or full rack the adapter-mode processor transfers 2, 4, 6 or 8 words - depending on whether the adapter-mode processor is configured as a 1/4, 1/2, 3/4 or full rack Supervisory Processor in Scanner Mode
PLC-5 Processor in Adapter Mode
Remote I/O Buffer
Read Inputs Write Outputs
Data Exchange
Remote I/O Scan
Read Inputs Write Outputs
Data Exchange
Data Exchange I/O Image Table
I/O Image Table x y
Processor- Resident Rack
IOT (x) IIN (y)
Housekeeping
Immediate I/O
Logic Scan
Program Scan
Figure 8.1 shows the transfers between supervisory processor output file and adapter-mode processor input file as well as between adapter-mode processor output file and supervisory processor input file.
8-2
Page 98
Chapter 8 Transferring Discrete and Block-Transfer Data
Figure 8.1 Automatic I/O Transfer between Supervisory and Adapter-Mode Processors Supervisory Processor
Supervisory Processor PLC-2 0X0-0X7 PLC-3 OXX0-OXX7 PLC-5 O:X0-O:X7
Supervisory Processor PLC-2 1X0-1X7 PLC-3 IXX0-IXX7 PLC-5 I:X0-I:X7
Word 0 1 2 3 4 5 6 7
Word 0 1 2 3 4 5 6 7
17
17
14 13
10 07
04 03
Adapter-Mode Processor I:30 - I:37 (or adapter image file) 00
17
14 13
10 07
04 03
00
Output File
Input File
Supervisory Processor
Adapter-Mode Processor O:30 - O:37 (or adapter image file)
14 13
10 07
04 03
00
Input File
Word 0 is reserved for block transfer and status.
17
14 13
10 07
04 03
00
Output File
15298
If data from the supervisory processor is intended to control outputs of the adapter-mode processor, the ladder logic in the adapter-mode processor must move the data from its input file (I/O rack 3 or the adapter image file) to its output file (local I/O). Use XIC and OTE instructions for bit data; use move and copy instructions for word data. If you want the supervisory processor to read data from a data file in the adapter-mode processor, ladder logic in the adapter-mode processor must move that data to its output file (I/O rack 3 or the adapter image file) for transfer to the supervisory processor.
8-3
Page 99
Chapter 8 Transferring Discrete and Block-Transfer Data
Programming Discrete Transfer in Adapter Mode
For the supervisory processor, use the adapter’s configured I/O rack number to receive data or store data for transfer.
Using Rack 3 (Addresses 0:30-0:37 and I:30-I:37) Rack 3 is the default discrete-transfer file for PLC-5/12, -5/15, and -5/25 processors. Typically, each output instruction in one processor should have a corresponding input instruction in the other processor. The rack number determines the addresses you use. The ladder logic in the supervisory processor uses the rack number (0-76 octal) of the adapter-mode processor. Condition the ladder logic in the adapter processor with I30/10. When set, this bit indicates a communication failure between the adapter and supervisory processors.
Creating an Adapter Image File PLC-5/12, -5/15, and -5/25 Processors If you use 1/2-slot addressing in a 16-slot chassis, you need rack 3 addresses for scanning processor-resident local I/O on the adapter-mode processor. In this case, you can create an adapter image file for transferring data. Before you create an adapter image file, make sure that these conditions are true: the PLC-5 processor is in adapter mode the adapter-mode processor is in a 1771-A4B I/O chassis you are using 1/2-slot addressing you have not inhibited rack 3 by setting the rack inhibit bit 3 in processor status word 27 To create the adapter image file, create a 16-word integer file. This file must be 16 words regardless of whether you use 4-word or 8-word transfers. This file must be a unique integer file, for use only as an adapter image file. Words 0-7 are used for output; words 8-15 are used for input. Bits are numbered in decimal 0-15 for each word. To tell the processor which file is the adapter image file, enter the file number in word 25 of the processor status file. You enter this file number on the processor status screen. For more information about the processor status screen, see the chapter on using status data in the programming software documentation. Important: If you are using an adapter image file (instead of the rack 3 image), then you cannot use block transfers between the supervisor and the adapter-mode processor.
8-4
Page 100
Chapter 8 Transferring Discrete and Block-Transfer Data
Condition the ladder logic in the adapter-mode processor with word 8, bit 8 decimal of the adapter image file. When set, this bit indicates a communication failure between the adapter and supervisory processors. ATTENTION: Do not program block transfers to a supervisory processor if you create an adapter image file.
Transferring Bits between Supervisory and Adapter-Mode Processors Figure 8.2 shows ladder logic for transferring bit 17 of the supervisory processor’s output image word 7 and bit 16 of the adapter-mode processor’s output image word 5. The x represents the adapter-mode processor’s rack number; rack 3 is the simulated rack for the adapter-mode processor. This example assumes 1-slot or 2-slot hardware addressing. Figure 8.2 Transferring Bits Using Rack 3 in the Adapter-Mode Processor Supervisory Processor (PLC-2)
Ix5
Adapter Processor (PLC-5)
0x7
I:37
17
17
O:35
16
16
When the supervisory processor sets its output file bit 0x:7/17, input file bit I:37/17 in the adapter-mode processor is automatically set. In the same way, when the adapter-mode processor sets output file bit O:35/16, input file bit Ix:5/16 in the supervisory processor is automatically set. Figure 8.3 shows the ladder logic if you created an adapter image file because you need rack 3 addresses for local I/O. This example uses N51 as the adapter image file. Figure 8.3 Transferring Bits Using Your Own Adapter Image File Supervisory Processor (PLC-2)
Ix5 16
Adapter Processor (PLC-5)
0x7
N51:15
17
15
N51:05 14
8-5