January 2012 8.15 Command Set 1707
8.15.48 EQUAL TO [ ] (==[ ])
Syntax: ==[ ] (EQUAL[ ])
Operands: None
Action:
By using parentheses you can change the sequence of processing
comparative commands 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.
Comparative commands cause a direct transition from word to logical
processing. If the specified comparative condition is true, the control sets the
logic accumulator to 1; if the condition is not fulfilled, it sets it to 0.
See next page for example.
Example:
Multiply a constant by double word D36, compare the result with double word
D12, and assign the result to output O15.
Initial state:
Constant = 1000 (dec)
Double word D12 = 15000 (dec)
Double word D36 = 10 (dec)
Output O15 = ?
Function STL Accumulator
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 into the
word accumulator.
L K1000 1000
Multiply the content of
the word accumulator
with double word D36.
x D36 10000 10
Closing parenthesis: Gate
the accumulator content
with the program stack
(==[, >=[ ...); if condition
not fulfilled, set logic
accumulator to 0.
]
Assign the result to
output O15.
= O15 0 0