Siemens NAN 67 Series Wartungshandbuch Seite 214

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 318
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 213
16-10
Ladder Logic (LAD) for S7-300 and S7-400
C79000-G7076-C504-02
16.2 Rotate Instructions
You can use the Rotate instructions to rotate the entire contents of input IN
bit by bit to the left or to the right. The vacated bit places are filled with the
signal states of the bits that are shifted out of input IN.
The number that you supply for input parameter N specifies the number of
bits by which to rotate.
Depending on the instruction, rotation takes place via the CC 1 bit of the
status word (see Section 6.3). The CC 0 bit of the status word is reset to 0.
The following Rotate instructions are available:
S Rotate Left Double Word
S Rotate Right Double Word
A signal state of 1 at the Enable (EN) input activates the Rotate Left Double
Word instruction. This instruction rotates the entire contents of input IN bit
by bit to the left. Input N specifies the number of bits by which to rotate. If N
is larger than 32, the double word is rotated ((N–1) modulo 32) +1) places.
The bit positions at the right are filled with the signal states of the bits
rotated. The result of the rotate operation can be scanned at output OUT.
The operation triggered by this instruction always resets the CC 0 and OV
bits of the status word to 0. If the box is executed (EN = 1), ENO shows the
signal state of the bit shifted last (same as CC 1 and RLO in the status word,
see Figure 16-9). The result is that other functions following this box that are
connected by the ENO (cascade arrangement) are not executed if the bit
shifted last had a signal state of 0.
Certain restrictions apply to the placement of the Rotate Left Double Word
box (see Section 6.1).
1 1 1
31... ...16 15... ...0
1 1 1 1 0 0 0 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 1 1
1 0 0 0 0 1 0 1 0 1 0 1 0 0 0 0 0 1 1 1 1 0 0 0 1 1 1 1
3 places
The signal states of the three
bits that are shifted out are
inserted in the vacated places.
The signal state of the last
bit shifted is also stored in
bit CC 1 (same as the signal
state of ENO).
IN
N
OUT
Parameters:
Figure 16-9 Rotating Bits of Input IN Three Bits to the Left
Description
Rotate Left Double
Word
Shift and Rotate Instructions
Seitenansicht 213
1 2 ... 209 210 211 212 213 214 215 216 217 218 219 ... 317 318

Kommentare zu diesen Handbüchern

Keine Kommentare