The Basic arithmetic folder

Application

In the Basic arithmetic folder of the Insert NC function window, the control offers the functions FN 0 to FN 5.

You can assign numerical values to variables using the FN 0 function. You then use a variable instead of the fixed number in the NC program. You can also use preassigned variables (e.g., the active tool radius Q108). Using the functions FN 1 to FN 5, you can make calculations with the variable values in your NC program.

Description of function

The Basic arithmetic folder contains the following functions:

Icon

Function

FN 0: Assignment

Example: FN 0: Q5 = +60

Q5 = 60

Assign a value or the Undefined status

FN 1: Addition

Example: FN 1: Q1 = –Q2 + –5

Q1 = –Q2+(–5)

Calculate and assign the sum of two values

FN 2: Subtraction

Example: FN 2: Q1 = +10 – +5

Q1 = +10–(+5)

Calculate and assign the difference of two values.

FN 3: Multiplication

Example: FN 3: Q2 = +3 * +3

Q2 = 3*3

Calculate and assign the product of two values.

FN 4: Division

Example: FN 4: Q4 = +8 DIV +Q2

Q4 = 8/Q2

Calculate and assign the quotient of two values

Restriction: You cannot divide by 0

FN 5: Square root

Example: FN 5: Q20 = SQRT 4

Q20 = 4

Calculate and assign the square root of a number

Restriction: You cannot calculate a square root from a negative value

To the left of the equal sign, define the variable to which the result should be assigned.

To the right of the equal sign, you can use fixed or variable values. The variables and numbers in the equations can be entered with an algebraic sign.

Part families

For part families, for example, you can program the characteristic workpiece dimensions as variables. When machining the individual workpieces, assign a numerical value to each variable.

NC programs contained in this User's Manual are suggestions for solutions. The NC programs or individual NC blocks must be adapted before being used on a machine.

Change the following contents as needed:

  • Tools
  • Cutting parameters
  • Feed rates
  • Clearance height or safe position
  • Machine-specific positions (e.g., with M91)
  • Paths of program calls

Some NC programs depend on the machine kinematics. Adapt these NC programs to your machine kinematics before the first test run.

In addition, test the NC programs using the simulation before the actual program run.

 
Tip

With a program test you determine whether the NC program can be used with the available software options, the active machine kinematics and the current machine configuration.

11 LBL "Z1"

12 FN 0: Q50 = +30

; Assign the value 30 to the cylinder radius Q50

13 FN 0: Q51 = +10

; Assign the value 10 to the cylinder height Q51

* - ...

21 L X +Q50

; Result corresponds to L X +30

Example: Cylinder with Q parameters

Cylinder radius:

R = Q50

Cylinder height:

H = Q51

Cylinder Z1:

Q50 = +30

Q51 = +10

Cylinder Z2:

Q50 = +10

Q51 = +50

Assigning the Undefined status to a variable

To assign the Undefined status to a variable:

    1. Select Insert NC function
    2. The control opens the Insert NC function window.

    1. Select FN 0

    1. Enter the number of the variable (e.g., Q5)
    2. Select SET UNDEFINED

    1. Confirm your input
    2. The control assigns the Undefined status to the variable.

    Notes

    • The control distinguishes between undefined variables and variables with the value 0.
    • You cannot divide by 0 (FN 4).
    • You cannot extract a square root from a negative value (FN 5).