beautypg.com

Hint, Sample program, 2 instructions – Omron SYSMAC CP CP1E-N@@D@-@ User Manual

Page 68: Seta, Rsta

background image

2 Instructions

2-32

CP1E CPU Unit Instructions Reference Manual(W483)

Hint

SETA

SETA(530) can be used to turn ON bits in data areas that are normally accessed by words only, such

as the DM areas.

RSTA

RSTA(531) can be used to turn OFF bits in data areas that are normally accessed by words only,

such as the DM areas.

Sample program

SETA

When CIO 0.00 is turned ON in the following example, the 20 bits (0014 hexadecimal) beginning
with bit 5 of CIO 100 are turned ON.

RSTA

When CIO 0.00 is turned ON in the following example, the 20 bits (0014 hexadecimal) beginning
with bit 3 of CIO 100 are turned OFF.

RSTA

RSTA(531) turns OFF N2 bits, beginning
from bit N1 of D, and continuing to the left
(more-significant bits). All other bits are
left unchanged. (No changes will be
made if N2 is set to 0.)

Bits turned OFF by RSTA(531) can be
turned ON by any other instructions, not
just SETA(530).

D

D+1

D+2

15

0

N2 bits are
reset to 0 (OFF).

N1

0

0 0

0

0

0 0

0.00

D

N1

N2

SETA

100

&5

&20

D: 100

101

15

11

12

4

7

8

3

5

0

N2: 20 bits

N1: Bit 5

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1 1

1

1

1

0.00

D

N1

N2

RSTA

100

&3

&20

D: 100

101

15

11

12

4

7

8

3

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0 0

0

0

0

N2: 20 bits

N1: Bit 3

This manual is related to the following products: