Rockwell Automation 8520-GUM 9/Series CNC Grinder Operation and Programming Manual Documentation Set User Manual

Page 648

Advertising
background image

Paramacros

Chapter 20

20-4

Table 20.B

Mathematical Functions

Function

Meaning

SIN

Sine (degrees)

COS

Cosine (degrees)

TAN

Tangent (degrees)

ATAN

Arc Tangent (degrees)

ASIN

Arc Sine (degrees)

ACOS

Arc Cosine (degrees)

SQRT

Square Root

ABS

Absolute Value

BIN

Conversion from BCD to Decimal

BCD

Conversion from Decimal to BCD

ROUND

Rounding Off (nearest whole number)

FIX

Truncation Down

FUP

Truncation Up

LN

Logarithms (base e)

EXP

Exponent

When programming these functions, the value on which that function is to
be performed must be included in brackets. For example, SIN [10]. The
exception to this is the arc tangent function. The format for ATAN requires
the division of two values. For example, ATAN [10]/[2] is used to
calculate the arc tangent of 5.

The functions in Table 20.B are executed from left to right in a program
block. These functions are executed before the control executes any
mathematical operators such as addition or subtraction. This order of
execution can be changed only by enclosing operations in brackets [].
Operations enclosed in brackets are executed first.

Example 20.3 illustrates the format for the mathematical functions found in
Table 20.B.

Example 20.3

Format for functions

SIN[2]

This evaluates the sine of 2 degrees.

SQRT[14+2]

This evaluates the square root of 16.

SIN[SQRT[14+2]]

This evaluates the sine of the square root of 16.

LN[#2+4]

This evaluates the logarithm of the value of parameter #2 plus 4.

Example 20.4 illustrates the results obtained when using the functions in
Table 20.B.

Advertising