beautypg.com

Sample program, 2 instructions, To-16 bit conversion – Omron SYSMAC CP CP1E-N@@D@-@ User Manual

Page 230: To-256 bit conversion

background image

2 Instructions

2-194

CP1E CPU Unit Instructions Reference Manual(W483)

Sample program

4-to-16 bit Conversion

When CIO 0.00 is ON in the following example, MLPX(076) will convert 3 digits in S beginning with digit
1 (the second digit), as indicated by C (#0021). The corresponding bits in D100, D101, and D102 will be
turned ON.

8-to-256 bit Conversion

When CIO 0.00 is ON in the following example, MLPX(076) will convert the 2 bytes in S beginning with
byte 1 (the leftmost byte), as indicated by C (#1011). The corresponding bits in D100 to D115 and D116
to D131 will be turned ON.

1

1

1

MLPX

100

#0021

D100

0.00

S

C

R

0

1

2

3

4

5

6

7

8

9

15 14 13 12 11

0

3

4

7

8

15

12 11

10

0

1

2

3

6

A

F

1

2

0

0

C: #

S: 100

Digits

R: D100

D101

D102

Bits 0 to 3: Starting digit (Digit 1)
Bits 4 to 7: Number of digits (3 digits)

Digit 1 contains 6, so bit 6 is turned ON.

Digit 2 contains A, so bit 10 is turned ON.

Digit 3 contains F, so bit 15 is turned ON.

Byte 1 contains 2D, so bit 13 (D)
of R+2 is turned ON.

Byte 0 contains 1A, so bit 10 (A)
of R+1 is turned ON.

Bits 0 to 3: Starting byte (Byte 1)

Bits 4 to 7: Number of bytes (2 bytes)

MLPX

100

#1011

D100

0.00

S

C

R

1

R: D100

D101

D102

D103

D115

D116

D117

D118

D131

0

1

2

3

4

5

6

7

8

9

15 14 13 12 11

0

3

4

7

8

15

12 11

10

S: 100

Byte 0

Byte 1

A

1

D

2

C: #

1

1

0

1

1

This manual is related to the following products: