Example - Ladder Diagram
DRCL
The DRCL instruction will rotate the DWORD value, D, n number of bits to the left. The result of the rotation is saved in the same assigned DWORD data register, D.
The carry flag, F11.2, can be used.
Ladder Diagram Example
The initial value of the DWORD data register, D160, is -1,926,970,832.
![]()
When the contact, M16.0, is powered ON (1), the DWORD data register, D160, rotates 3 bits to the left.
The value of the DWORD data register, D160, changes from -1,926,970,832 to 1,764,102,530.
![]()
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 DWORD data register, D160, changes from 1,764,102,530 to 1,227,918,353.
![]()
After rotation, overflow occurred.
The value of the carry flag bit, F11.2, is 1, which is part of the data from the DWORD data register, D160.
DRCLP
The DRCLP one-shot instruction will rotate the DWORD value, D, n number of bits to the left. The result of the rotation is saved in the same assigned DWORD 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 DWORD data register, D170, is -500.
![]()
When the contact, M17.0, is powered ON (1), the DWORD data register, D170, rotates 2 bits to the left.
The value of the DWORD data register, D170, changes from -500 to -1,997.
![]()
After rotation, overflow occurred.
The value of the carry flag bit, F11.2, is 1, which is part of the data from the DWORD data register, D170.