Parenthetical expressions, 6 parenthetical expressions – HEIDENHAIN TNC 122 Technical Manual User Manual
Page 56
4/97
TNC 122
12 PLC Description
55
UNEQUAL (<>)
Operands: B, W, D, K
With this command, a direct transfer from Word to Logic execution occurs. The content of the Word
Accumulator is compared with the content of the addressed operand. If the Word Accumulator and
the operand are not equal, the condition is true and the Logic Accumulator is set to 1. If the Word
Accumulator is equal to the operand, the Logic Accumulator is set to 0. The comparison takes place
over the number of bits corresponding to the operand, i.e. B = 8 bits, W = 16 bits and D = K = 32
bits.
12.2.6 Parenthetical Expressions
Parentheses with logical commands
The execution sequence in an instruction list can be altered by using parentheses. The open-
parentheses command loads the contents of the Accumulator onto the Program Stack. If the Logic
Accumulator is addressed in the last command before an open-parentheses instruction, the content
of the Logic Accumulator is loaded into the Program Stack. By addressing the Word Accumulator,
the content of the Word Accumulator will be distributed.
The close-parentheses instruction initiates the gating of the buffered value from the Program Stack
with the Logic Accumulator and/or the Word Accumulator, depending on which Accumulator was
addressed before the open-parentheses instruction. The result is then available in the corresponding
Accumulator. The maximum nesting level is 16 parentheses.
AND [ ]
(A[ ])
AND NOT [ ]
(AN[ ])
OR [ ]
(O[ ])
OR NOT [ ]
(ON[ ])
EXCLUSIVE OR [ ]
(XO[ ])
EXCLUSIVE OR NOT [ ]
(XON[ ])
Parentheses with arithmetic commands
With arithmetic commands, only word execution is possible. The execution sequence in an
instruction list may be altered by using parentheses. The open-parentheses command loads the
content of the Word Accumulator onto the Program Stack. The Accumulator is then available for the
calculation of intermediate results. The close-parentheses instruction initiates the gating of the
buffered value from the Program Stack with the content of the Word Accumulator. The result is
again loaded into the Accumulator. The maximum nesting level is 16 parentheses.
ADDITION [ ]
(+[ ])
SUBTRACTION [ ]
(–[ ])
MULTIPLICATION [ ]
(x[ ])
DIVISION [ ]
(/[ ])
REMAINDER [ ]
(MOD[ ])