Documentos de Académico
Documentos de Profesional
Documentos de Cultura
A.I. SERIES
PROGRAMMING GUIDE
Copyright Notice
Printed in the United States of America Portions copyrighted by Allen-Bradley Company, Inc. and used with permission. This manual and any accompanying Rockwell Software products are copyrighted by Rockwell Software Inc. Any reproduction and/or distribution without prior written consent from Rockwell Software Inc. is strictly prohibited. Please refer to the license agreement for details. Trademark Notices WINtelligent Series is a registered trademark. The Rockwell Software logo, RSAssistant, RSBatch, RSData, RSLogix Emulate 5, RSLogix Emulate 500, RSGuardian, RSHarmony, RSKeys, RSLinx, RSLogix 5, RSLogix 500, RSPower, RSPowerCFG, RSPowerRUN, RSServer32, RSServer, RSServer Toolkit, RSSql, RSToolbox, RSTrainer, RSTrend, RSTune, RSView32, RSView, RSWire, A.I. Series, Advanced Interface (A.I.) Series, AdvanceDDE, ControlGuardian, ControlView, INTERCHANGE, Packed DDE, PLC-500, WINtelligent, WINtelligent EMULATE 5, WINtelligent EMULATE 500, WINtelligent LINX, WINtelligent LOGIC 5, WINtelligent VIEW, WINtelligent RECIPE, WINtelligent VISION, WINtelligent VISION2 are trademarks of Rockwell Software Inc. PLC, PLC-2, PLC-3 and PLC-5 are registered trademarks, and Data Highway Plus, DH+, DHII, DTL, Network DTL, Pyramid Integrator, PanelBuilder, PanelView, PLC-5/250, PLC-5/20E, PLC5/40E , PLC-5/80E, SLC, SLC 5/01, SLC 5/02, SLC 5/03, SLC 5/04, and SLC 500 are trademarks of the Allen-Bradley Company, Inc. Microsoft, MS-DOS, Windows, and Visual Basic are registered trademarks, and Windows NT and Microsoft Access are trademarks of the Microsoft Corporation. Ethernet is a registered trademark of Digital Equipment Corporation, Intel, and Xerox Corporation. IBM is a registered trademark of International Business Machines Corporation. AIX, PowerPC, Power Series, RISC System/6000 are trademarks of International Business Machines Corporation. UNIX is a registered trademark in the United States and other countries, licensed exclusively through X/Open Company Limited. All other trademarks are the property of their respective holders and are hereby acknowledged. Warranty This Rockwell Software product is warranted in accord with the product license. The product's performance will be affected by system configuration, the application being performed, operator control and other related factors. The product's implementation may vary among users. This manual is as up-to-date as possible at the time of printing; however, the accompanying software may have changed since that time. Rockwell Software reserves the right to change any information contained in this manual or the software at anytime without prior notice. The instructions in this manual do not claim to cover all the details or variations in the equipment, procedure, or process described, nor to provide directions for meeting every possible contingency during installation, operation, or maintenance.
Table of Contents
1 2 Introduction ........................................................................................................1-1 How to Use This Manual ................................................................................................. 1-2 Planning Programs for Your Application..........................................................2-1 Functional Specification ........................................................................................... 2-2 Detailed Analysis ..................................................................................................... 2-2 Program Entry.......................................................................................................... 2-2 Testing ..................................................................................................................... 2-3 Acceptance ............................................................................................................... 2-3 Using Main Control Programs......................................................................................... 2-4 How the Processor Interprets the MCPs .................................................................... 2-4 Configuring Main Control Programs ............................................................................... 2-6 Specifying The Order of Main Control Programs...................................................... 2-6 Disabling Main Control Programs ............................................................................ 2-6 Monitoring Main Control Programs ................................................................................ 2-7 Using Interrupt Programs ................................................................................................ 2-8 Designing Programs for Your Application........................................................3-1 Machine Example ........................................................................................................... 3-2 Creating the Functional Specification.............................................................................. 3-3 Creating the Detailed Analysis ........................................................................................ 3-5 Entering the Program ...................................................................................................... 3-9 Using Other Processor Programming Features............................................................... 3-11 Examples of Special Programming Applications..................................................... 3-12 Checking for Completeness ........................................................................................... 3-13 SFC Building Blocks ..........................................................................................4-1 SFC Building Blocks....................................................................................................... 4-1 Step.......................................................................................................................... 4-1 Transition................................................................................................................. 4-2 Simple Path.............................................................................................................. 4-2 Selection Branch ...................................................................................................... 4-3 Simultaneous Branch................................................................................................ 4-4 GOTO and Label Statements .................................................................................... 4-5 Drawing an SFC.............................................................................................................. 4-6 Example SFC ........................................................................................................... 4-8 How Selection Branches Work.................................................................................. 4-9
How Simultaneous Branches Work ......................................................................... 4-10 Using GOTOs and Labels ....................................................................................... 4-11 Using the SFR Instruction.............................................................................................. 4-12 5 Writing Ladder Logic......................................................................................... 5-1 Converting Machine Statements to Ladder Logic............................................................. 5-2 Rung Logic Example ................................................................................................ 5-3 Example Discrete I/O Instructions ............................................................................ 5-3 Constructing Ladder Rungs ............................................................................................. 5-5 Writing Rung Logic.................................................................................................. 5-5 Writing Branch Logic ............................................................................................... 5-7 Arranging Input Instructions ......................................................................................... 5-10 Organizing Data Table Files.............................................................................. 6-1 Understanding Data Storage ............................................................................................ 6-2 Organizing Data into Files and Data Blocks .................................................................... 6-4 Default Data Table Files .................................................................................................. 6-6 Addressing Data Table Files............................................................................. 7-1 Specifying Logical Addresses .......................................................................................... 7-2 Using Address Mnemonics ....................................................................................... 7-4 Specifying I/O Image Addresses ...................................................................................... 7-6 Specifying Indirect Addresses .......................................................................................... 7-8 Specifying Indexed Addresses........................................................................................ 7-10 Indexed Addressing Example.................................................................................. 7-11 Specifying Symbolic Addresses...................................................................................... 7-12 SoftLogix 5 Symbols............................................................................................... 7-13 Addressing Frequently Used Files.................................................................................. 7-14 Status File for PLC5/10, PLC5/12, and PLC5/15 Processors.............................. 7-15 Status File for PLC5/25 Processors....................................................................... 7-15 Using a Selectable Timed Interrupt .................................................................. 8-1 Writing STI Ladder Logic ............................................................................................... 8-2 Setting Up an STI............................................................................................................ 8-3 Storing the Location of the STI File in the Processor Status File ............................... 8-3 Block Transfers Used Within an STI......................................................................... 8-4 Using a Processor Input Interrupt .................................................................... 9-1 Writing PII Ladder Logic................................................................................................. 9-2 PII Application Examples ................................................................................................ 9-4 Using Counter Mode................................................................................................. 9-4 Using Bit Transition Mode........................................................................................ 9-4 Setting Up a PII ............................................................................................................... 9-6
ii
Table of Contents
Configuring the PII .................................................................................................. 9-6 Block Transfers Used Within a PII ........................................................................... 9-7 Monitoring a PII.............................................................................................................. 9-8 PII Return Mask ....................................................................................................... 9-8 PII Accumulator ....................................................................................................... 9-8 PII Scan Times ......................................................................................................... 9-8 10 Writing a Fault Routine ....................................................................................10-1 Using Fault Routines ..................................................................................................... 10-2 Responses to a Major Fault ..................................................................................... 10-2 Major Fault Codes .................................................................................................. 10-3 Programming a Fault Routine........................................................................................ 10-8 Set an Alarm .......................................................................................................... 10-8 Clearing the Fault................................................................................................... 10-8 Using Shutdown Logic ..........................................................................................10-10 Testing a Fault Routine .........................................................................................10-10 Setting Up a Fault Routine ...........................................................................................10-11 Enabling a Fault Routine .......................................................................................10-11 Changing the Fault Routine from Ladder Logic.....................................................10-11 Clearing a Major Fault ..........................................................................................10-12 Setting PowerUp Protection........................................................................................10-13 Allowing or Inhibiting Startup...............................................................................10-13 Using Adapter Mode.........................................................................................11-1 Using Adapter Mode ..................................................................................................... 11-2 Operating in Adapter Mode........................................................................................... 11-3 Configuring an Original PLC-5 Processor for Adapter Mode.................................. 11-3 Configuring a New Platform PLC-5 Processor for Adapter Mode............................ 11-4 Transferring Discrete I/O and Block Data ..................................................................... 11-5 Programming Discrete Data Transfers........................................................................... 11-8 Using Rack 3.......................................................................................................... 11-8 Creating an Adapter Image File - Original PLC-5 Processors ................................. 11-9 Creating an Adapter Image File - New Platform PLC-5 Processors......................... 11-9 Transferring Bits between Supervisory (PLC-2) and Adapter Processors................11-10 Determining the Status of the Adapter Processor ...................................................11-11 Determining the Status of the Supervisory Processor .............................................11-12 Programming Considerations for Using Adapter Mode.................................................11-13 Programming Block Transfers - Original PLC-5 Processors .........................................11-14 Addressing Tips for Block Transfers......................................................................11-15 Example Ladder Logic .................................................................................................11-18 Supervisory Processor (PLC2/30, PLC3, PLC5, or PLC5/250) .......................11-18 Adapter Processor (PLC5/15, 5/25)....................................................................11-23
11
iii
Adapter Processor (New Platform Processors) ....................................................... 11-24 12 Using Scanner Mode ....................................................................................... 12-1 Operating in Scanner Mode ........................................................................................... 12-1 Configuring an Original PLC5 Processor for Scanner Mode.................................. 12-1 Configuring a New Platform PLC5 Processor for Scanner Mode ........................... 12-1 Transferring Discrete Data ............................................................................................ 12-2 Transferring Block Data ................................................................................................ 12-3 Queued Block Transfer Requests............................................................................. 12-4 Block Transfers to Local I/O ................................................................................... 12-4 Block Transfers to Remote I/O................................................................................ 12-4 Block Transfers in Fault Routines or Selectable Timed Interrupts (STIs)................. 12-5 Block Transfer Sequence Original PLC-5 Processors ..................................................... 12-6 Block Transfer Sequence New Platform PLC-5 Processors............................................. 12-8 Block Transfer Sequence with Status Bits ............................................................... 12-9 Block Transfer Timing: Original PLC-5 Processors .................................................... 12-11 Instruction Run Time............................................................................................ 12-11 Waiting Time in the Queue................................................................................... 12-11 Transfer Time....................................................................................................... 12-11 Block Transfer Timing: New Platform PLC-5 Processors............................................ 12-12 Instruction Run Time............................................................................................ 12-12 Waiting Time in the Holding Area........................................................................ 12-12 Transfer Time....................................................................................................... 12-12 When the Processor Detects a Major Fault ................................................................... 12-13 When a Resident Local I/O Rack Faults....................................................................... 12-14 When a Remote I/O Rack Faults .................................................................................. 12-15 Recovering from a Resident Local I/O or Remote I/O Rack Fault................................. 12-16 Using I/O Status File Bits to Monitor Rack Faults................................................. 12-16 Using Fault Routine and Ladder Logic to Recover................................................. 12-17
Index
iv
Introduction
Introduction
This manual provides you with information about programming the AllenBradley PLC5 family of programmable logic controllers. This information includes: Planning your projects Basics of SFC programming Basics of ladder logic programming Basics of the PLC5 data table, including the various methods you can use to address data table files Using selectable timed interrupts, processor input interrupts, and fault routines Setting up the processor for adapter and scanner mode Programming through a serial port
Note
Command Portal keys for this function: .UUKI
For information on the PLC5 instruction set, see the Instruction Set Reference or the instruction set help in the software (from the Online or Offline Editor, select [F6] Utility, [F9] Util2, [F7] Keyconf, [F4] Inshelp or press [Shift-F10]). PLC-5 processors can be grouped into three categories: Original (classic ), New Platform (NP5 or Enhanced), and Secure. As much as possible, this manual will refer to a group of processors rather than listing individual models. The table below lists the different processors in each category. (The processor type given includes all variants of that processor: L-Local, E-Ethernet, C-ControlNet, and V-VME.)
Original PLC-5/10 PLC-5/12 PLC-5/15 PLC-5/25 PLC-5/VME New Platform PLC-5/11 PLC-5/20 PLC-5/30 PLC-5/40 PLC-5/60 PLC-5/80 Secure PLC-5/16 PLC-5/26 PLC-5/36 PLC-5/46 PLC-5/66 PLC-5/86
1-1
1-2
Acceptance Sign-off
Detailed Anaylsis
Testing
Program Development
Each box represents an activity that you perform. Begin with the functional specification, and move on to the detailed analysis. Based on the detailed analysis, you can enter your programs and test them. When testing is complete, you are ready to implement the programs in your application. This model also allows for interaction of the activities at the different levels. The detailed analysis can be used as the basis for developing your testing procedures and requirements. And, because the functional specification is well thought out, it can be used as the program signoff document.
2-1
Not all machine processes can be controlled with an SFC implementation; the following description of the program development model is generalized to fit most processes. The power of an SFC is that it is a descriptive programming language that you can use to describe your process in terms of machine states and transition conditions. Because this description executes your process control, your SFC provides the link between these two legs of the development model.
Functional Specification
The functional specification represents a very general view of your process or a description of operation. Identify the events and the overall order in which they must occur. This functional specification can be in any form: written statements, flowcharts, or rough-draft sequential function charts (SFC). Use the form that is most familiar to you. AllenBradley recommends that you generate a rough-draft SFC so that you have a better correspondence between your beginning diagrams and your finished program.
Detailed Analysis
In this phase, you take the functional specification and add the details of your process. Identify your inputs and outputs, specific actions and transitions between actions (that is, the bit-level details needed to write your program. If you are using a New Platform or Secure PLC-5 processor, you also determine the number of Main Control Programs (MCPs) and the programming method for each during this phase. Use MCPs when you are describing your process in terms of function or in terms of geography. You then break down those functions into ladder programs, sequential function charts (SFCs), or structured text. For typical SFC applications, an SFC program controls the order of events in your process by issuing commands. A command, such as fwd_conv_cmd to move a conveyor forward, is simply a data table storage bit (for example B3:0/7) which you set up in the SFC. You then program the ladder logic for fwd_conv_cmd in a separate ladder program to control the actual outputs to move the conveyor. The ability to have one SFC program defining the sequence and then separate ladder logic programs controlling outputs is the basis of New Platform and Secure PLC-5 processors main control program feature. For more information on this feature, see the next section, titled Using Main Control Programs. If you are using an Original PLC-5 processor, note that you can have only one main program. For information on planning a design specification using only one main program, see Chapter 3 Planning Programs for Your Application.
2-2
Program Entry
In this phase, you enter the programs into your computer using the SFC Editor, Ladder Editor, or Structured Text Editor. For more information on entering SFCs, ladder logic, or structured text, see the PLC5 A.I. Series Software Reference manual.
Testing
In this phase, you test the programs you have entered. You may want to consider using RSLogix Emulate 5 processor emulation to simulate your system.
Acceptance
Once testing is complete, your resulting programs should match your functional specification.
2-3
2-4
If the MCP is a ladder program, the program is executed normally (that is, rungs are executed from the first rung to the last, with all timers, counters, jumps and subroutines active). After the END instruction in the ladder program, the processor initiates an I/O update (reading local inputs, writing local outputs, reading remote buffers and writing remote outputs to the buffer). The next MCP is then started. If the MCP is a structured text program, the program is executed normally. After the last line in the structured text program, the processor initiates an I/O update and the next MCP is started. If the MCP is a sequential function chart, only the active steps are scanned and transitions from those active steps are examined; then (after one complete pass through the active steps) the processor initiates an I/O update and the next MCP is started.
2-5
!
Note
If you disable an MCP, outputs remain in the state that they were in during the last scan (that is, all actions remain active). Make sure you consider any outputs that might be controlled within that MCP before disabling it. Otherwise, injury to personnel or damage to equipment may result. If the disable bit is set for all MCPs, a minor fault occurs to warn you that no MCPs are executing.
2-6
2-7
If an interrupt occurs during the execution of an MCP, the processor stops the MCP, executes the interrupt program, and returns control to the MCP at the point that it was stopped. You can protect important parts of your main control programs from interruption by using the User Interrupt Disable (UID) and User Interrupt Enable (UIE) instructions. These instructions allow you to temporarily disable interrupts. If a condition arises that would normally call for the interrupt program, these instructions tell the processor to finish executing the rungs in the MCP first. For more information on these instructions, see the PLC5 A.I. Series Instruction Set Reference manual. Remember, however, that interrupt programs are reenabled at each END instruction (regardless of the UID state). If you want to completely disable an interrupt program, enter a 0 in the appropriate address of the processor status file. For Original PLC-5 processors, disable the STI by entering 0 in S:31, using the Processor Status screen For New Platform and Secure PLC-5 processors, disable the STI by entering 0 in S:31, and disable the PII by entering 0 in S:46, using the Processor Configuration screen.
For more information on disabling interrupts in the status file, see the PLC5 A.I. Series Software Reference manual.
2-8
3
Note
3-1
Machine Example
The following example uses a description of a specific machine operation to show how to identify conditions and actions and how to group the actions into steps of machine operation. The drawing below shows a hardware block diagram.
Off Auto Conveyor Motor Fwd Load Station Fwd Fwd
Advance Assembly
Clamp CL1
N.C.
LS2
LS3 N.O.
N.O. LS4
Unload Station
3-2
The drill station moves forward and closes LS3. This action turns on the drill motor. The drill station moves to full depth and closes LS4. This action: a. b. Stops forward motion of the drill station Initiates a 2second dwell
7. 8. 9.
The drill station backs up after the 2second dwell. The drill motor stops when LS3 is released. The drill station reaches home position and opens LS2. This action: a. b. c. Stops the reverse motion Opens the clamp Starts the conveyor forward
10. The wood is ejected when LS5 toggles to indicate the cycle is complete. We recommend that you create a roughdraft SFC to represent this general description. An SFC is drawn using a series of boxes and lines. A box represents a step, or one independent machine operation. A transition, shown as a in the drawing below, is a logic condition that lets the processor progress from one step to the next.
3-3
initialization
010
conveyor forward
011
drill
012
dwell
013
reverse drill
014
eject
015
For more information on the building blocks of SFC diagrams, see Chapter 4- SFC Building Blocks.
3-4
Use the hardware requirements (with the functional specification) to match the inputs and outputs with the actions of the process. The table below shows the hardware requirements with the general description for the drill machine example.
When This Happens: AUTO switch closes LS1 closes Take This Action: conveyor moves forward conveyor stops clamp holds wood drill station advances drill motor starts drill station stops dwell timer starts drill station backs up drill motor stops (CMF = on) (CMF = off) (CL1 = on) (DSF = on) (DM = on) (DSF = off) (TMR1 = on) (DSB = on) (DM = off)
3-5
Take This Action: drill station stops clamp releases wood conveyor starts wood is ejected (DSB = off) (CL1 = off) (CMF = on)
LS5 closes
Once you identify the individual actions, you can add these actions to your functional specification to complete the planning of your program. The following drawing shows the detailed analysis of the drill machine example.
3-6
action name
2
010
init
conveyor forward
011
LS1 wood in position ladder file action name clamp_on drill_adv drill_on
drill
4 5 6 012
dwell 013 TMR1 dwell timer done ladder file 7 8 014 LS2 station home ladder file 9 action name clamp_off action name rev_drill drill_move
reverse drill
eject
015
3-7
Now that you have an SFC program that defines the individual machine actions for your process (Process Sequence MCP), you can create a ladder logic program that controls the outputs of those machine actions (Outputs MCP). The order in which you program these rungs does not matter. This program merely contains the ladder logic that defines a command for each machine action in your process. Your Process Sequence MCP determines in what order they are executed. You can also create a Modes MCP that defines the operation of your hardware in the different machine modes (Auto, Manual, Fault, Cycle Start/Stop, etc.).
3-8
3-9
012
* Any symbol can be used for this "command" to control an output. drill station forward
Manual mode
Jog pushbutton
Ladder Logic for Modes MCP (rung that controls Auto mode)
Auto pushbutton All_home Manual pushbutton Fault mode Auto mode
Auto mode
3-10
The table below explains when to use these special programming features.
If a Portion of Logic Mark that Should Execute: Portion with a: Description: Immediately upon Power-up/Fault detecting conditions Routine that require a startup Create a separate file for a controlled startup procedure, for the first time you start a program or when you start a program after system down time. The processor executes the power-up/fault routine to completion. Create a separate program file and specify the interrupt time interval. The processor interrupts the main logic program at the specified interval, runs the STI to completion, then resumes the main logic program where it left off.
Immediately when an Processor Input Create a separate program file and specify 16 event occurs Interrupt (PII) inputs of an input word in the I/O rack. When the event(s) occurs, the processor interrupts the main logic program, runs the PII to completion, then resumes the main logic program where it left off. This feature is only available with New Platform and Secure PLC-5 processors. Immediately upon detecting a major fault Fault Routine Create a separate file for a controlled response to a major fault. The first fault detected determines which fault routine is executed. The processor executes the fault routine to completion. If the routine clears the fault, the processor resumes the main logic program where it was interrupted. If not, the processor faults and switches to program mode.
3-11
Take a measurement and compare it with a standard every STI 1.0 seconds
3-12
3-13
4
Note
Step
A step typically represents an independent machine state. One step of ladder logic runs repeatedly, top to bottom, until a logic condition (transition) lets the processor progress to the next step of the chart. You draw a step as a numbered and labeled box in the SFC. The number 007 in the example below represents the ladder file number that contains the ladder logic for that step.
4-1
007
} Step
New Platform and Secure PLC-5 processors can have up to eight actions per step. An action is a subset of a step. Instead of assigning a single ladder file to a step, you can assign individual ladder files to actions of a step to better represent the individual pieces of your operation.
Transition
A transition represents the logic condition that lets the processor progress from one step to the next. You draw a transition as a numbered cross below its step (see the following drawing).
017
EOT Transition
Every transition must contain at least one EOT (End of Transition) instruction.
Simple Path
A simple path contains a series of steps and transitions that execute one at a time in sequence.
4-2
Mixer 1
007
009
Dump 1
008
010
Selection Branch
A selection branch contains alternative paths from which the processor selects one. This is equivalent to an OR structure. Draw a selection branch as parallel paths connected with single horizontal lines (see the drawing below). Notice that transitions are located within the structures boundaries and are at the top of each parallel path.
003
016 013
015
017
010
4-3
Simultaneous Branch
A simultaneous branch runs steps simultaneously that are in parallel paths (the processor shares processing time for each path). This is equivalent to an AND structure. Draw a simultaneous branch as parallel paths connected with double horizontal lines as shown in the following drawing. Notice that a common transition for the last step in all the paths is outside of the branch. The processor finishes running a simultaneous branch when it has scanned each step in each path at least once and the common transition is true.
Mixer 1
010
026
When using simultaneous branches, you may want to include a dummy step at the end of each path to synchronize the simultaneous actions. This dummy step merely holds each path (until all paths have been executed) before moving on to the transition. Using the example above, the structure would look like the following:
Mixer 1
010
Dummy
015
Dummy
015
Dummy
015
026
4-4
You can combine SFC building blocks (step, transition, selection branch, and simultaneous branch) to build structures that represent your programming application.
003:
015
016 GO TO 003
017 018
019
4-5
Drawing an SFC
After you identify the major areas of machine operation, convert the logical paths and steps that you labeled in your design specification to SFC building blocks. The table below helps explain when to use which SFC building blocks. Note At this point, do not worry about the actual ladder logic for each step and transition. After you complete the SFC, you can develop the ladder logic.
Then Draw: A step/transition pair Using These Rules: A step must always be followed by a transition. For design purposes, number steps and transitions consecutively from 2. Start the path with a step; end the path with a transition.
A clearly defined chain of events that occur sequentially For example, in one heat treating area, the temperature must ramp up at a particular rate, maintain the temperature for a certain duration, then cool at a particular rate. Two or more alternative paths where only one is selected For example, depending on a build code, one station must either drill or polish.
A selection branch
The transitions beginning each path are scanned from left to right. The first true transition determines the path taken. For an Original PLC-5 processor, you can define up to 7 paths in the structure. For a New Platform or Secure PLC-5 processor, you can define up to 16 paths. See How Selection Branches Work on page 4-9. All paths are active in the structure. For an Original PLC-5 processor, you can define up to 7 parallel paths. For a New Platform or Secure PLC-5 processor, you can define up to 16 parallel paths. See How Simultaneous Branches Work on page 4-10.
Two or more parallel paths that must be scanned at least once For example, communications and block transfers must occur while control logic is executing.
A simultaneous branch
For special cases, use the rules listed in the following table.
4-6
If You Have: To jump within the SFC A step that needs to be run in multiple places within the SFC A step that can be ignored based on logic conditions
Then: Use a GOTO statement and label. See Using GOTOs and Labels on page 4-11. Repeat the step where needed or use a global subroutine that gets called from multiple steps by the same processor. Create two selection branches, one with and one without the step; place the step in a subroutine; or combine the step with another step that is segregated by an MCR zone. Nest the branch structures. The software supports as many levels of nested branches as you can store based on processor memory. Use the SFR instruction to reset the chart. See the Instruction Set Reference manual. Set the disable bit for the MCP on the Processor Configuration screen. See the PLC5 A.I.Series Software Reference manual.
An SFC branch structure within another branch structure (nesting) To reset the logic in an SFC program To disable a Main Control Program (New Platform and Secure PLC-5 processors only)
4-7
Example SFC
Initial Step
002
003
004
006 008
007 009
010 012
011
013
014
005
015
4-8
4-9
4-10
The following table lists considerations for selecting SFC scan sequences.
Control Characteristic: When a transition is true, the processor scans that step one last time so that the processor can reset non-retentive outputs. Considerations: Your application may have to consider the extra time for the post scan. If you are using a New Platform or Secure PLC-5 processor, you can configure your SFC program to do a manual reset instead of an automatic reset.
The processor cannot exit the simultaneous The last step in each path of a simultaneous branch must be executed branch until the last step in each path has been executed. before the processor scans the common transition.
Rules for Placing GOTOs and Labels You can only place GOTOs at the end of the SFC or after the last transition of a selection branch. You can only place labels immediately before a step or before a simultaneous branch. You cannot place a label between a step and its transition.
4-11
Use the SFR instruction with care. Unexpected machine motion could injure personnel.
Use the SFR instruction to handle situations that require resetting your machines. For example, if a machine goes out of alignment, use the SFR to reset the chart, align the machine, and then disable the SFR to start the SFC again. For more information on the SFR instruction, refer to the Instruction Set Reference manual.
4-12
5-1
To write ladder logic, you need to understand these definitions: Rung a logic statement that controls one or more bits based on the state of other bits examined. Ladder logic is composed of a listing of rungs. Each rung connects at one point to the left and right power rails. A rung must have at least one output instruction. Input (condition) instructions examine input and output conditions that then determine the true or false state of the instruction. These commands appear on the left side of a rungto the left of the output instructions. A rung may have multiple input instructions. Output (control) instructions control the state of a bit or bits based on input (condition) instructions. These commands are placed on the right side of a rung, to the right of the input instructions. Each rung must have at least one output instruction (or more).
5-2
Rung 3
Rung 4 Rung 5
Note
Each input instruction and output instruction you enter generates a rung element. As each input instruction is executed, the addressed bit is examined to see if it matches a certain condition (on or off). If the condition is found (rung 1 above), the rung element is set true. Input instructions must contain a continuous path of true elements from the start of the rung to the output instruction for the output instruction to be enabled. If a rung element is unconditioned (that is, has no input instructions as in rung 4 above), the output instruction is always enabled. The PLC5 A.I. ladder editor highlights logically true instructions when the processor is in run, remote run, or test mode.
5-3
Output Energize
An output instruction that controls the status of one bit (which in turn could control the on/off status of the output device).
If the instruction is: enabled (rung is true) disabled (rung is false) Then the bit is: set to 1 reset to zero
For information about other available instructions, refer to Allen-Bradley's Instruction Set Reference manual or to the online help in PLC-5 A.I. Series (accessed with the command sequence .UUKI or [Shift-F10] then [F4]).
5-4
Some input devices and input modules use inverse (negative) logic where a logically true condition turns the bit off, and a logically false condition turns the bit on. If used incorrectly, these instructions can cause unexpected operation with damage to equipment or injury to personnel. Arrange input instructions on the lefthand side of the rung as shown in the table below.
If you have multiple input conditions and: all conditions must be true to take action (logical AND) any of several conditions must be true to take action (logical OR) Then arrange the instructions: in series
] [
in parallel
] [
] [
] [ ] [ ] [
in series and parallel
] [ ] [
] [
5-5
Arrange output instructions on the righthand side of the rung as shown in the table below.
If you program: a single output instruction Then arrange the instruction(s):
( )
multiple output instructions Note All parallel outputs are enabled when the logic path becomes true.
in parallel
( ) ( ) ( )
in a separate output branch
] [
Rung Example A statement of machine operation reads:
( ) ( )
Label each instruction with the name of the device it examines or controls. You can program as many instructions per rung as you want.
When LS1 and LS2 are closed, or when SW6 is closed, turn on FAN1 and BULB1.
Translate the statement to a rung as follows: The when indicates an input condition. The and indicates serial input conditions The or indicates parallel input conditions. The turn on portion of the statement indicates two outputs (in parallel). When input conditions provide a logically true path across the rung, the rung is true and the outputs are energized.
5-6
The drawing below shows what a rung would look like for the above statement of machine operation with the outputs in parallel.
LS1 LS2 FAN1 BULB1
SW6
An output branch must end with an output instruction. For example, input instruction (A) is not allowed in that position:
Nested Branching Input and output branches can be nested to avoid redundant instructions and to provide more efficient programming. A nested branch is a branch that starts or ends within another branch. You can nest branches up to four levels deep.
5-7
] [
] [ ] [ ] [ ] [ ] [ ] [
] [ ] [ ] [
( ) ( ) ] [ ( )
] [
Nested branching can be converted into non-nested branches by repeating instructions to make parallel equivalents.
A B C F
] [
] [ ] [
E D
] [
( )
] [
Nested Branch
] [
] [ ] [ ] [
E D
] [ ] [
C
( )
Execution Time and Branch Structure Considerations In general, non-nested branches are more efficient than nested branches. Both of the examples shown below accomplish the same result with the same number of output instructions; however, the non-nested branching example is evaluated approximately 1 microsecond faster than the nested branching example.
5-8
Non-Nested Branching
Nested Branching
( ) ( ) ( )
( ) ( ) ( )
Branches can only be nested four deep, but are otherwise limited only by processor memory.
5-9
For example:
Most likely to be FALSE Most likely to be TRUE
Place the input path that is most likely to be true as the top path in a branch. Place the less likely to be true input branches further down in the branch.
For example:
Path most likely to be true less likely least likely
5-10
In addition, the processor uses other areas of data storage to: Control instructions Store system status
The drawing below shows the relationship between I/O modules, data storage, and ladder programs.
DATA STORAGE
6-1
File 999
Files are made up of elements. Typically, these are 16bit data values. When you need to access this data, you specify it with a formatted address. For information on address formats refer to the Hardware Interface Configuration User's Guide or your Allen-Bradley documentation.
Integer File sample data integer elements 10201 File # 64 7779 2
6-2
Each element contains multiple bits. This is the smallest division of data. A bit contains a value of zero or one. When you need to access this data, you specify it with a formatted address.
Integer Element
276
Some sections of data storage are used to control instructions. Within these sections, data is subdivided into subelements at the bit or word level. When you need to access this data, you specify it with a formatted address.
Timer File # timer sub-elements samle data 2760 (preset .PRE) 432 (accumulated .ACC) 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 control (control word contains enabled (.EN), timing (.TT), and done (.DN) bits)
Timer #
In addition to the processordefined structures, you can organize the data in files into data blocks that help group and organize logically related data. When you need to access this data, you specify only the starting address within the file instead of each individual address.
File # Starting addr (Length) Starting addr (Length) Starting addr (Length) up to 999 elements recipe A" data recipe B" data production counts
6-3
You might also want to leave room for future expansion when grouping data. Do this by leaving gaps between Note Data blocks within a file Groups of sequentially numbered files Modules in an I/O chassis
Gaps in the numbering system use several words of overhead memory for each file or data block you skip. However, if you plan on programming online, gaps are necessary since you cannot create or delete data files while in RUN mode. Use care when leaving gaps. Follow these rules when organizing your data files: Group large amounts of related data into files. Address the data files from 3999 as needed. The table on page 6-6 lists the default data table file numbers. Address the elements needed in each data file consecutively from 0999. Address the words of I/O image data according to how you configured your I/O:
037 (octal) for PLC-5/10, -5/12, -5/15, -5/11, -5/20 077 (octal) for PLC-5/25, -5/30 0-177 (octal) for PLC-5/40 0-277 (octal) for PLC-5/60, -5/80
6-4
When organizing bit data, address the bits in each element 015 (decimal) for binary or integer files. When addressing I/O image bits, address them 0007 or 1017 (octal).
6-5
6-6
7-1
*File type only available on New Platform PLC-5 processors. Note 2. Although files 3 through 8 are defaults, they may be used for other purposes if deleted and then recreated as a different file type.
Include a colon (:) followed by the element number. You can substitute a semi colon (;) for the colon (:) delimiter.
7-2
3. 4
If you want to specify a bit number, include a front slash (/), period (.), or a space, followed by the bit number. A space appears as an underscore (_) character. If you want to address a member, such as a done bit or an accumulated value, include a front slash (/), period (.), or a space, followed by the mnemonic. A space appears as an underscore (_) character.
For more information on the structure and addressing of the different data types, refer to the 1785 PLC-5 Programmable Controllers Addressing Reference document. Note Use the / delimiter only for addressing bit numbers. Do not use it to address data bits by mnemonic. Never use it for a division symbol. The division symbol is the vertical bar ( | ).
7-3
7-4
The following is a partial list of reserved word (w) and bit (b) mnemonics. More mnemonics can be found in the 1785 PLC-5 Programmable Controllers Addressing Reference.
Timer .ACC (w) .PRE (w) .EN (b) .TT (b) .DN (b) Counter .ACC (w) .PRE (w) .CU (b) .CD (b) .DN (b) .OV (b) .UN (b) .UA (b) Control .POS (w) .LEN (w) .EN (b) .EU (b) .DN (b) .EM (b) .ER (b) .UL (b) .IN (b) .FD (b)
Nonreserved mnemonics can be accessed only by using the ( . ) delimiter. For example, if the symbol PID_LOOP1 is assigned to address PD21:0, then the setpoint subelement would be addressed as PID_LOOP1.SP but not as PID_LOOP1_SP or PID_LOOP1/SP.
7-5
00-03 octal for PLC5/10, -5/11, -5/12, -5/15, -5/20 00-07 octal for PLC5/25, -5/30 00-17 octal for PLC5/40 00-27 octal for PLC5/60, -5/80
Include the I/O group number (0-7). Include a front slash (/) as a terminal delimiter followed by the terminal number (0-7, 10-17).
7-6
7-7
Note
Instructions with indirect addresses execute slower than instructions with direct addresses because the processor has to look up each indirect address. Allocate addresses in the data table to include any indirect addresses you specify. The data table will not automatically expand to include indirect addresses.
Examples Indirect Component Indirect Address Refers To N[O:017]:8/4 T4:[O:017] N20:[O:017]/4 N20:8/[O:017] a file number an element number an element number a bit number If O:017 = 10, then the indirect address refers to N10:8/4 T4:10 N20:10/4 N20:8/10
The data table will expand to include an address used to specify an indirect address. For example, specifying the indirect address N11:[N22:33]/[N44:55] would cause the data table to expand to include the following addresses: N11:0, N22:33, and N44:55.
7-8
When using indirect addressing, the indirect address must point to a valid data file and/or element. During RUN mode operation, if the ladder execution comes across an invalid or out of range indirect address a run time error will occur and the PLC-5 processor will halt. If you are using a New Platform processor prior to series E, and if an invalid address destination is used in an FLL or COP instruction, the instruction will be terminated AFTER one word has been written at the invalid address. The processor continues to operate in run mode.
Note
To monitor or troubleshoot invalid address occurrences, condition the indirect address ladder rung with a limit test of the indirect address to insure that the address stays within the intended range. Conditioning of rungs may be especially advisable if the PLC-5 processor has no control over the indirect address that is being set (that is, the address is determined by values from an I/O module or a peer processor). If you are using a File Copy (COP) or a File Fill (FLL) instruction with Enhanced PLC-5 processors (Series D and earlier), and you specify an indirect address in the destination parameter, you may write data outside of the intended data table file and cause unpredictable controller operation. To ensure that your program correctly references the intended memory location, when using indirect addressing, we highly recommend that your program perform bounds checking via the ladder logic. Although no error messages are reported with New Platform PLC-5 processors (Series D and earlier), when data is written outside of the intended data table file with New Platform PLC-5 processors (series E and later), an indirect address out of range condition is detected, displaying one of the following fault codes:
This Fault Code 20 21 Indicates this Fault Indirect address out of range high Indirect address out of range low
7-9
The processor does not check indexed addresses to make sure that the addresses do not cross data table file boundaries. If the indexed address exceeds the data table area of memory, the processor initiates a run-time error and sets a major fault. Follow these guidelines when specifying indexed addresses: Make sure the offset value (positive or negative) does not cause the indexed address to exceed the file type boundary. When an instruction uses more than two indexed addresses, the processor uses the same index value for each indexed address. Set the offset word to the index value you want immediately before enabling an instruction that uses an indexed address.
File instructions manipulate the offset value stored at S:24. Make sure that you monitor or load the offset value you want prior to using an indexed address; failure to do so could result in unpredictable machine operation with possible damage to equipment and/or injury to personnel. When a User Error Handler, STI routine, or I/O Interrupt routine, is invoked, the S:24 value is stored, and when the routine ends, the original value is restored. Therefore, you cant use these routines to set the value in S:24.
7-10
If the offset value stored in S:24 is 10, then the addresses referenced in the instruction will be as follows.
Base Address Offset Address Source Destination N7:10 N11:5 N7:20 N11:15
7-11
A - Z (upper case) 0-9 _ ! @ % ^ & ( ) | { } \ ; = + - , < > ' ` ~ " If you are using Structured Text, the characters $ ( ) | : ; + = - < and > are NOT valid in symbol names.
Note Note
You can substitute a symbolic address for both the element and bit addresses. Record the symbols you define and their corresponding logical addresses.
Do not use the % character in a symbol name even though it is allowed. Any occurrence of the % character in a symbol name will produce errors when importing or exporting a file. To use symbolic addresses, you assign symbols to logical addresses with the programming software. Symbols are a feature of the programming software, not the processor. If you use PLC5 A.I. on a terminal other than the one in which you defined symbols, you will not have access to the symbol database you created. The software stores the database on the hard disk of the programming terminal that you used to enter the symbols. After you define the symbol for an existing logical address, you can use the symbolic address anywhere else in ladder logic to reference that same address.
7-12
Output image
Element
Note
You can use a symbol when addressing a subelement of a word address. Assign a symbol to the word address and then append the subelement mnemonic to the symbol for the word. For instance, if the symbol for T4:0 is TIMER, then the symbol for T4:0.DN is TIMER.DN.
SoftLogix 5 Symbols
If you are using the SoftLogix 5 controller, Structure Names must start and end with a letter. Structure Names may NOT contain any of the following characters: ` ~ ! @ # $ % ^ & * ( ) - + = { } [ ] | \ : ; " " < > ? , . / or a space
7-13
Status file 2 is fixed at 32 words for Original PLC-5 processors and 128 words for New Platform PLC-5 processors. Files 3999 vary in size. These files contain only the number of words corresponding to the highest address that you assign (see the drawing below).
7-14
PLC-5/15 Word # 0 32 64
64-128
input image
96
96-160
status
256
4096
7-15
8-1
Note
If the interrupt occurs during the execution of an instruction, the processor stops executing the instruction, scans the interrupt file once to completion, and then resumes executing the instruction. In effect, execution of an STI is transparent to program execution time unless you specify too short an interval. An interval that is too short can cause the watchdog timer to time out or cause excessively long program scans.
8-2
Setting Up an STI
To set up an STI, you need to: Create the ladder file and enter the ladder logic Store the location (file number) of the STI program in the processor status file, S:31 Store the setpoint (interval) in S:30
Use ladder logic or the processor configuration screens to enter this information. See the PLC5 A.I. Series Software Reference manual.
Storing the Location of the STI File in the Processor Status File
The table below shows what to store in the processor status file for STI operation.
STI Characteristic: Explanation: Setpoint (interval) Address S:30 enter the setpoint of the STI in milliseconds (1 32,767). If you do not use an STI, enter 0.
Program file number Address S:31 enter the file number of the ladder file that contains the STI program. Entering a 0 in this field disables the interrupt.
For example, you could enter a 7 in S:31 and a 15 in S:30. This will cause the processor to execute ladder file 7 every 15 milliseconds. You can use only one STI at any particular time. However, you can enable or disable the interrupt, or change to a different interrupt file, or change the time between interrupts using ladder logic to change the values in word 30 and word 31 of the processor status file. Note For Original PLC-5 processors: If you disable the STI through ladder logic (by placing a 0 in word 30) and then later reenable the STI, it could take the processor as long as 255 milliseconds before the processor enables the STI. For New Platform PLC-5 processors: If you disable the STI through ladder logic (by placing a 0 in word 30), it could take the processor up to 100ms to reenable the STI. If you disable the STI by writing a 0 to word 31, the processor uses the value in word 30 to determine how often to check for a nonzero value in word 31.
Note
8-3
STI programs lengthen the program scan by an amount equal to the interrupt delay multiplied by the number of times the interrupt occurs during the program scan.
If you are using a New Platform PLC-5 processor, note that the STI last scan time and STI maximum scan time are stored in the status file (S:53 and S:54 respectively).
8-4
9-1
1 ms to switch to the PII task PII ladder logic execution time 1 ms to return to executing the control program
Since you need to allow at least 1 ms to run your PII logic, define a PII time of at least 3 ms to help prevent PII overlaps. Be aware that the processors watchdog timer continues to run while running a PII program. A PII can detect an event within 100 s; however, you must allow at least 3 ms between successive PII events.
Note
If the interrupt occurs during the execution of an instruction, the processor stops executing the instruction, scans the interrupt file once to completion, then resumes executing the instruction. In effect, execution of a PII is transparent to program execution time unless you program too many too often. Too many PIIs too often can cause the watchdog timer to time out or cause excessively long program scans. Consider the following guidelines when you create your PII: Do not use 2-slot addressing when using PIIs. Do not use 1771-IG or -IGD, 8- and 16-point TTL modules for the PII. Use the 1771-IQ16 input module instead. Since the modules input delay filter is selectable, you can set the delay to 0 or about 200 s. Avoid using a block-transfer module in the processor-resident rack with a PII configured because you could miss an input pulse while a block-transfer of data is in progress. If you need to use block-transfers, however, make sure that a PII input pulse is at least 400 s which causes the block-transfer not to affect the PII.
9-2
Online editing affects the performance of a PII routine. A PII cannot interrupt the processor while it is managing its memory due to the online edits being made. The PII input must be on for an amount of time slightly greater than the actual time required to complete the online edits. If not, the PII does not execute. Clear S:51 in one of two ways:
using a CLR instruction (see the example on page 9-5) placing a MOV (move) instruction on the last rung in the PII file. Move a 0 into S:51 to reset the PII bits before finishing the PII file. If S:51 is not cleared, a PII overlap bit is set on that status page, causing a minor fault.
Note
9-3
9-4
C5:0.CU U CTU COUNTER UP Counter Preset Accum C5:0 DN Output C5:0 RES CLR CLEAR Destination S:51 C5:0 100 0 DN CU
Output
The output image bit remains set until the next count.
9-5
Setting Up a PII
To set up a PII, you need to: Store the configuration information of the PII program in the processor status file Create the ladder file and enter the ladder logic
Use the processor configuration screens to enter this information. PII configuration changes are not put into effect until the processor goes from Program to Run or Test mode. Also, if the input word number specified (S:47) is not in the local rack or if there is not an input module in the slot addressed, a minor fault bit (S:10/11) is set at mode transition. For more information on using the processor configuration screens to enter this information, see the processor configuration chapter in the PLC5 A.I. Series Software Reference manual.
bit mask
S:48
compare value
S:49
9-6
Status Description: File Word: S:50 Enter a preset value to determine how many instances of a condition will occur before the interrupt. Valid range is 0 32,767. Enter a 0 or 1 if you want the interrupt to occur every time. For example, in the PII Application Example on page 9-4, you would enter 100 in S:50.
For more information on setting these values on the Processor Configuration screen, see the processor configuration chapter in the PLC5 A.I. Series Software Reference manual.
9-7
Monitoring a PII
When the PII is generated, the processor updates the PII Return Mask and the PII Accumulator in the status file. Use the processor status screen to monitor PIIs. For information on using the processor status screen, refer to the PLC-5 A.I. Series Software Reference manual. The PII related status addresses are described below.
PII Accumulator
The PII Accumulator (S:52) displays the number of conditions that occurred before the interrupt. This value should match the value in the counter field of your configuration information. If these values do not match: The interrupts are not executing when they are supposed to You are trying to count too many events The events are happening too quickly to count
9-8
10
10-1
For example, the following rung includes an instruction which causes a major fault:
A B Causes a major fault C
] [
In the example above, the processor runs the fault routine after detecting the fault. If the fault routine resets the faulted bits, the processor returns to the next instruction in the program file following the one that faulted (instruction B) and continues executing the remainder of the rung. If you do not program a fault routine for fault B, the processor immediately faults. The bits in word 11 of the processor status file indicate the type of major fault. The following table describes the fault associated with each bit.
10-2
This bit in S:11: Indicates this type of major fault: 00 01 02 03 04 05 corrupted program file (see fault codes 1019 in the table on page 10-4) corrupted address in ladder program (see fault codes 2029 in the table on page 10-4) programming error (see fault codes 3049 in the table on page 10-4) processor detected an SFC fault (see fault codes 7179 in the table on page 10-4) processor detected an error when assembling a ladder program file (see fault code 70 in the table on page 10-4); duplicate LBLs found startup protection fault . The processor sets this major fault bit when powering up in Run mode if the user control bit S:26/1 is set. If your fault routine does not reset this bit, the processor inhibits startup. peripheral device fault usergenerated fault; processor jumped to fault routine (see fault codes 09 in the table on page 10-4) watchdog faulted system is configured wrong (see fault codes 80-88 in the table on page 10-4) recoverable hardware error MCP does not exist or is not a ladder or SFC file PII file does not exist or is not a ladder or SFC file STI file does not contain ladder logic or does not exist fault routine does not contain ladder logic or does not exist faulted program file does not contain ladder logic
06 07 08 09 10 11 * 12 * 13 14 15
10-3
This fault code: Indicates this fault: 00 09 10* 11* 12 13 14 15 16 17 18 19* 20 21 22 23 24 30 31 32 33 34 35 36 37 38 39* 40 reserved for userdefined fault codes runtime data table check failed bad user program checksum bad integer operand type, restore new processor memory file bad mixed mode operation type, restore new processor memory file not enough operands for instruction, restore new processor memory file too many operands for instructions, restore new processor memory file corrupted instruction, probably due to restoring an incompatible processor memory file cant find expression end; restore new processor memory file Missing end of edit zone; restore new processor memory file download aborted you entered too large an element number in an indirect address you entered a negative element number in an indirect address you tried to access a non-existent program file you used a negative file number, you used a file number greater than the number of existing files, or you tried to indirectly address files 0, 1, or 2 you tried to indirectly address a file of the wrong type you tried to jump to one too many nested subroutine files you did not enter enough subroutine parameters you jumped to an invalid (nonladder) file you entered a CAR routine file that is not 68000 code you entered a negative preset or accumulated value in a timer instruction you entered a negative time variable in a PID instruction you entered an outofrange setpoint in a PID instruction you addresses an invalid module in a block transfer, immediate input, or immediate output instruction you entered a return instruction from a nonsubroutine file FOR instruction with missing NXT the control file is too small for the PID, BTR, BTW, or MSG instruction
Recoverable the fault routine can instruct the processor to clear the fault and then resume scanning the program. A fault routine executes when any of these faults occur.
Non-recoverable the fault routine will be executed but cannot clear major fault bit 2.
Recoverable
Non-recoverable Recoverable
10-4
This fault code: Indicates this fault: 41* 42 43* 44 NXT instruction with missing FOR you tried to jump to a non-existent label file is not an SFC error using SFR. This error occurs if: you tried to reset into a simultaneous path you specified a step reference numer that is not found or is not tied to a step (it is a transition) the previous SFR to a different step is not complete 45 46 69 70 71 72 73 74 75 76 77 78 79 80 invalid channel number entered reserved the processor detected duplicate labels the processor tried to start an SFC subchart that is already running the processor tried to stop an SFC subchart that isn't running the processor tried to start more than the allowed number of subcharts SFC file error detected the SFC has too many active functions SFC step loops back to itself the SFC references a step, transition, subchart, or SC file that is missing, empty, or too small the processor cannot continue to run the SFC after power loss you tried to download an SFC to a processor that cannot run SFCs you incorrectly installed a 32point I/O module in a 1slot configuration (Original PLC-5 processors) you have an I/O configuration error (New Platform PLC-5 processors) you illegally set an I/O chassis backplane switch by setting both switch 4 and 5 ON illegal cartridge type for selected operation. This error also occurs if the processor doesn't have a memory module, but the backplane switches are set for a memory module. Make sure the backplane switches are correct (set switch 6 ON and switch 7 OFF if the processor doesn't have a memory module). user watchdog fault error in userconfigured adapter mode block transfer memory module bad memory module is incompatible with host
Non-recoverable the fault routine will be executed but cannot clear major fault bit 2.
Recoverable the fault routine can instruct the processor to clear the fault and then resume scanning the program. A fault routine executes when any of these faults occur.
81 82*
Non-recoverable the fault routine will be executed but cannot clear major fault bit 2.
10-5
This fault code: Indicates this fault: 87* 88 scanner rack list overlap Scanner channels are overloading the remote I/O buffer; too much data for the processor to process. If you encounter fault code 88, review the guidelines for assigning racks in the Allen-Bradley documentation that came with your processor. Specifically, make sure you: group together 1/4-racks and 1/2-racks of each logical rack. Do not intersperse these with other rack numbers. if using complementary I/O addressing, treat complementary rack addresses individually when grouping racks; primary rack numbers are separate from complement rack numbers. 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 200 201 Sidecar module extensive memory test failed. Call your Allen-Bradley representative for service sidecar module undefined message type sidecar module requesting undefined pool sidecar module illegal maximum pool size sidecar module illegal ASCII message sidecar module reported fault, which may be the result of a bad sidecar program or of a hardware failure sidecar module not physically connected to the PLC-5 processor sidecar module requsted a pool size that is too small for PC command (occurs at power-up) sidecar module first/last 16 bytes RAM test failed sidecar module-to-processor data transfer faulted processor-to-sidecar module transfer failed sidecar module end of scan transfer failed the file number specified for raw data transfer through the sidecar module is an illegal value the element number specified for raw data transfer through the sidecar module is an illegal value the size of the transfer requested through the sidecar module is an illegal size the offset into the raw transfer segment of the sidecar module is an illegal value sidecar module transfer protection violation; for PLC-5/26, -5/46, and 5/86 processors only ControlNet output transfer missed ControlNet input data missed
3
Non-recoverable the fault routine will be executed but cannot clear major fault bit 2.
Recoverable the fault routine can instruct the processor to clear the fault and then resume scanning the program. A fault routine executes when any of these faults occur.
Recoverable
10-6
This fault code: Indicates this fault: 202 203 204 205 ControlNet diagnostic data missed ControlNet schedule transmit data overflow ControlNet configuration too complex for the PLC-5 processor ControlNet configuration exceeded PLC-5 bandwidth
* This fault applies only to New Platform PLC-5 processors. Note If the PLC5 processor detects a fault in the fault routine (double fault condition), the PLC5 goes directly to fault mode without completing the fault routine.
10-7
Upon detecting a major fault, the processor immediately suspends the program file it was running and, if programmed, runs the fault routine file once to completion. If the processor does not run a fault routine, or the fault routine does not clear the fault, the processor automatically switches to fault mode.
Set an Alarm
You may need an alarm to signal when a major fault occurs. Put this rung first in your fault routine program and combine it with a counter.
alarm output
You can also set an alarm in your fault routine to signal when the fault routine clears a major fault.
10-8
From the fault routine, examine the major fault code that the processor stores in S:12. Use an FSC instruction to compare the fault code to the reference file that contains acceptable fault codes (wordtofile comparison). If the processor finds a match, the FSC instruction sets the found (.FD) bit in the specified control structure. Use a CLR instruction to clear the fault in S:11. Then jump to the end of the fault routine to quickly complete running the fault routine. In the drawing below, #N10:0 is the reference file.
R6:0 RES FSC FILE SEARCH/COMPARE Control Length Position Mode Expression S:12 = #N10:0 R6:0 CLR CLEAR Dest S:11 0 10 JMP R6:0 20 0 ALL ER DN EN
] [
FD
10 ] LBL [
TND
END
10-9
The processor completes the scan of the fault routine. If the routine clears S:11, the processor returns to the program file and resumes program execution. If the fault routine does not clear S:11, the processor executes the rest of the fault routine and goes into FAULTED mode. Note If the fault routine clears the major fault, the processor completes the fault routine and returns to the next instruction in the program file after the one that contained the faulted instruction. The remainder of the rung with the faulted instruction is executed as if the rung were false. It appears that the fault never occurred. The cycle of recurring fault routine execution continues until you correct the major fault.
10-10
10-11
Be sure not to corrupt the program-file number of the fault routine, nor use the same file for any other purpose. If the file number you specify results in a nonexistent 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 does not correct the cause of the fault. The PLC5 processor might continue to repeat the fault cycle until you correct the cause(s) for the major fault.
10-12
Set word 26, bit 1 manually from the Processor Status screen (see the PLC5 A.I. Series Software Reference manual), 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 program the fault routine to determine whether the processors status will let the processor respond correctly to ladder logic and whether to allow or inhibit the startup of the processor.
Then: the processor faults at the end of scanning the fault routine; leave this bit set to inhibit startup. the processor resumes scanning the processor memory file; reset this bit to allow startup
Note
You can use JMP and LBL instructions to scan only the portion of the fault routine associated with a particular fault or powerup condition.
10-13
11
11-1
11-2
in a 8 or 16slot chassis for an Original PLC-5 processor in a 4, 8, 12 or 16slot chassis for a New Platform PLC-5 processor
Your PLC5 processor transfers I/O data and status data using discrete transfers and block transfers An Original PLC-5 processor scans ladder logic, monitors and controls its own local I/O A New Platform PLC-5 processor scans ladder logic, monitors and controls its local I/O and remote I/O simultaneously (due to the different channel configurations) Your PLC5 processor provides concurrent communication over Data Highway Plus
If the supervisory processor is a PLC3 processor, the 1775S4A or 1775S4B scanner must be series B, revision A or later.
3.
11-3
The actual size of the chassis has no bearing on the simulated size of the chassis. Note 4. In adapter mode, the processor reserves rack 3 I/O image tables (I:30-37 and O:30-37) for I/O communication with the supervisory processor.
If you use 1/2slot addressing with a 16slot I/O rack, you need to use rack 3 I/O image tables of the adapter mode processor for backplane communication with local I/O. In this case, create an adapter image file. (See page 11-9 in this chapter)
11-4
The processor performs the transfer of discrete I/O and block data in the same way. The processor scans the processor memory file to read inputs and control outputs. The processor scans local I/O and block data during the I/O scan and the I/O update is synchronous to the program scan. The drawing below shows how the processor transfers discrete I/O in adapter mode.
Other Racks x y
Housekeeping
Supervisor Scanner Remote I/O Buffer Local I/O Remote I/O Scan Local Rack read inputs write outputs read inputs
1-3 ms typical
write outputs
Program Scan
x y I/O Scan
End
11-5
The adapter processor and the supervisory processor automatically transfer discrete data between themselves via the supervisory processors remote I/O scan. During each remote I/O scan: if the supervisory processor is an Original PLC-5, it transfers either 4 or 8 words (depending on whether the adapter processor is configured as half rack or full rack) of its output image table to the corresponding input image file of the adapter processor. If you are using a New Platform processor, it transfers 2, 4, 6 or 8 words depending on whether the adapter processor is configured as a 1/4, 1/2, 3/4 or full rack) if the adapter processor is an Original PLC-5, it transfers 4 or 8 words of its output image file to the corresponding input image table of the supervisory processor. If you are using a New Platform processor, it transfers 2, 4, 6 or 8 words depending on whether the adapter processor is configured as a 1/4, 1/2, 3/4 or full rack.
The following drawing shows the transfers between the supervisory output image table and the adapter input image file, and between the adapter output image file and the supervisory input image table.
11-6
Supervisory Processor Word 17 14 13 10 07 04 03 *0 1 2 Supervisory Processor PLC-2 0X0-0X7 3 Output Image PLC-3 OXX0-OXX7 4 Table PLC-5 O:X0-O:X7 5 6 7 Supervisory Processor Word 17 14 13 10 07 04 03 *0 1 2 Supervisory Processor PLC-2 1X0-1X7 3 PLC-3 IXX0-IXX7 Input Image 4 PLC-5 I:X0-I:X7 Table 5 6 7 00 00
* Word 0 in an Original PLC-5 processor is reserved for block transfer and status; if you are using a New Platform PLC-5 processor, bits 00-07 are available for user data
Note
If data from the supervisory processor is intended to control outputs of the adapter processor, the ladder logic in the adapter processor must move the data from the adapter processors input image table (I/O rack 3 or the adapter image file) to its output image table (local I/O) with XIC and OTE instructions for bit data or MOV and COP instructions for word data. If you want the supervisory processor to read data from a data file in the adapter processor, ladder logic in the adapter processor must move that data to the adapter processors output image table (I/O rack 3 or the adapter image file) for transfer to the supervisory processor.
11-7
Using Rack 3
Rack 3 is the default discrete transfer file for Original PLC-5 processors. If you are using a New Platform processor, you can use any file for discrete transfer, including rack 3. 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-77 octal) of the adapter processor. (The rack number range is determined by the processor type of the supervisory processor which can be a PLC-3, PLC-5 or PLC-5/250 processor.) Condition the ladder logic with bit 10 octal (if using rack 3 I/O image). When set, this bit indicates a communication failure between the adapter and supervisory processors. The ladder logic in the adapter processor uses I:031-037 for input data and O:031037 for output data, unless you specify a special adapter image file. To specify rack 3 for New Platform PLC-5 processors, use input I:024 and output 0:024 decimal; the processor interprets these as I:030 and O:030 in octal.
11-8
To create the adapter image file, create a 16word integer file. This file must be 16 words regardless of whether you use 4word or 8word 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 section on using status data in the Troubleshooting and Diagnostics chapter of the PLC5 A.I. Series Software Reference manual. Condition the ladder logic with bit 8, word 0 of the adapter image file. When set, this bit indicates a communication failure between the adapter and supervisory processors.
Do not program block transfers to a supervisory processor if you created an adapter image file. For more information about block transfers, see page 11-14 in this chapter.
11-9
Sample Entry input source output source input source output source 010:050 011:050 012:016 012:000
Starting Address adapter inputs start at N10:50 adapter outputs start at N11:50 adapter inputs start at N12:16 adapter outputs start at N12:0 and end at N12:15
The processor determines the number of words used by the file(s) according to the size of the chassis:
Chassis Size: 1/4 1/2 Word Length: 2 4 Chassis Size: 3/4 full Word Length: 6 8
For more information on configuring a channel for adapter mode, see the PLC5 A.I. Series Software Reference manual.
11-10
When the supervisory processor sets its output image bit 0X7/17, input image bit I:037/17 in the adapter processor is automatically set. In the same way, when the adapter processor sets output image bit O:035/16, input image bit 1X5/16 in the supervisory processor is automatically set. The drawing below shows ladder logic if you created an adapter image file because you need rack 3 for local I/O. This example uses N51 as the adapter image file.
Transferring Bits Using Your Own Adapter Image File
Supervisory Processor (PLC-2) 0X7 17 1X5 16 Adapter Processor (PLC-5) N51:15 15 N51:05 14
For Original PLC-5 processors, words 0-7 in the integer file represent output, words 815 represent input. For New Platform PLC-5 processors, input source and output source entries determine input and output words.
The supervisory processor receives status bits (see the table below) from the adapter mode processor in word 0 of the input image table for the rack that the adapter processor is emulating:
This status bit of the adapter being set: Octal 10 15 Decimal 8 13 data not valid Adapter processor is in Program or Test mode Indicates this Condition:
The supervisory processor should monitor the rack fault bits for the rack the adapter processor is emulating to determine the status of the remote I/O link.
11-11
The PLC5 processor in adapter mode sets status bits (see the table below) in I:030 (or word 0 of the adapter image file) of the adapter processors data table. These bits tell the adapter mode processor the status of the supervisory processor and the integrity of the remote I/O communication link.
Status Bits of the Supervisory Processor Set in the Adapter Processors Data Table This bit being set: Rack 3 Input Adapter Input Image Table Image File (octal) (decimal) 10 11 8 9 the adapter processor detects a communication failure or receives a reset command from the supervisory processor the adapter processor receives a reset command from the supervisory processor (processor in Program or Test mode) the adapter processor is powering up; this bit is reset with the first communication from the supervisory processor the adapter processor detects a communication failure (for example, no communication activity on the remote I/O communication link within the last 100 msec.) Indicates this Condition:
13 15
11 13
11-12
The adapter processor can monitor the status of the supervisory processor by examining the status bits in the first word of the data being transferred from the supervisory processor (see page 11-12). The supervisory processor can monitor the status of the adapter processor by examining the status bits in the first word of the data being transferred from the adapter processor (see page 11-11). The supervisory processor can also monitor the rack fault bits for the rack the adapter is emulating to determine the integrity of the remote I/O communications between the supervisor and the adapter processors. For more information on rack fault bits, see the PLC5 A.I. Series Software Reference manual.
11-13
11-14
Example: Adapter/Supervisor Block Transfer Programming for an Adapter Processor in Rack XX and a PLC-3 Supervisory Processor
Supervisory Processor (PLC-3) Adapter-mode Processor 1771 I/O Chassis Remote I/O Link Set for Rack XX
BTR BLOCK TRANSFER READ 0XX Rack 0 Group 0=LOW Module FB001:0000 Control Data File FB002:0000 Length 0
BTW BLOCK TRANSFER WRITE 3 Rack 0 Group 0 Module N7:15 Control Block Data File N7:200 BT Length 8 Continuous Y
BTW BLOCK TRANSFER WRITE 0XX Rack 0 Group 0=LOW Module FB001:0000 Control Data File FB003:0000 Length 0
BTR BLOCK TRANSFER READ 3 Rack 0 Group 0 Module N7:10 Control Block Data File N7:100 BT Length 40 Continuous Y
11-15
BTR/BTW Parameter: BTR/BTW in Supervisor: Rack PLC2/30: PLC3: PLC5/25: must be 0 must be 0 1-7 octal 0-77 octal 0-7 octal
!
Note
To guarantee the correct destination of block transfer data, program only one set of bi-directional block transfers between the supervisory and adapter processors.
If you are using an Original PLC-5 processor, set the supervisory processors communication rate for remote I/O to 57.6K baud. If you have a New Platform processor, you may be able to use 115K or 230K baud depending on what the other device supports. Remember that block transfers between adapter and supervisory processors transfer data between data table addresses. If you want to transfer local I/O data of the adapter mode processor to a supervisory processor or if you want to transfer data from the supervisory processor to local I/O of the adapter mode processor, you must use block transfer instructions within the adapter processor to move the data in or out of the data file used in the adapter block transfer instruction. The following drawing shows data transfers from a supervisory processor to an adapter processor and to a local block transfer module, and vice versa.
11-16
Example: Block Transfer from Supervisory Processor (PLC-3) to Adapter Processor to Local Block Transfer Module and Vice Versa Supervisory Processor (PLC-3) Adapter-mode Processor in Supervisory Processor's Remote I/O Rack 2 BT Module in Local I/O Rack 0, I/O Group 2 Module 0 * Local BT over chassis backplane Data File N7
BTW BLOCK TRANSFER WRITE Rack 2 Group 0 Module 0=LOW Control FB001:0000 Data File FB002:0000 Length 0 BTR BLOCK TRANSFER READ Rack 3 Group 0 Module 0 Control Block N7:10 Data File N7:100 BT Length 40 Continuous Y
Block Transfers over Remote I/O Link Data File FB002 0000
N7:100
N7:139
BTW BLOCK TRANSFER WRITE Rack 0 Group 2 Module 0 Control Block N7:15 Data File N7:100 BT Length 40 Continuous Y
To BT Module *
//
BTR BLOCK TRANSFER READ Rack 2 Group 0 Module 0=LOW Control FB001:0000 Data File FB003:0000 Length 0 BTW BLOCK TRANSFER WRITE Rack 3 Group 0 Module 0 Control Block N7:20 Data File N7:150 BT Length 8 Continuous Y
//
BTR BLOCK TRANSFER READ Rack 0 Group 2 Module 0 Control Block N7:25 Data File N7:150 BT Length 8 Continuous Y
N7:150
From BT Module *
0007
N7:157
If you transfer block data with a supervisory processor, you cannot use 1/2slot addressing with a 1771-A4B chassis because the adapter processor needs the rack 3 I/O image table for block transfer communication.
Do not try block transfers to a supervisory processor when the adapter processor uses rack 3 for scanning local I/O (when you create your own adapter image file). Using rack 3 addresses under this condition will result in unpredictable machine operation with possible damage to equipment or personnel.
11-17
11-18
Store Bit L
Store Bit U
07 Store Bit
BLOCK TRANSFER READ DATA ADDR 031 MODULE ADDR 200 BLOCK LENGTH 0 240-337 FILE
020
EN
06 120
DN
06
11-19
LE DN ER
Data Valid Bit I:020 10 MVF FILES FROM A TO R #B2:0 SOURCE #B4:0 DESTIN C5 COUNTER ALL MODE 64 LENGTH 0 POSITION
EN DN ER
11-20
EN DN ER
EN DN ER
15
#N7:100 #N7:200 64
11-21
/
EN
/
EN
BR030:0 BW030:0
/
EN
/
EN
BTW BLOCK TRNSFR WRITE RACK 002 GROUP 0 MODULE 0 CONTROL BLOCK BW020:0 1BTD2:0 DATA FILE 0 BT LENGTH CONTINUOUS BT TIMEOUT YES 3
EN DN ER
11-22
EN DN ER
EN DN ER
BTR Error Bit N7:10 12 BTW Error Bit N7:15 12 I:030 I:030 I:030 I:030 10 11 12 15 BTR Error Bit N7:10 12
COP COPY FILE SOURCE DESTIN LENGTH
Status Bits
#N7:100 #N7:200 40
11-23
11-24
12
12-1
Housekeeping
x y
Immediate I/O IOT (x) IIN (y) read inputs write outputs
1-3 ms typical
Adapter
Rack 2
Program Scan
Rack 1
Adapter
Local Rack
End
The processor: Presents all discrete I/O data synchronously to the program scan. Scans discrete I/O data in the local I/O chassis synchronously to the program scan. Scans discrete I/O data in remote I/O chassis asynchronously to the program scan. The remote I/O scan transfers discrete I/O data between remote I/O adapters in I/O chassis and the remote I/O buffer in the processor. Performs housekeeping once per program scan:
Original PLC-5 processor: 3 ms maximum; typically 1.5 ms New Platform PLC-5 processor: 4.5 ms
12-2
Q A
*
BT Requests
Q
Adapter
1-slot addressing
One transfer per remote I/O scan One transfer per remote I/O scan
A Q A
Rack 2 and 3
*
BTRequests BTR or BTW Data
*
BT Requests
Program Scan
Adapter
Q A
BT Requests
12-3
The processor runs all enabled block transfers to local I/O continuously as each block transfer request enters the active buffer. The processor does not wait for the I/O scan to queue the requests.
12-4
If program scans are two or three times longer than remote I/O scans, the processor can run two or three remote block transfers per program scan and interrupt the program scan two or three times.
The program scan stops when an Original PLC-5 processor runs a fault routine or STI with a block transfer instruction to a remote chassis. The delay for a block transfer could be unacceptable for your application. However, for a New Platform PLC-5 processor, the MCP resumes processing while the PII or STI is waiting for the block transfer to complete.
12-5
1, 7 Ladder Program
Request
6 STI
Priority Request Data Data Acknowledgement and Incoming Data Request and Outgoing Data 3a, 3b, 5 Active BT area
Data Files
The following steps describes the numbered sections in the drawing above. 1. 2. Ladder logic enables the block transfer. The processor places the block transfer request in the queue, or in the active buffer if the queue is empty. (If the queue is full, the request is ignored until the next scan.)
12-6
3.
If the block transfer is a: a. BTW: The processor interrupts the program scan momentarily to transfer data from the BTW file to the active buffer. The active buffer transfers the request and outgoing data to the local I/O module or to the remote I/O adapter. BTR: The active buffer sends the block transfer request to the local I/O module or remote I/O adapter. In the same local block transfer update or in the next remote I/O scan, the active buffer receives the block transfer acknowledgment and incoming data. The processor interrupts the program scan momentarily to transfer incoming data to the BTR file one word at a time; therefore, some ladder logic could execute in between word transfers to the BTR file. We recommend that you buffer your BTR data with a fileto file move or a copy instruction using a BTR done bit to condition the rung if you need file integrity of the data.
b.
4.
If the block transfer is to: a. b. Local I/O: The processor continuously runs block transfer requests for all local I/O modules in the order the processor queues the requests. Remote I/O: The processor runs one block transfer request for one block transfer module per rack address per remote I/O scan.
5. 6.
The processor clears the active buffer and the active buffer accepts the next request after the buffer receives a confirmation of a valid read or write. When the processor enables a fault routine or STI, the processor runs any block transfer program in the fault routine or STI ahead of any block transfer requests in the queue, as soon as the active buffer completes any block transfer currently in the active buffer. The program scan is stopped until the STI or fault routine block transfer is complete. The block transfer process runs asynchronously to the program scan, so data can change during a program scan.
7.
12-7
1, 7 Ladder Program
Request
Holding area
6 STI PII
Priority Request 3a, 3b, 5 Active BT area Acknowledgement and Incoming Data
The following steps describes the numbered sections in the drawing above. 1. 2. Ladder logic enables the block transfer. The processor examines the block transfer request. If a request already exists for the slot, the processor places the request in the Holding area.
12-8
3.
If the block transfer is a: a. BTW: The processor interrupts the program scan momentarily to transfer data from the BTW file to the active buffer. The active buffer transfers the request and outgoing data to the local I/O module or to the remote I/O adapter. BTR: The active buffer sends the block transfer request to the local I/O module or remote I/O adapter. In the same local block transfer update or in the next remote I/O scan, the active buffer receives the block transfer acknowledgement and incoming data. The processor interrupts the program scan momentarily to transfer incoming data to the BTR file one word at a time; therefore, some ladder logic could execute in between word transfers to the BTR file. We recommend that you buffer your BTR data with a fileto file move or a copy instruction using a BTR done bit to condition the rung if you need file integrity of your data.
b.
4.
If the block transfer is to: a. b. Local I/O: The processor continuously runs block transfer requests for all local I/O modules in the order the processor queues the requests. Remote I/O: The processor runs one block transfer request for one block transfer module per rack address per remote I/O scan.
5.
The processor clears the active buffer and the active buffer accepts the next request from the Holding area after the buffer receives a confirmation of a valid read or write. When the processor enables a fault routine, STI or PII, the processor runs any block transfer program in the fault routine, STI or PII ahead of any block transfer requests in the holding area, as soon as the active buffer completes any block transfer currently in the active buffer. The program scan is stopped until the STI or fault routine block transfer is complete. The block transfer process runs asynchronously to the program scan, so data can change during a program scan.
6.
7.
12-9
Ladder logic: Detects that the rung containing a block transfer is enabled Sets the enable bit (.EN, bit 15) Detects the status of the read/write bit (.RW, bit 07) Places the block transfer in the active buffer if the queue is empty; the processor sets the start bit (.ST, bit 14) and begins the transfer Places the block transfer in the queue if the active buffer is not empty; the processor sets the enabled waiting bit (.EW, bit 10)
If the queue is full, block transfer requests may not occur in the order the ladder logic requests the transfers. The processor sets the enabled waiting bit (.EW, bit 10) when the request enters the queue. I/O scanner: Transfers the request to or from the I/O chassis after the request reaches the active buffer Detects whether the module responds; if the module does not respond, the processor sets the no response bit (.NR, bit 09) If there is no response and the timeout bit (.TO, bit 08) is reset, the processor re queues the request until the watchdog timer times out (4 seconds). If there is no response and the .TO bit is set, the scanner retries the request one more time before setting the .ER bit. If the request is a:
BTW: transfers the data to the module BTR: moves data from the module to the BTR data file one word at a time
Sets the done bit (.DN, bit 13) upon completion of a valid transfer; sets the error bit (.ER, bit 12) if there were errors Checks the status of the continuous bit (.CO, bit 11); if set and no error occurred, the scanner requeues the block transfer Notifies the active buffer to accept the next request
For a list of block transfer error codes, see the Allen-Bradley documentation that came with your processor.
12-10
where: Q represents the number of queued block transfer requests to the same I/O chassis with the continuous bit set W represents the number of words to transfer
Transfer Time
The transfer time in milliseconds between the active buffer and the module starts when the processor sets the start bit and ends when the processor sets the done bit. The transfer time depends on these formulas:
Write 0.9 + 0.1W 13 + 30C + 0.3W 13 + 21.3C + 0.3W Read 0.9 + 0.1W 9 + 30C + 0.3W 9 + 21.3C + 0.3W
local
where: C represents the number of remote I/O chassis W represents the number of words to transfer
12-11
Transfer Time
The transfer time in milliseconds between the active buffer and the module starts when the instruction sets the start bit and ends when the instruction sets the done bit. The transfer time depends on this formula (and is the same for a read or a write):
local remote (57.6K baud) remote (115K baud) 0.9 + 0.1W 4 + 8C + 0.3W 4 + 4.6C + 0.15W
where: C represents the number of remote I/O chassis W represents the number of words to transfer
12-12
12-13
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. Injuries to personnel and damage to machinery may result.
12-14
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 injuries to personnel and damage to machinery may result. Make sure you have recovery methods in place.
12-15
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 status file words 7 and 27 for Original processors and words 7, 32 and 34 for New Platform processors. For more information on global status bits, see the PLC5 A.I. Series Software Reference manual. Using the I/O Status File The I/O status file is used to monitor the racks in your I/O system. This file contains 2 words of status bits for every rack configured in your system. The data file number 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 (Original PLC-5) or the Processor Configuration screen (New Platform).
12-16
For more information on the I/O status file, see the PLC5 A.I. Series Software Reference manual.
Usergenerated Major Fault Using this method, you jump to a fault routine when a remote I/O rack fault occurs. In other words, if the status bits indicate a fault, you program the processor to act as if a major fault occurred (that is, 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 endoffile instruction for the fault routine, a usergenerated major fault is declared. For more information on fault routine programming, see Chapter 10- Writing a Fault Routine. Reset Input Image Table With this method, 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 nonfaulted 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. This method requires an extensive and careful review of your system for recovery operations. For more information on inhibiting I/O racks, see the PLC5 A.I. Series Software Reference manual.
12-17
Fault Zone Programming Using fault zone programming, you disable sections of your program with MCR (Master Control Reset) 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 nonretentive to be deenergized when a rack fault is cleared. For more information on the MCR instruction and MCR zones, see the Instruction Set Reference.
12-18
13
User Mode
For more information on these communication options, see the Data Highway/Data Highway Plus Protocol and Command Set (AllenBradley Publication 17706.5.16).
13-1
System Mode
In system mode, the processor interprets a command from the other device. Use system mode when you need to communicate with other devices on a Data Highway link. In system mode, you can send data to a device using the message instruction or as an ASCII string using the ASCII write instructions. (For more information on these instructions, see the PLC5 A.I. Series Instruction Set Reference manual.) Using system mode, you can use either of the following protocols: Pointtopoint (or DF1) DF1 slave
PointToPoint
Pointtopoint is a basic serial protocol used when you need: Singledevice to singledevice connection Twoway simultaneous transmission needed
DF1 Slave
The processor can function as a slave in a master/slave serial communication network. Master/Slave communications use a multidrop link with all nodes interfaced through modems. There may be from 2 to 256 nodes simultaneously connected to a single link. One node is designated as the master, and it controls who has access to the link. (For example, a master can be a PLC5/250, 1771KE/KF or 1771KGM). All other nodes are slaves and must wait for permission from the master before transmitting. The master can send and receive messages from all nodes on the link and to nodes on other Data Highway links connected to the multidrop, but a slave can only respond to the master.
13-2
User Mode
In User mode, all received data is put into a buffer. In order to access this data, you use ASCII instructions in your ladder program. Likewise, using ASCII instructions in your ladder program, you can then send ASCII string data to a processor or other device. Note In User Mode, only ASCII instructions can be used; if you try to use a message instruction that references the serial port, the error (.ER) bit is set.
13-3
Changing Modes
You can configure channel 0 of the processor to change communication modes in two ways: Directly - through the Channel Configuration screen Remotely - by defining communication mode change characters that another device can send. You define the ASCII control characters to get the processors attention and then switch modes.
For more information on switching modes, see the PLC5 A.I. Series Software Reference manual.
13-4
Index
Index
A
Adapter Mode block transfer examples..................... 11-18 block transfers................................... 11-14 configuring ......................................... 11-3 operating............................................. 11-3 transfer data........................................ 11-5 transfer status.................................... 11-12 Addressing frequently used files ............................ 7-14 I/O image.............................................. 7-6 indexed ............................................... 7-10 indirect ................................................. 7-8 logical................................................... 7-2 mnemonics ........................................... 7-4 symbolic ............................................. 7-12 Alarm fault routine ........................................ 10-8 Application Program Development Model ... 2-1 STI ..................................................... 12-5 timing for New Platform ................... 12-12 timing for Original............................ 12-11 Branches...................................................... 5-7 execution time....................................... 5-8 nested ................................................... 5-7
C
Clearing a Major Fault.................... 10-8, 10-12 Compare Fault Code to Reference .............. 10-8 Constructing Rungs ..................................... 5-5 Converting Machine Statements to Ladder Logic .................................................... 5-2, 5-6
D
Data Block................................................... 6-3 organizing ............................................ 6-4 user-defined .......................................... 6-3 Data File organizing ............................................ 6-4 types of ................................................. 7-2 Data Storage bit ......................................................... 6-3 concepts................................................ 6-1 data block ............................................. 6-3 element ................................................. 6-2 file ........................................................ 6-2 sub_element.......................................... 6-3 type....................................................... 6-2 user-defined .......................................... 6-3
B
Bit (data file) ............................................... 6-3 Block Transfer........................................... 11-5 addressing......................................... 11-15 examples........................................... 11-18 fault routine ........................................ 12-5 local I/O.............................................. 12-4 programming .................................... 11-14 queued requests................................... 12-4 remote I/O .......................................... 12-4 scanner mode...................................... 12-3 sequence (New Platform) .................... 12-8 sequence (Original)............................. 12-6
Index-i
Design Specification checking for completeness................... 3-13 detailed analysis............................. 2-2, 3-5 example ................................................ 3-2 functional.............................................. 2-2 program development model ................. 2-1 writing functional specification ............. 3-3 DF1 Slave .................................................. 13-2 Digital I/O example instructions ............................. 5-3 Discrete I/O transfer data ............................... 11-5, 11-8 Drawing An SFC ......................................... 4-6
remote I/O rack recovery ................... 12-16 File Boundary ............................................ 7-10 Files data storage........................................... 6-2 frequently used.................................... 7-14 Functional Specification............................... 2-2 writing .................................................. 3-3
G
Gapping....................................................... 6-4 Global Status Bits .................................... 12-16 GOTO definition ............................................ 4-11 rules.................................................... 4-11 GOTOs and Labels ...................................... 4-5
E
Element (data file) ....................................... 6-2 Event_Driven Interrupts........................ See PII Execution Time............................................ 5-8
I
I/O discrete I/O data transfer ............ 11-5, 11-8 image address ....................................... 7-6 status file........................................... 12-16 Indexed Address ........................................ 7-10 Indirect Address........................................... 7-8 Instructions arranging ..................................... 5-5, 5-10 examples............................................... 5-3
F
Fault Routine ............................................... 2-8 alarm .................................................. 10-8 block transfer ...................................... 12-5 changing specified file ...................... 10-11 clearing a fault .................................... 10-8 compare fault code .............................. 10-8 power_up protection.......................... 10-13 programming ...................................... 10-8 setting up .......................................... 10-11 shut down logic................................. 10-10 startup............................................... 10-13 testing ............................................... 10-10 Faults local I/O rack .................................... 12-14 major (types of) ................................... 10-3 major fault codes................................. 10-3 remote I/O rack ................................. 12-15
L
Labels definition ............................................ 4-11 rules.................................................... 4-11 Ladder Logic branch................................................... 5-7 PII......................................................... 9-2 shut down ......................................... 10-10
Index-ii
Index
writing .................................................. 5-5 Local I/O Rack faulting ............................................. 12-14 Logic branch................................................... 5-7 writing .................................................. 5-5 Logical Address........................................... 7-2 mnemonic............................................. 7-4
ladder logic........................................... 9-2 monitoring ............................................ 9-8 program flow ...................................... 3-11 setting up .............................................. 9-6 Placing Instructions ................................... 5-10 Point-to-Point ............................................ 13-2 Power_Up Protection fault routine ...................................... 10-13 Power_Up Routine program flow ...................................... 3-11 Processor Input Interrupt ...................... See PII Processor Status File STI settings........................................... 8-3 Processor Type............................................. 1-1 Program Flow application examples........................... 3-12 considering program features .............. 3-11 Programming Features............................... 3-11
M
Machine Statements converting to logic ......................... 5-2, 5-6 Main Control Program.......................... 2-2, 2-4 configuring ........................................... 2-6 disabling ............................................... 2-6 execution .............................................. 2-4 monitoring ............................................ 2-7 using interrupt programs....................... 2-8 Major Faults clearing............................................. 10-12 codes................................................... 10-3 detecting ........................................... 12-13 responses ............................................ 10-2 Memory Gapping......................................... 6-4 Mnemonic Addressing................................. 7-4 Multiple Main Programs See Main Control Program
R
Remote I/O Rack faulting ............................................. 12-15 recovering from fault ........................ 12-16 Rung creating................................................. 5-5 definition .............................................. 5-2 writing .................................................. 5-5
O
Organizing Data .......................................... 6-4
S
Scanner Mode block transfer ...................................... 12-3 configuring .......... 12-1, 12-2, 12-11, 12-12 operating............................................. 12-1 transferring data ................................. 12-2 Selectable Timed Interrupt................... See STI
P
PII ...................................................... 2-8, 3-11 application examples............................. 9-4 bit transition mode ......................... 9-4, 9-6 counter mode ........................................ 9-4
Index-iii
Selection Branch................................... 4-3, 4-9 Serial Port changing modes .................................. 13-4 DF1 slave communications.................. 13-1 point_to_point communications .......... 13-1 System mode....................................... 13-1 User mode........................................... 13-1 SFC building blocks...................................... 4-1 drawing................................................. 4-6 GOTOs and labels........................ 4-5, 4-11 path....................................................... 4-2 scan sequences .................................... 4-11 selection branch ............................. 4-3, 4-9 SFR instruction ................................... 4-12 simultaneous branch..................... 4-4, 4-10 special structures................................... 4-6 step ....................................................... 4-1 step actions ........................................... 4-2 transition............................................... 4-2 SFR Instruction.......................................... 4-12 Shut Down Logic ..................................... 10-10 Simultaneous Branch ................................... 4-4 post scan mode.................................... 4-10 SoftLogix 5 ................................................ 7-13 Specification, design example ...................... 3-2 Startup Fault Routine ............................... 10-13 Status File....................................... 7-15, 12-16 Step (SFC) ................................................... 4-1
Step Actions................................................. 4-2 STI ..................................................... 2-8, 3-11 block transfer ...................................... 12-5 program flow ...................................... 3-11 setting up .............................................. 8-3 setup in processor status file .................. 8-3 Structure Names ........................................ 7-13 Sub_Element................................................ 6-3 Symbol....................................................... 7-12 System Mode ............................................. 13-2
T
Time_Driven Interrupts ....................... See STI Timing block transfer for New Platform ........ 12-12 block transfer for Original................. 12-11 Transition (SFC).......................................... 4-2 Types (data storage) ..................................... 6-2
U
User Mode ................................................. 13-3
W
Writing branch logic .......................................... 5-7 rung logic.............................................. 5-5
Index-iv