
16-12
Ladder Logic (LAD) for S7-300 and S7-400
C79000-G7076-C504-02
1 0 1
31... ...16 15... ...0
1 0 1 0
1 0 1 0 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 1 0 1 0 1 0 1
1 1 1 0
1 0 1 1 0 1 0 1 0 1 0 0 0 0 0 1 1 1 1 0 0 0 0 1 1 0 1 0
3 places
The signal state of the last bit shifted
is also stored in bit CC 1 (same as
the signal state of ENO).
The signal states of
the three bits that are
shifted out are inserted
in the vacated places.
IN
N
OUT
Parameters:
Figure 16-11 Rotating Bits of Input IN Three Bits to the Right
Table 16-8 Rotate Right Double Word Box and Parameters
LAD Box
Parameter Data Type Memory Area Description
EN BOOL I, Q, M, D, L Enable input
ROR_DW
ENO BOOL I, Q, M, D, L Enable output
EN
ENO
IN DWORD I, Q, M, D, L Value to rotate
IN
N
OUT
N WORD I, Q, M, D, L
Number of bit positions by which to
rotate
OUT DWORD I, Q, M, D, L Result of rotate operation
Status Word Bits
BR CC 1 CC 0 OV OS OR STA RLO FC
Write x x x x – x x x 1
I 0.0
A signal state of 1 at input I 0.0 activates the
instruction.
Memory double word MD0 is rotated to the right
by the number of bits specified in memory word
MW4.
The result is put into memory double word
MD10. If the signal state of the bit shifted last
was 1, output Q 4.0 is set.
Q 4.0
ROR_DW
N
OUT
MW4
IN
Function is executed (EN = 1):
MD10
MD0
S
ENOEN
Figure 16-12 Rotate Right Double Word
Shift and Rotate Instructions
Kommentare zu diesen Handbüchern