beautypg.com

Rockwell Automation 1772-AF1,D17726.5.1 User Manual MINI-PLC-2/15 User Manual

Page 30

background image

Programming

Chapter 3

3Ć22

Figure 3.17

AF1 Division Function Input and Result Display Rungs

Bit

Storage

204

200

G

203

000

G

202

400

G

201

000

G

305

000

G

306

002

G

307

080

G

310

000

G

Execute Aux

Function

Function Number:
Data Addr:
Result Addr:

04

201
305

Error Message

If you divide by zero, the error bit (bit 14) is set and the result reads zero.

AF1 Square Root Function

The AF1 square root function operates on a 3-digit BCD integer and presents
the result in a 6-digit BCD number composed of three integer digits and 3
decimal digits. The first integer digit and the last decimal digit (digit 1 and digit
6) are always zero.

(+XXX.)

1/2

= +XXX.XXX

A decimal point is implied between digits 3 and 4. the function calculates the
square root of the absolute input value and sets the sign bit in the output to the
sign of the input. The result is accurate to +.01.

How to Enter an AF1 Square Root Function

To program an AF1 square root function, perform the following steps:

1. Press [SHIFT] [EAF] or [SHIFT][SCT] on the keyboard of your industrial

terminal. Figure 3.1 appears on the CRT.

2. Enter 05, the function number for AF1 square root.

This entry identifies that the function entered is to perform an AF1 square root
and that the processor use the data table format shown in Figure 3.18 when
executed. The three digits of the operand (the number whose square root you
desire) are represented in BCD by the groups of bits labeled digit 1 through 3.
The six digits of the result are labeled digit 1 through 6. Digit 1 and digit 6 in
the result are always zero.