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 DWORD data registers.
This is the value to rotate to the right.
The result of the rotation will be saved here.

The signed value range is -2,147,483,648 ~ 2,147,483,647 (232).
The unsigned value range is 0 ~ 4,294,967,295 (232-1).
The Hexadecimal value range is H00000000 ~ HFFFFFFFF.
nThe second operand.
Entries are DWORD data registers or constants.
This is the number of bits to rotate.

The value range is 0 ~ 31.
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 DROR and DRORP instructions behave as follows:

  • The value in the data register, D, is rotated to the right.
    • 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 DWORD 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 NOT included in the rotation.
    • IMG images/01-dror-notice-example-b.webp – n should be a value from 0 ~ 31. Notice
  • n should be a value from 0 ~ 31.
    • If n is greater than 31, the remainder from n ÷ 32 is the equivalent.
      • Example: if n = 34, the remainder is 2.
        • This is the same as n = 2.

Ladder Diagram Examples

DROR

The DROR instruction will rotate the DWORD value, D, n number of bits to the right. The result of the rotation is saved in the same assigned DWORD dat

The DROR instruction will rotate the DWORD value, D, n number of bits to the right. The result of the rotation is saved in the same assigned DWORD data register, D.

The initial value of the DWORD data register, D1, is 503,513,141.

The initial value of the DWORD data register, D1, is 503,513,141.

When the contact, M2.0, is powered ON (1), the DWORD data register, D1, rotates 2 bits to the right.

When the contact, M2.0, is powered ON (1), the DWORD data register, D1, rotates 2 bits to the right.

The value of the DWORD data register, D1, changes from 503,513,141 to 1,199,620,109.

The value of the DWORD data register, D1, changes from 503,513,141 to 1,199,620,109.

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

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

When the instruction is reenergized, the value of the DWORD data register, D1, changes from 1,199,620,109 to 1,373,646,851.

When the instruction is reenergized, the value of the DWORD data register, D1, changes from 1,199,620,109 to 1,373,646,851.

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 DWORD data register, D1, changes from 1,373,646,851 to -730,330,112.

When the instruction is reenergized, the value of the DWORD data register, D1, changes from 1,373,646,851 to -730,330,112.

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

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

DRORP

The DRORP one-shot instruction will rotate the DWORD value, D, n number of bits to the right. The result of the rotation is saved in the same assigned

The DRORP one-shot instruction will rotate the DWORD value, D, n number of bits to the right. The result of the rotation is saved in the same assigned DWORD data register, D. Every time this instruction executes, it energizes the output only once.

The initial value of the DWORD data register, D3, is 65,535.

The initial value of the DWORD data register, D3, is 65,535.

When the contact, M3.0, is powered ON (1), the DWORD data register, D3, rotates 3 bits to the right.

When the contact, M3.0, is powered ON (1), the DWORD data register, D3, rotates 3 bits to the right.

The value of the DWORD data register, D3, changes from 65,535 to -536,862,721.

The value of the DWORD data register, D3, changes from 65,535 to -536,862,721.

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

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

When the instruction is reenergized, the value of the DWORD data register, D3, changes from -536,862,721 to -67,107,841.

When the instruction is reenergized, the value of the DWORD data register, D3, changes from -536,862,721 to -67,107,841.

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

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