Siemens SIMATIC S5-115U User Manual page 249

Simatic s5 series cpu 941-7ub11 cpu 942-7ub11 cpu 943-7ub11 and cpu 943-7ub21 cpu 944-7ub11 and cpu 944-7ub21
Table of Contents

Advertisement

S5-115U Manual
STL
L
DW 2
Load the contents of data word DW 2 into ACCUM 1.
SLW 3
Shift the bit pattern in ACCUM 1 three positions to the left.
T
DW 3
Transfer the result (contents of ACCUM 1) to data word DW 3.
15
ACCUM 1
0 0 0 0 0 0 0 1
15
ACCUM 1
0 0 0 0 1 1 1 0 1 0 0 0 0 0 0 0
STL
L
IW 128
Load the value of input word IW 128 into ACCUM 1.
SRW 4
Shift the bit pattern in ACCUM 1 four positions to the right.
T
QW 160
Transfer the result (contents of ACCUM 1) to output word QW 160.
15
ACCUM 1
0 0 0 0 0 0 0 1
SRW 4
15
ACCUM 1
0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 0
EWA 4NEB 811 6130-02b
Numeric Example
464
(DW 2)
10
0
1 1 0 1 0 0 0 0
SLW 3
3712
10
0
Numeric Example
352
(IW 128)
10
0
0 1 1 0 0 0 0 0
22
10
0
Explanation
The value 464
is stored in data
10
word DW 2. Multiply this value by
3
2
=8. Do so by shifting the bit
pattern of DW 2 in ACCUM 1 three
positions to the left.
Explanation
The value 352
is stored in IW 128.
10
Shift the corresponding bit pattern
in ACCUM 1 four positions to the
right to divide the value 352
4
2
= 16.
STEP 5 Operations
by
10
8-49

Advertisement

Table of Contents
loading

Table of Contents