Skip to main content

Example - Ladder Diagram

RCL


The RCL instruction will rotate the WORD value, D, n number of bits to the left. 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, D140, is 736.



When the contact, M14.0, is powered ON (1), the WORD data register, D140, rotates 5 bits to the left.



The value of the WORD data register, D140, changes from 736 to 23,552.



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, D140, changes from 23,552 to -32,763.



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, D140.



When the instruction is reenergized, the value of the WORD data register, D140, changes from -32,763 to 184.



After rotation, no overflow occurred. The value of the carry flag bit, F11.2, is 0.

RCLP


The RCLP one-shot instruction will rotate the WORD value, D, n number of bits to the left. 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, D150, is 6,450.



When the contact, M15.0, is powered ON (1), the WORD data register, D150, rotates 4 bits to the left.



The value of the WORD data register, D150, changes from 6,450 to -27,872.



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, D150.



When the instruction is reenergized, the value of the WORD data register, D150, changes from -27,872 to 12,940.



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, D150.