beautypg.com

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

Page 10

background image

Programming

Chapter 3

3Ć2

Table 3.A

AF1 Function Numbers

Function

Number

Mathematical Operation

01

Add

02

Subtract

03

Multiply

04

Divide

05

Square root

06

Average

07

Standard deviation

13

BCD to binary conversion

14

Binary to BCD conversion

You enter an existent function number and then enter data and result addresses
(we will explain this in detail later). The processor then places a number in the
data address.

When the Mini-PLC-2/15 controller encounters an AF2 function during
program execution and the rung is true, the processor performs the following
steps:

1.

Saves its present position in the user program.

2.

The interlock system (see Avoiding Excessive AF1 Execution Times)
grants access to the AF1 function.

3.

Reads the operand’s data stored in the data address that you entered.

4.

Reads the result address which you entered.

5.

Obtains the location of the mathematical routine requested by the function
number.

6.

Executes the routine in the AF1 area. (See section for excessive execution
time.)

7.

Writes the results at the result address in the data table.

8.

Returns program execution to the next instruction in the user’s program
after the AF1 function is completed. (See section for excessive execution
time.)

9.

Readies itself for the next AF1 operation.

AF1 Function Sequence