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

The text of a manual · part 6 of 29

1772 Mini PLC-2/05 Processor (Cat. No. 1772-LS, LSP) Programming and Operations Manual, pages 51 to 60

Pages 51 to 60 of 289

The original document is the PDF (1.4 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.

For the Allen-Bradley 1772-LSP

Page 51

Chapter 5 Scan Theory

Add the execution values for each instruction by using Table 5.A. The sum of these values added to the I/O scan time is the average scan time. Table 5.A Approximate Execution Time Per Scan (in average microseconds) Symbol

Instruction True

Instruction False

Examine on, Examine off Output energize Output latch Output unlatch

-| |-,-| / |- -( )- -(L)- -(U)-

14 16 17 17

11 16 13 13

Get Put

-[G]- -(PUT)-

28 26

- 14

Equal Less than

-(=)- -(<)-

23 25

11 13

Get byte Limit test

-|B|- -|L|-

16 24

- 11

Counter reset Retentive timer reset

-(CTR)- -(RTR)-

20 20

14 14

Timer on-delay Retentive timer on-delay Timer off-delay

-(TON)- -(RTO)- -(TOF)-

75 78 82

47 48 60

Up counter Down counter

-(CTU)- -(CTD)-

70 75

55 60

3 Digit Math Add Subtract Multiply Divide

-(+)- -(-)- -(x)-(x)- -( ÷ )-( ÷ )-

48 80 615 875

15 19 60 60

27

27

Instruction Name

Add to any of the above when its address is 4008 or greater

5-4

Expanded Math Add Subtract Multiply Divide Square root BCD to binary Binary to BCD

EAF 01 EAF 02 EAF 03 EAF 04 EAF 05 EAF 13 EAF 14

400-500 400-500 800-2250 500-3250 1850 500 500

40 40 40 40 40 40 40

Master control reset Zone control last state 1

-(MCR)- -(ZCL)-

16 22(no skip)

16 20+(13 per word skipped)

Branch start Branch end End, temporary end Subroutine area Immediate input update

T.END SBR -[ I ]-

16 18 27 27 45 (with forcing on 55)

16 18 27 27 -

Immediate output update

-(IOT)-

70(with forcing on 80)

17

Page 52

Chapter 5 Scan Theory

Instruction Name

Symbol

Instruction True

Instruction False

Label Return Jump to subroutine Jump Block transfer read

LBL -(RET)- -(JSR)- -(JMP)- BLOCK X-FER 1

34 30 100 55 80

- 15 15 15 75

Block transfer write

BLOCK X-FER 0

80

75

Sequencer load

SEQ 2

390(80/extra word)

105

Sequencer input

SEQ 1

420(90/extra word)

55

Sequencer output

SEQ 0

470(90/extra word)

110

File-to-word move Word-to-file move File-to-file move

FILE 12 FILE 11 FILE 10440 (+10/word transferred)

250 250 200

45 45

1 When a rung that contains a ZCL instruction is false, the execution time of each instruction between the start fence and end fence is 17 microseconds per word.

Here is an explanation of the rungs in Figure 5.2: Rung 1 - The count increments its accumulated value each time this rung is true. Rung 2 - This rung enables the counter to increment on the next scan. If we did not have this rung, the counter would always be true and it would not increment. Remember: Counters increment only on false to true transitions. Rung 3 - The timer times in tenths of seconds when we are counting. This value is displayed on the industrial terminal screen. Rung 4 - The average scan time is displayed beneath store 2 and store 3 in milliseconds. Important: Refer to three digit math in chapter 10. Rung 5 - The counter overflow bit is re-setting the timer. Rung 6 - The counter overflow bit is resetting the counter.

Chapter Summary

We described scan sequence and a method to measure average scan time. The next chapter explains some of the instructions you use in a program.

5-5

Page 53

Chapter

6

Relay-type Instructions

Chapter Objectives

This chapter describes: relay-type instructions how to define conditions before an action takes place

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

Here, a series of conditions (C2, C2, C3) must be true before action A is performed.

6-1

Page 54

Chapter 6 Relay-type Instructions

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.) If the device is:

