Programming
10.9 Arithmetic parameters (R variables), LUD and PLC variables
Surface grinding
276
Programming and Operating Manual, 11/2012, 6FC5398-5CP10-3BA0
The value of the exponent is written after the EX characters; maximum total number of
characters: 10 (including leading signs and decimal point)
Range of values for EX: -300 to +300
Example:
R0=-0.1EX-5
;Meaning: R0 = -0.000 001
R1=1.874EX8
;Meaning: R1 = 187 400 000
Note
There can be several assignments in one block incl. assignments of arithmetic expressions.
Assignments to other addresses
The flexibility of an NC program lies in assigning these arithmetic parameters or expressions
with arithmetic parameters to other NC addresses. Values, arithmetic expressions and
arithmetic parameters can be assigned to all addresses; Exception: addresses N, G, and L.
When assigning, write the " = " sign after the address character. It is also possible to have an
assignment with a minus sign.
A separate block is required for assignments to axis addresses (traversing instructions).
Example:
N10 G0 X=R2
;Assignment to X axis
Arithmetic operations/arithmetic functions
When operators/arithmetic functions are used, it is imperative to use conventional
mathematical notation. Machining priorities are set using round brackets. Otherwise,
multiplication and division take precedence over addition and subtraction.
Degrees are used for the trigonometrical functions.
Permitted arithmetic functions: see Section "List of instructions"
Programming example: Calculating with R parameters
N10 R1= R1+1
;The new R1 is calculated from the old R1
plus 1
N20 R1=R2+R3 R4=R5-R6 R7=R8*R9 R10=R11/R12
N30 R13=SIN(25.3)
;R13 equals sine of 25.3 degrees
N40 R14=R1*R2+R3
; Multiplication and division take precedence
over addition or subtraction R14=(R1*R2)+R3