The text of a manual · part 17 of 59
Mini-PLC-2/02, 2/16, 2/17 Processor (cat. no. 1772-LZ, LZP, LX, LXP, LW, LWP) User Manual: 9 - Relay-Like Instructions
Pages 127 to 137 of 490, from Mini-PLC-2/02, 2/16, 2/17 Processor (cat. no. 1772-LZ, LZP, LX, LXP, LW, LWP) User Manual
The original document is the PDF (2.4 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the Allen-Bradley 1772-LW /LWD, Allen-Bradley 1772-LWP, Allen-Bradley 1772-LX / LXP and Allen-Bradley 1772-LZP
Page 127
Chapter
9
Relay-Like Instructions
Chapter Objectives
This chapter describes the relay-like instructions. This chapter shows how to: define the conditions needed before the action takes place enter, edit or remove relay-like instructions
Programming Logic
A program is a list of instructions that the processor executes. These instructions can examine or change the status of bits in the data table of the processor. The status of these bits can determine the operation of other instructions. The program you specifies the order of things you want done in your application and the conditions that must be met before those things are done. For example, if you want a solenoid energized when a limit switch is closed, you specify: Condition: Action:
if limit switch is closed energize solenoid
Programming logic differs from relay logic in an important way. Programming logic is only concerned with whether or not conditions have been met. These conditions may be open or closed input or output devices. We must have a continuous or unbroken path or true logic conditions for an action to be taken. The number of conditions is not important. There can be none, one, or many conditions preceding an output action. Perhaps an example might make this clearer: True
True
True
C1
C2
C3
A
True False
9-1
Page 128
Chapter 9 Relay-Like Instructions
Here, a series of conditions (C2, C2, C3) must be true before action A is performed. C1 = Input switch 1. When the switch is on, this condition is true. This switch turns on a conveyer belt. C2 = Input sensor 1. When the sensor is off, this condition is true. This sensor detects if the temperature in the factory is below 40oC. C3 = Input sensor 2. When the sensor is on, this condition is true. This sensor detects the presence of a part of the conveyer belt. A = The part will be drilled. The path of conditions is continuous, that is, all conditions are true. When C1, C2, and C3 are true, then a continuous path is made to a particular action. In this case, the continuous path causes the part to be drilled. When the path of conditions is continuous, we say that the rung is true. When the path of conditions is not continuous, we say the rung is false. True
False
True
C1
C2
C3
A
True False
Here the path of conditions is not continuous because condition 2 is false. Therefore, the action A is not performed. We say the rung is false. Set vs. Reset As a review, if the device goes on, then we say the corresponding bit in data table is set to a 1. If the device goes off, we say the corresponding bit in data table is reset to a 0. (From this point on, set means the on-condition or 1. Reset means the off-condition or 0.)
9-2
If the device is:
Then a bit in memory is on set off reset
Page 129
Chapter 9 Relay-Like Instructions
Addresses The processor scans the status of inputs and controls output devices. It does not go to the input or output terminals to see if outputs are on or off. Rather, it checks the status of the input and output devices by scanning corresponding bits in the input and output image area of the data table. The processor uses addresses to refer to words and bits in the data table. For addressing purposes, I/O modules in a given I/O rack are organized into “module groups.” Thus, the module group number of an individual I/O module depends only on the I/O slot the module occupies. The first module group in any I/O chassis is always module group 0. Module groups can be easily identified by module group labels on the latches on top of the I/O chassis. Each input and output bit has a five-digit address. If you need a bit address with more than 5 digits, use the EXPAND ADDR key. Press this key and then enter the address. Word addresses, unlike bit address, do not require the EXPAND ADDR key. Instead, use leading zeros when necessary. Any time a digit you are entering is not within the proper limits, the message DIGIT OUT OF RANGE is displayed. The cursor remains in the same position until you enter a valid digit.
Bit Examining
You can use seven programming instructions to write a program. These instructions are divided into three categories: bit examining, bit controlling, and branch instructions. These instructions examine the status of bits in any data table area except processor work areas. When an examine on or examine off instruction is given an address in the I/O image table, the instruction can indirectly examine the status of a corresponding I/O device. If the image table bit is on, the condition is true. The I/O device and the I/O image table bit have the same address.
9-3
Page 130
Chapter 9 Relay-Like Instructions
Examine On and Examine Off
The Examine On (–] [–) and Examine Off (–]/[–) instructions tell the processor to examine a bit at a specified data table location. 012
112 04 Bit Examining Examine On
13
112
012
05 Bit Examining Examine Off
14
This Instruction:
Becomes:
When the Corresponding Bit Is:
EXAMINE ON true set false reset true reset false set
EXAMINE OFF
Keystrokes Enter an Examine On or Examine Off instruction by performing the following steps. 1.
Press either –] [– or –]/[– as required.
2.
Enter <bit address>.
Removing the Examine On or Examine Off Instruction Remove an Examine On or a Examine Off instruction by performing the following steps.
9-4
1.
Position the cursor over the Examine On or Examine Off instruction you want to remove.
2.
Press [Remove] –] [– or –]/[–.
Page 131
Chapter 9 Relay-Like Instructions
Editing a Partially Completed or a Completed Rung Edit an Examine On or Examine Off by performing the following steps. If you are editing a completed rung, proceed to step 1. If you are editing a partially completed rung, enter the next instruction and proceed to step 1.
Bit Controlling
1.
Position the cursor over the Examine On or Examine Off instruction you want to edit.
2.
Press either –] [– or –]/[– any other appropriate instruction key.
3.
Enter <address>.
Output instructions are programmed at the end of the ladder-diagram rungs. Only one output instruction can be programmed on each rung and it is executed only if the instructions preceding it are true. These instructions are used to set memory bits ON or OFF in any area of the data table, excluding processor work areas. They should not be assigned input image table addresses because input image table words are reset by the I/O scan.
Output Energize
The Output Energize instruction tells the processor to set or reset a specified data table bit. 112
012
06
15 Bit Controlling Output Energize
It controls a specific bit based on the rung condition. When the rung condition is: True - Output Energize sets a specified bit. False - Output Energize resets a specified bit. Keystrokes Enter an Output Energize instruction by performing the following steps. 1.
Press –( )–.
2.
Enter <address>.
Removing an Output Energize Instruction The only way to remove an Output Energize instructions is to remove the entire rung. See chapter 24. 9-5
Page 132
Chapter 9 Relay-Like Instructions
Editing in a Completed Rung Edit the Output Energize instruction by performing the following steps. However, you cannot remove an output instruction.
Output Latch/Unlatch
1.
Position the cursor over the Output Energize instruction you want to change.
2.
Press –( )– or any other appropriate output instruction key.
3.
Enter <address>.
The Output Latch –(L)– instruction tells the processor to latch and set a specified data table bit when the rung is true. It is usually paired with an unlatch instruction. 113 04
010 L 00 Bit Controlling Output Latch
The Output Unlatch –(U)– instruction tells the processor to unlatch and reset a specific data table bit. It is usually paired with a latch instruction. 113 05
010 U 00 Bit Controlling Output Unlatch
Important: The conditions for the Output Unlatch instruction must be different from the conditions that precede the Output Latch instruction. These are retentive instructions. Retentive means that when the rung condition goes false, the latched bit remains set and the unlatched bit remains reset until changed by the program. These instructions control a specific bit based on the rung condition. When its rung conditions are: True - Output Latch sets a specified bit. True - Output Unlatch resets a specified bit. False - No action is taken.
9-6
Page 133
Chapter 9 Relay-Like Instructions
Keystrokes Enter an Output Latch or Unlatch instruction by performing the following steps. 1.
Press either –(L)– or –(U)– as required.
2.
Enter <address>.
Important: You can initially condition the latch or unlatch instruction to on or off by positioning the cursor over the Output Latch or Output Unlatch instruction and pressing 1 or 0, respectively. Editing in a Completed Rung Edit an Output Latch or Unlatch instruction by performing the following steps. 1.
Position the cursor over the Output Latch or Unlatch instruction you want to change.
2.
Press either –(L)– or –(U)– or any other output instruction type as required.
3.
Enter <address>.
Important: If power is lost, all latch bits remain in their last state. When power is restored, all outputs connected to latch bits are energized immediately. If power is lost but the processor battery back-up is maintained, all latched bits retain their state before power was lost. When power is off, outputs associated with the latched bits are off. When power is restored, all outputs connected to latched bits are energized immediately (provided the processor comes up in the Run/Program or Run mode).
9-7
Page 134
Chapter 9 Relay-Like Instructions
Branching Instructions
Use branching instructions when you want several parallel sets of conditions to make an output action possible. A program with branching says, “If this set of conditions is true, or if that set of conditions is true, perform the following action.” Branching allows two or more paths to reach the same output destination. False C1
A
True C2
Here two conditions are parallel. As long as one of the conditions (C1 or C2) is true, a continuous path to the action exists. Therefore, the action is performed. True
False
C1
C2
True
True
C3
C4
A
Here are two sets of parallel conditions. If either set of conditions are true, the action is performed. 010
110
010
00 110
10
00
12
This illustration shows a program rung with branching, as it would appear by the 1770-T3 terminal display. You create a branch by using two different branch instructions. These are the Branch Start and Branch End instructions.
9-8
Page 135
Chapter 9 Relay-Like Instructions
Branch Start/End
A Branch Start instruction begins each parallel logic branch of a rung. It allows more than one combination of input conditions to energize an output device. It is programmed before the first instruction of each parallel branch. A Branch End instruction completes a set of parallel branches. Keystrokes Enter a Branch Start or Branch End instruction by pressing either: . . or . . Important: You must begin each rung of parallel conditions with a Branch Start instruction. Removing a Branch Start or Branch End Instruction Remove a Branch Start or Branch End instruction or change an instruction type by performing the following steps. 1.
Position the cursor over either the Branch Start or Branch End instruction.
2.
Press [Remove]
.
or
. .
Inserting a Branch Instruction in a Completed Rung Insert a Branch Start or Branch End instruction or change an instruction type by performing the following steps. 1.
Position the cursor over the instruction immediately preceding the position you want to insert a Branch Start instruction.
2.
Press [Insert]
.
.
Important: Once you press the Branch Start instruction, the statement BRANCH END OMITTED appears in the lower lefthand corner of the screen. It stays there until you enter a Branch End instruction. 3.
Insert the conditioning instructions for this rung.
4.
You must begin each set of parallel conditions or rung with a Branch Start instruction.
5.
Complete the set of parallel conditions by pressing [Insert]
.
.
9-9
Page 136
Chapter 9 Relay-Like Instructions
Important: Once you press the Branch End instruction, the statement BRANCH END OMITTED disappears. While inserting a Branch Start instruction to an existing rung during online programming, the actual output status (on or off) may not be the logically expected state of the rung. This condition exists until you enter the Branch End instruction and complete the rung. To avoid this condition, do the following: 1.
Immediately below the rung to be changed, create a new rung with the same input logic (duplicate the rung), but do not put the output in yet. 110
110
110
010
00
01
02
00
110
110
110
00
01
02 added rung with no output
2.
Move the cursor to the point where you want to change the logic and insert the Branch Start instruction.
3.
Insert the desired parallel logic.
4.
Insert the Branch End instruction. 110
110
110
00
01
02
110 03
5.
Insert the output instruction 110
110
110
010
00
01
02
00
110 03
6.
9-10
Delete the original rung
Page 137
Chapter 9 Relay-Like Instructions
Nesting
The following rung shows a nested branch. Creating nested branches is not possible because the Branch End instruction completes a branch group. But the above rung shows a single branch group with two branch end instruction. Above, the Examine On instruction with the address 11012 is actually a branch group within a branch group. The following rung achieves the same result and avoids nested branching: 110
110
110
010
00 110
10 110
11
00
12
11
110 13
9-11