Then a bit in memory is on set off reset

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. 6-2

Page 55

Chapter 6 Relay-type Instructions

Each input and output bit has a five-digit address. Reading from left to right: the first number denotes the type of I/O module: - 0 output - 1 input the second number denotes an I/O chassis and it always is a 1. the third number denotes a module group. This number will range from 0-7. the fourth and fifth numbers denote a terminal designation: - 00-07 left slot of the module group - 10-17 right slot of the module group Important: Remember a Mini-PLC-2/05 processor can use only one rack. Important: For addressing purposes, I/O modules in a given I/O rack are organized into “module groups.” A module group is a pair of adjacent I/O modules. Thus, the module group number of an individual I/O module depends only on the I/O slot the module occupies. It is important to note that the first module group in any I/O chassis is always module group 0.

Programming Instructions

You can use seven programming instructions to write a program. These instructions are divided into three categories: bit examining, bit controlling, and branch instructions.

Bit Examining Examine On and Examine Off Purpose: The Examine On -] [- and Examine Off -]/[- instructions tell the processor to examine a bit at a specified data table location 112

012

04 Bit Examining Examine On 112

13

05 Bit Examining Examine Off

012 14

Determines the bit condition. The bit condition becomes: True - Examine On detects a bit in the data table that is set. True - Examine Off detects a bit in the data table that is reset. False - Examine On detects a bit in the data table that is reset. False - Examine Off detects a bit in the data table that is set. 6-3

Page 56

Chapter 6 Relay-type Instructions

Keystrokes: Enter an Examine On or Examine Off instruction by performing the following steps. 1.

Press either -] [- or -]/[- as required.

2.

Enter <address>.

Removing the Examine On or Examine Off Instruction You remove an Examine On or a Examine Off instruction by performing the following steps. 1.

Position the cursor over the Examine On or Examine Off instruction you want to remove.

2.

Press [REMOVE] -] [- or -]/[-.

Editing a Partially Completed or a Completed Rung You 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. 1.

Position the cursor over the Examine On or Examine Off instruction you want to edit.

2.

Press either -] [- or -]/[- or any other appropriate instruction type key.

3.

Enter <address>.

Bit Controlling Output Energize Purpose: This Output Energize instruction tells the processor to set or reset a specified data table bit. 112 06

012 15 Bit Controlling Output Energize

Controls a specific bit based on the rung condition. When its rung conditions are: True - Output Energize sets a specified bit. False - Output Energize resets a specified bit.

6-4

Page 57

Chapter 6 Relay-type Instructions

Keystrokes: You enter an Output Energize instruction by performing the following steps. 1.

Press -( )-.

2.

Enter <address>.

Removing an Output Energize Instruction The only way you remove an Output Energize instructions is to remove the entire rung. See chapter 16. Editing in a Completed Rung You edit the Output Energize instruction by performing the following steps. However, you cannot remove an output instruction. 1.

Position the cursor over the Output Energize instruction you want to change.

2.

Press -( )- or any other appropriate output instruction type key.

3.

Enter <address>.

Output Latch/Unlatch Purpose: The Output Latch -(L)- instruction tells the processor to latch and set a specified data table bit. 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 than 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.

6-5

Page 58

Chapter 6 Relay-type Instructions

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. Keystrokes: You 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 pressing 1 or 0, respectively. Editing in a Completed Rung You 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.

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

True C2

6-6

A

Page 59

Chapter 6 Relay-type Instructions

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. Branch Start/End Purpose: 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. A Branch End instruction completes a set of parallel branches. Keystrokes: You enter a Branch Start or Branch End instruction by performing the following steps 1.

Press either [

] or [

].

Important: You must begin each rung of parallel conditions with a Branch Start instruction.

6-7

Page 60

Chapter 6 Relay-type Instructions

Removing a Branch Start or Branch End Instruction You remove either 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 You insert either 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.

Complete the set of parallel conditions by: 5.

Press [INSERT] [

].

Important: Once you press the Branch End instruction, the statement BRANCH END OMITTED disappears. Nesting

The following rung shows a nested branch. 110

110

110

010

00 110

10

11

00

12 110 13

6-8