Download Print this page

HEIDENHAIN MANUALplus 620 Technical Manual page 1705

Hide thumbs Also See for MANUALplus 620:

Advertisement

8.15.43 ADDITION [ ] (+[ ])
January 2012
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 control saves the result in the accumulator again. Maximum
nesting depth: 16 parentheses. If an error occurs during calculation, the
control 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
Load the double word
D12 into the word
accumulator.
Opening parenthesis:
Buffer the accumulator
content onto the program
stack.
Load the constant K1000
into the word
accumulator.
Divide the word
accumulator by the
content of the double
word D36.
Closing parenthesis: Gate
the accumulator content
with the program stack
(+[, –[ .....).
Assign the result of the
total operation to double
word D100.
8.15 Command Set
STL
Accumulator
content
L D12
15000
+[
L K1000 1000
/ D36
10
]
= D100
15010
Operand content
15000
100
15010
1705

Advertisement

loading