The leader in industrial automation and control solutions

Instruction Parameters

Supported PLC Series

PLC-AESPLC-FBPLC-ES

Supported Data Registers

MXYKLFTCSZRQD@DConstant
D
n

Supported Flags

FlagBitSupport
ErrorF11.0
ZeroF11.1
CarryF11.2

Number of Steps

Steps
3

Operands

OperandDescription
DThe first operand.
Entries are only WORD data registers.
This is the value to rotate to the left.
The result of the rotation will be saved here.

The signed value range is -32,768 ~ 32,767 (216).
The unsigned value range is 0 ~ 65,535 (216-1).
The Hexadecimal value range is H0000 ~ HFFFF.
nThe second operand.
Entries are WORD data registers or constants.
This is the number of bits to rotate.

The value range is 0 ~ 15.
The remainder n ÷ 16 will be the result of n if the value of n is greater than 15.

Notice

Error Flag (F11.0) Notice

The error flag, F11.0, will be ON for one scan when the address of the data register assigned by @D exceeds the range of the data register, D. The range of the data register, D, is dependent on the CPU type. F11.0 turns ON when the value of the data for a rotation exceeds the data register assigned to D.

Carry Flag (F11.2) Notice

The carry flag, F11.2, will be ON for one scan when the operation result overflows.

Instruction Behavior

The RCL and RCLP instructions behave as follows:

  • The value in the data register, D, is rotated to the left.
    • The value is rotated from the most significant bit to the least significant bit.
  • The least significant bit rotates to the carry flag, F11.2.
  • The most significant bit rotates in a range of D‘s WORD value.
  • The carry flag turns ON when 1 is rotated into the carry flag, F11.2.
  • When the instruction energizes, data stored in the carry flag, F11.2, is included in the rotation.
    • IMG images/01-rcl-notice-example-b.webp – n should be a value from 0 ~ 15. Notice
  • n should be a value from 0 ~ 15.
    • If n is greater than 15, the remainder from n ÷ 16 is the equivalent.
      • Example: if n = 18, the remainder is 2.
        • This is the same as n = 2.

Ladder Diagram Examples

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 re

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.

The initial value of the WORD data register, D140, is 736.

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.

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.

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.

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.

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

*After rotation, overflow occurred.

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.

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.

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 WO

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.

The initial value of the WORD data register, D150, is 6,450.

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.

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.

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

*After rotation, overflow occurred.

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.

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

*After rotation, overflow occurred.

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.