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

The text of a manual · part 9 of 29

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

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

Chapter 9 Data Manipulation Instructions

There are two cases for comparison: Case 1. Lower Limit YYY Upper Limit 010

120 0451 050 200 B L 170 06 YYY8

05

If YYY is equal to or greater than 170 and equal to or less than 200, the comparison is true and logic continuity is established. If YYY is less than 170 or greater than 200, the comparison is false and logic continuity is not established. 3778 False 2008

YYY8 True 1708 False 000

Case 2. Lower Limit - YYY - Upper Limit 010

120 0451 050 170 B L 200 06 YYY8

05 3778

YYY8 True 2008 False 1708

YYY8 True 000

9-6

Page 82

Chapter 9 Data Manipulation Instructions

If YYY is equal to or less than 200 and equal to or greater than 170, the comparison is false and logic continuity is not established. If YYY8 is greater than 200 or less than 170, the comparison is true and logic continuity is established. Keystrokes: You enter a Limit Test instruction by performing the following steps. 1.

Press -[L]-.

2.

Enter <address>.

3.

Enter <upper limit>.

4.

Enter <lower limit>.

Editing a Completed Rung You edit the Limit Test comparison by performing the following steps.

Operations Involving Transfer and Comparison Instructions

1.

Press -[L]-.

2.

Enter <address>.

3.

Enter <upper limit>.

4.

Enter <lower limit>.

You can perform five operations involving transfer and comparison instructions. equal to or less than greater than equal to or greater than get byte get byte/put

Equal To or Less Than Purpose: The equal to/les than comparison is made using the Get, Les, Equ and branching instructions. The get value is the changing value. The Les and Equ instructions are assigned a reference value. When the get value is either less than or equal to the value at Les and Equ instructions, the comparison is true and logic continuity is established.

9-7

Page 83

Chapter 9 Data Manipulation Instructions

120 030 037 G < 04 YYY 237 037 = 237

010 02

When YYY 237, GET/LES-EQU comparison is true and 010/03 is energized.

Important: Only one Get instruction is required for a parallel comparison. The Les and Equ instructions are programmed in parallel branches. Keystrokes: You enter an equal to or less than comparison by following the following steps. 1.

Press -[G]-.

2.

Enter <address>.

3.

Enter <reference value>.

4.

Press [ ]

5.

Press -[<]-.

6.

Enter <address>.

7.

Enter <reference value>.

8.

Press [ ].

9.

Press -[=]-.

10. Enter the same address as that entered for the Less Than instruction. 11. Enter <reference value>. 12. Press [ ] 13. Press -( )-. 14. Enter <address>. Editing the Operation See the editing for the Get, Les, Equ and Branching instructions.

9-8

Page 84

Chapter 9 Data Manipulation Instructions

Greater Than Purpose: A greater than comparison is also made with the Get/Les pair of instructions. This time the Get instruction BCD value is the reference and the Les instruction BCD value is the changing value. The Les value is compared with to the Get value for a greater than condition. When the Les value is greater than the Get value, the comparison is true and logic continuity is established. 120 030 010 G < 03 000 YYY

010 02 Reference Value

When YYY > 100, GET/LES comparison is true and 010/02 is energized.

Keystrokes: You enter a greater than comparison by performing the following steps. 1.

Press -[G]-.

2.

Enter <address>.

3.

Enter <reference value>.

4.

Press -[<]-.

5.

Enter <address>.

6.

Enter <reference value>.

Editing the Operation See the editing for the Get and Less instructions

Equal To or Greater Than Purpose: This comparison is made using the Get, Les, Equ and branching instructions. The Get value is assigned a reference value. The Les and Equ values are changing and are compared to the Get value. When the Les and Equ values are greater than or equal to the Get value, the comparison is true and logic continuity is established. 120 030 042 G < 05 440 YYY 042 = YYY

010 02

Reference Value When YYY - 440, GET/LES-EQU comparison is true and 010/04 is energized.

9-9

Page 85

Chapter 9 Data Manipulation Instructions

Keystrokes: You enter an Equal To or Greater Than comparison by performing the following steps. 1.

Press -[G]-.

2.

Enter <address>.

3.

Enter <reference value>.

4.

Press [ ].

5.

Press -[=]-.

6.

Enter <address>.

7.

Enter <reference value>.

8.

Press [ ].

9.

Press -[<]-.

10. Enter <address>. 11. Enter <reference value>. 12. Press [ ]. 13. Press -( )-. 14. Enter <address>. Editing the Operation See the editing Get, Les, Equ and branching instructions.

Get Byte Purpose: The Get Byte instruction accesses 1 byte (instead of word) from one address in the data table. The Get Byte instruction can be programmed with a limit test instruction located in the condition area of the ladder diagram rung. Use with a Put instruction to transfer either the upper or lower byte to the upper or lower byte of the Put instruction address. Do not place compare instructions between the Get Byte and Limit Test instructions.

