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

The text of a manual · part 24 of 59

Mini-PLC-2/02, -2/16, -2/17 Processor (cat. no. 1772-LZ, LZP, LX, LXP, LW, LWP) User Manual: 14 - EAF Math Instructions, pages 187 to 193

Pages 187 to 193 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.5 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-LX / LXP

Page 187

Chapter 14 EAF Math Instructions

Exponential Enter an exponential function EAF rung like that shown in Figure 14.13. Figure 14.13 EAF Exponential Function Input and Display Rung 060 G 000 040 G 000

061 G 332 041 G 009

062 G 900 042 G 420

063 G 000 043 G 000

EXECUTE AUX FUNCTION FUNCTION NUMBER: 32 DATA ADDR: 040 RESULT ADDR: 060

Enter values for the operand. You can enter these values from the keyboard of your 1770-T3 terminal or through ladder diagram functions. Entry of an operand (exponent of e) of 9.42 yields an exponential function value of 012 332 . 900 000. Figure 14.14 shows how it is stored in the data table. Figure 14.14 EAF Exponential Format in the Data Table After Execution 17

16

15

0

Operand A

14 13

10 7

Data 0 Address

43

0

0

0

040

0

0

9

041

4

2

0

042

0

0

0

043 Result Address

Result

X

0

0

0

1

2

060

3

3

2

061

9

0

0

062

0

0

0

063 10355-I

14-15

Page 188

Chapter 14 EAF Math Instructions

Square Root This function finds the value of +x1/2= y. The Operand and Result words have the format: + xxx xxx . xxx xxx1/2= + yyy yyy . yyy yyy If you want to find the square root of a negative number, this function ignores the minus sign and finds the square root of the absolute value of the number. Enter an EAF square root function like that shown in Figure 14.15. Figure 14.15 EAF Square Root Function Input and Display Rung 060 G 000 040 G 000

061 G 012 041 G 144

062 G 000 042 G 420

063 G 000 043 G 000

EXECUTE AUX FUNCTION FUNCTION NUMBER: 05 DATA ADDR: 040 RESULT ADDR: 060

Enter the value for the Operand. You can enter this value from the keyboard of your 1770-T3 terminal or through ladder diagram functions. Entry of operand 144 produces the number 12. Figure 14.16 shows how the operand and the result are stored.

14-16

Page 189

Chapter 14 EAF Math Instructions

Figure 14.16 EAF Square Root Format in the Data Table After Execution 17

16

15

14 13

0

Operand A

10 7

Data 0 Address

43

0

0

0

040

1

4

4

041

0

0

0

042

0

0

0

043 Result Address

Result

X

S

0

0

0

0

060

0

1

2

061

0

0

0

062

0

0

0

063 10356-I

10 to the X

The 10 to the x function finds the value of 10x = y. The Operand and Result words have the format: x = exponent of 10 (maximum value = 5.999 999) y = resultant number (maximum of 6 digits) 10+/–x . xxx xxx = yyy yyy . yyy yyy Enter an EAF rung like that shown in Figure 14.17. Figure 14.17 EAF Power of 10 Function Input and Display Rung 060 G 000 040 G 000

061 G 243 041 G 002

062 G 221 042 G 386

063 G 000 043 G 000

EXECUTE AUX FUNCTION FUNCTION NUMBER: 37 DATA ADDR: 040 RESULT ADDR: 060

Enter values for the operand. You can enter these values from the keyboard of your 1770-T3 terminal or through ladder diagram functions. Entry of an operand (exponent of 10) of 000 002 . 386 000 yields an exponential value of 000 243 . 221 000. Figure 14.18 shows how it is stored in the data table.

14-17

Page 190

Chapter 14 EAF Math Instructions

Figure 14.18 EAF Power of 10 Format in the Data Table After Execution 17

16

15

14 13

0

Operand A

10 7

Data Address 0

43

0

0

0

040

0

0

2

041

3

8

6

042

0

0

0

043 Result Address

Result

0

0

0

060

2

4

3

