Siemens SIMATIC S5-95F Manual page 211

Table of Contents

Advertisement

S5-95F
Processing an Arithmetic Operation
Before an arithmetic operation is executed, both operands must be loaded into the accumulators.
Note
When using arithmetic operations, make sure the operands have the same number
format.
Arithmetic operations are executed independently of the RLO. The result is available in ACCU 1 for
further processing. The contents of ACCU 2 are not changed.
These operations do not affect the RLO. The condition codes are set according to the results.
STL
L
C 3
L
C 1
+ F
T
QW 12
876
+
668
=
1544
EWA 4NEB 812 6210-02
The value of counter 3 is loaded into ACCU 1.
The value of counter 1 is loaded into ACCU 1. The previous contents of
ACCU 1 are shifted to ACCU 2.
The contents of the two accumulators are interpreted as 16-bit fixed-point
numbers and added.
The result, contents of ACCU 1, is transferred to output word QW12.
Numeric Example
15
0 0 0 0 0 0 1 1 0 1 1 0 1 1 0 0
0 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0
0 0 0 0 0 1 1 0 0 0 0 0 1 0 0 0
Explanation
0
ACCU 2
+ F
ACCU 1
ACCU 1
STEP 5 Operations
8-31

Advertisement

Table of Contents
loading

Table of Contents