1802 HEIDENHAIN Technical Manual iTNC 530 HSCI
9.8.43 ADDITION [ ] (+[ ])
Syntax: +[ ] (PLUS[ ])
Operands: None
Action:
Use parentheses together with arithmetical commands only for word
processing. By using parentheses you can change the sequence of processing
in a statement list. The opening-parenthesis command puts the content of the
word accumulator onto the program stack. This clears the accumulator for
calculation of intermediate results. The closing-parenthesis command gates
the buffered value from the program stack with the content of the word
accumulator. The iTNC saves the result in the accumulator again. Maximum
nesting depth: 16 parentheses. If an error occurs during calculation, the iTNC
sets the marker M4201.
Example:
Example for the commands ADD [ ], SUBTRACT [ ], MULTIPLY [ ], DIVIDE [ ],
REMAINDER [ ].
Divide a constant by double word D36, add the result to double word D12, and
assign the result to double word D100.
Initial state:
Constant = 1000 (dec)
Double word D12 = 15000 (dec)
Double word D36 = 100 (dec)
Double word D100 = ?
Function STL Accumulat
or content
Operand content
Load the double word D12
into the word accumulator.
L D12 15000 15000
Opening parenthesis: Buffer
the accumulator content onto
the program stack.
+[
Load the constant K1000 into
the word accumulator
L K1000 1000
Divide the word accumulator
by the content of the double
word D36.
/ D36 10 100
Closing parenthesis: Gate the
accumulator content with the
program stack (+[, –[ .....).
]
Assign the result of the total
operation to double word
D100.
= D100 15010 15010
Set Reset
M4200 Overflow during multiplication NC PLC
M4201 Division by 0 NC PLC
M4202 Incorrectly executed modulo NC PLC
M4203 Error status for PLC module NC NC/PLC