beautypg.com

Rockwell Automation 8520 9/Series CNC Lathe User Manual

Page 29

background image

Basic Control Operation

Chapter 2

2-7

Example 2.2

Format for

[CALC]

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.

Example 2.3

Mathematical Function Examples

Expression Entered

Result

SIN[90]

1.0

SQRT[16]

4.0

ABS[-4]

4.0

BIN[855]

357.0

BCD[357]

855.0

ROUND[12.5]

13.0

ROUND[12.4]

12.0

FIX[12.7]

12.0

FUP[12.2]

13.0

FUP[12.0]

12.0

LN[9]

2.197225

EXP[2]

7.389056

Important: Precaution must be taken when performing calculations within

the brackets [ ]. The operations within the bracket are performed first, and

then the function is performed on this resultant. For example:

ROUND[2.8+2.6];

The result of this is 5.0

The values in the brackets are added together first and then rounded, not

rounded and then added together.

Paramacro Variables in CALC Operations

Any paramacro variable can be accessed through the CALC function.

Include a # sign followed by the paramacro variable number. When the

calculation is performed the value of that paramacro variable is substituted

into the equation. You can not change the value of paramacro variables

with the CALC function. Local parameters are only available for the

currently active nesting level of the control (main program, or one of four

nested macro programs). You can not perform calculations that contain

any paramacro variables if the control is currently executing a program

block. The control must be in either cycle stop state, or E-Stop.