Example - Ladder Diagram
RCR
The RCR instruction will rotate the WORD value, D, n number of bits to the right. The result of the rotation is saved in the same assigned WORD data register, D.
The carry flag, F11.2, can be used.
Ladder Diagram Example
The initial value of the WORD data register, D10, is 400.
When the contact, M4.0, is powered ON (1), the WORD data register, D10, rotates 4 bits to the right.
The value of the WORD data register, D10, changes from 400 to 25.
![]()
After rotation, no overflow occurred. The value of the carry flag bit, F11.2, is 0.
When the instruction is reenergized, the value of the WORD data register, D10, changes from 25 to 8,193.
![]()
After rotation, overflow occurred.
The value of the carry flag bit, F11.2, is 1, which is part of the data from the WORD data register, D10.
When the instruction is reenergized, the value of the WORD data register, D10, changes from 8,193 to 12,800.
![]()
After rotation, no overflow occurred. The value of the carry flag bit, F11.2, is 0.
The previous value of the carry flag bit, F11.2, is rotated into the data register, D10.
RCRP
The RCRP one-shot instruction will rotate the WORD value, D, n number of bits to the right. The result of the rotation is saved in the same assigned WORD data register, D.
The carry flag, F11.2, can be used.
Every time this instruction executes, it energizes the output only once.
Ladder Diagram Example
The initial value of the WORD data register, D20, is 1,250.
When the contact, M5.0, is powered ON (1), the WORD data register, D20, rotates 5 bits to the right.
The value of the WORD data register, D10, changes from 1,250 to 8,231.
![]()
After rotation, no overflow occurred. The value of the carry flag bit, F11.2, is 0.
When the instruction is reenergized, the value of the WORD data register, D20, changes from 8,231 to 28,929.
![]()
After rotation, no overflow occurred. The value of the carry flag bit, F11.2, is 0.