8 data operations, 1 bit right shift (sfr), 1) overview – Yaskawa MP2000 Series: User's Manual for Motion Programming User Manual

Page 237: 2) format, 3) programming examples, 2) format (3) programming examples

Advertising
background image

8 Command Reference

8.8.1 Bit Right Shift (SFR)

8-130

8.8 Data Operations

This section describes the data operation commands that are used to shift, transfer, and initialize data.

8.8.1 Bit Right Shift (SFR)

(1) Overview

The SFR command shifts a bit string designated by the leading bit number and bit width the specified number of
shifts to the right.

(2) Format

(3) Programming Examples

SFR command programming examples are shown below.

Example: Five bits with MB001005 (bit 5 of MW00100) as the leading bit are shifted three bits to the right.

With the SFR command, if the number of shifts is greater than the bit width, all data with the specified bit width will be set
to 0.

Motion Programs

Sequence Programs

Applicable

Applicable

SFR MB001000 N5 W10 ;

A B C

Item

Description

Usable Registers

A

Leading bit

• All bit type registers (Excluding # and C registers)
• The above registers with subscript
• Subscript registers

B

Number of bits

to be shifted

• All integer type registers (Excluding # and C registers)
• The above registers with subscript
• Subscript registers
• Constants

C

Bit width

Type

Motion Programs/

Sequence Programs

Ladder Programs

B

W

SFR MB001000 N5 W10;

L

F

EXAMPLE

SFR MB001005 N3 W5 ;

9

5

0

0 entered.

1 1 1 1 1

0 0 0 1 1

Before

execution

MW00100

MW00100

INFO

Advertising