061

2

2

1

062

0

0

0

063 10357-I

Reciprocal

The Reciprocal EAF instruction is a feature of the Mini-PLC-2/17 processor only. This EAF function finds the reciprocal of a number. The Operand and Result words have the format: 1/ +/–xxx xxx . xxx xxx = +/–yyy yyy . yyy yyy Enter an EAF rung like that shown in Figure 14.19. Figure 14.19 EAF Reciprocal Function Input and Display Rung 060 G 000 040 G 000

061 G 000 041 G 124

062 G 008 042 G 386

063 G 065 043 G 000

EXECUTE AUX FUNCTION FUNCTION NUMBER: 34 DATA ADDR: 040 RESULT ADDR: 060

Enter the value for the operand. Entry of operand 124 yields as its reciprocal value 0.008065. Figure 14.20 shows how it is stored in the data table.

14-18

Page 191

Chapter 14 EAF Math Instructions

Figure 14.20 EAF Reciprocal Format in the Data Table After Execution 17

16

15

0

Operand A

14 13

10 7

Data 0 Address

43

0

0

0

040

1

2

4

041

0

0

0

042

0

0

0

043 Result Address

Result

X

0

X

0

0

0

060

0

0

0

061

0

0

8

062

0

6

5

063 10358-I

BCD to Binary

The BCD to Binary conversion function converts a BCD Conversion number into a binary number. Its function number is 13 and the conversion takes the form: 0xx xxx = y yyy Important: When the result is displayed using a Get instruction, only the first 12 bits can be seen. Use a SEARCH 53 to look at all 16 bits. Enter an EAF rung like that in Figure 14.21 Figure 14.21 EAF BCD to Binary Conversion Function Input and Display Rung 060 G FFF 040 G 004

EXECUTE AUX FUNCTION 041 G 095

FUNCTION NUMBER: 13 DATA ADDR: 040 RESULT ADDR: 060

14-19

Page 192

Chapter 14 EAF Math Instructions

Enter the BCD number. Entry of the BCD number 004 095 produces the hexadecimal number FFF. If the Operand is greater than +32 767, the result 7FFFh is stored in the data table. However, you will see only FFF below the instruction. You must use a SEARCH 53 to see the entire word. If the Operand is more negative than –32 767, 8001 is displayed at the result address. All negative values are stored as two’s complement. Figure 14.22 shows how the result is stored in the data table. Figure 14.22 EAF BCD to Binary Conversion Format in the Data Table After Execution 17 16

15

14 13

10 7

0

Operand A

0

Data 0 Address

43 0

4

040

9

5

041 Result Address

Result

X

0

0

0

F

F

F

060 10359-I

Bit 16 of the first data address word is the sign bit of the BCD number. Bit 17 of the result address is the sign bit of the binary number. Bits 14-16 of the Result Address word are used if the operand is greater than 4095.

Binary to BCD

The BCD to Binary EAF function converts a Binary number into a BCD number. Its function number is 14 and the conversion takes the form: x xxx = 0yy yyy Enter an EAF rung like that in Figure 14.23 Figure 14.23 EAF Binary to BCD Conversion Function Input and Display Rung 060 061 G G 004 095 040 G FFF

14-20

EXECUTE AUX FUNCTION FUNCTION NUMBER: 14 DATA ADDR: 040 RESULT ADDR: 060

Page 193

Chapter 14 EAF Math Instructions

Enter a Binary number. Entry of the binary number FFF produces the BCD number 004 095. If you enter 7FFF (use SEARCH 53 and set the bits), 32 767 is displayed. All negative values are stored as two’s complement. Figure 14.24 shows how the result is stored in the data table. Bit 16 of the first Result Address word is the sign bit of the BCD number. Figure 14.24 EAF Binary to BCD Conversion Format in the Data Table After Execution 17 Operand A

16

15

14 13

0

0

0

10 7 F

Data 0 Address

43 F

F

040 Result Address

Result

X

0

0 0

0

4

060

9

5

061 10360-I

14-21