9-10

Page 86

Chapter 9 Data Manipulation Instructions

Keystrokes: You enter a Get Byte instruction by performing the following steps. 1.

Press -[B]-.

2.

Enter <address>.

3.

Enter <byte designation>.

Editing the Operation You edit the Get Byte comparison by performing the following steps. 1.

Position the cursor over -[B]-.

2.

Press -[B]-.

3.

Enter <address>.

4.

Enter <by designation>.

Get Byte/Put Purpose: The Get Byte instruction can be programmed either at the beginning of the rung or with one or more condition instructions preceding it. Condition instructions, however, should not be programmed after a Get Byte instruction. When one or more condition instructions precede the Get Byte instruction, they determine whether the rung is true or false. The Get Byte instruction addresses either the upper or lower byte of a data table word. A 1 is entered after the word address for an upper byte; a 0 is entered for the lower byte. There are two ways to perform a Get Byte/Put instruction. Case 1. One Get Byte XXXD B YYY8

040 PUT ZZZ ZZZZ

16 only these three letters are displayed

The Get Byte instruction is programmed in the condition area of the ladder rung. It tells the processor to make a duplicate of all 8 bits in the addressed byte. When the rung containing the Get Byte/Put instructions goes true, the data is transferred to both the upper and lower byte of the word address of the Put instruction.

9-11

Page 87

Chapter 9 Data Manipulation Instructions

Case 2. Two Get Bytes XXXD XXXD B B WWW8 YYY8 XXX WWW YYY D word address octal values - upper or lower byte

040 PUT BCC BBCCC 16 only these three letters are displayed

0 - lower byte 1 - upper byte

Two Get Byte instructions are programmed in the condition area of the ladder rung. It tells the processor to make a duplicate of all 8 bits in each addressed byte. When the rung containing the Get Byte/Put instructions goes true, the data from the first get byte is transferred into the upper byte of the addressed Put instruction. Also, the data from the second get byte is transferred into the lower byte of the addressed Put instruction. Keystrokes: You enter a Get Byte/Put instruction by performing the following steps. 1.

Press -[B]-.

2.

Enter <address>.

3.

Enter <byte designation>.

Important: Repeat steps 1, 2 and 3 when using two Get Byte instructions.

9-12

4.

Press -(PUT)-.

5.

Enter <address>.

Page 88

Chapter 9 Data Manipulation Instructions

Editing the Operation You edit a Get Byte/Put instruction by performing the following steps. 6.

Position the cursor over -[B]-.

7.

Press -[B]-.

8.

Enter <address>.

9.

Enter <byte designation>.

Important: Repeat steps 2, 3 and 4 when using two Get Byte instructions. 10. Press -(PUT)-. 11. Enter <address>.

Chapter Summary

We showed you how to transfer and compare data. Also, we showed you how to use these instructions to perform comparison operations. The next chapter shows you how to perform operations involving three digit and expanded math.

9-13

Page 89

Chapter

10

Math Instructions

Chapter Objectives

This chapter describes two different types of math operations: three digit math expanded math Table 10.A lists definitions of some mathematical terms. Table 10.A Common Arithmetic Terms

Three-Digit Math

Terms

A

B

C

Operands

Operand A

Operand B

Addition

Augend

+ Addend

Sum

Subtraction

Minuend

- Subtrahend

Difference

Multiplication

Multiplicand

Multiplier

Product

Division

Dividend

Divisor

Quotient

Square Root

Root

Square Root

Your processor can perform four operations using three-digit math: addition subtraction multiplication division These operations are not signed functions.

10-1

Page 90

Chapter 10 Math Instructions

Addition, Subtraction, Multiplication and Division Addition Reports the sum of two values from the two Get instructions immediately preceding the addition instruction. Programmed in the output position of the ladder diagram rung. The sum is stored in the add instruction word address. 030 G 320

031 G 380

032 + 700

When the sum exceeds 999, the overflow bit (bit 14) in the add instruction word is set. When the processor is operating in the run, program, or remote test mode, the overflow condition appears on the industrial terminal screen as a “1” preceding the sum. Important: If an overflow value (four digits) is used for subsequent comparisons or other arithmetic operations, inaccurate results could occur. 030 G 999

031 G 999

032 + 1998

Subtraction Reports the difference between two get values immediately preceding the subtraction instruction. The second get word value is subtracted from the first get word value. Programmed in the output position of the ladder diagram rung. The difference is stored in the subtract instruction word address. 070 G 134

071 G 039

072 095

When the difference is a negative number, the underflow bit (bit 16) in the subtract instruction word is set. When your processor is in the run, program, or remote test mode, the negative sign appears on the industrial terminal screen preceding the difference. 070 G 100

071 G 134

072 034

Important: Use only positive values. If you use a negative BCD value for subsequent operation, inaccurate results could occur.

10-2