xLadder user manual-V2.0.0.6

6.13.3 SHR - DW & SHL - DW

Input/output Operand

Data type

IN

VD, ID, QD, MD, SD, SMD, LD, AC, HC,constant, *VD, *LD, *AC

Double word

N

VB, IB, QB, MB, SB, SMB, LB, AC,constant, *VD, *LD, *AC

Double word

OUT

VD, ID, QD, MD, SD, SMD, LD, AC, *VD, *LD, *AC

Double word

SHR - DW: Input double word "IN" and move N bits towards

the right.Then place the results in OUT.

SHL - DW: Input double word "IN" and move N bits towards

the left.Then place the results in OUT.

The moved out bits are filled with zero.If N is greater than

or equal to 32, you can move up to 32bits.

SHR - DW & SHL - DW operations are signed. Symbol bit can

be moved.

error conditions:

0006

Indirect address

Special memory bit:

SM1.0

Zero Result

SM1.1

Overflow

Example:

When the value of M0.0 is 1,VD0 moves a bit towards the left and VD10 moves two

bits towards the right.

178

Made with FlippingBook - Online magazine maker