Omron SYSMAC CP Series Instruction & Reference Manual page 235

Cpu unit
Hide thumbs Also See for SYSMAC CP Series:
Table of Contents

Advertisement

Sample program
16-to-4 bit Conversion
When CIO 0.00 is ON in the following example, DMPX(077) will find the leftmost ON bits in CIO 100,
CIO 101, and CIO 102 and write those locations to 3 digits in R beginning with digit 1 (the second digit),
as indicated by C (#0021).
0.00
DMPX
S
100
R
D100
C
#0021
Example of multi-digit decoding
• Example of 16-to-4 bit decoding
C: #0011
15
S
S+1
15
12
11
8
Digit 3
Digit 2
R
C: #0032
15
S
S+1
S+2
S+3
15
12
11
8
Digit 3
Digit 2
R
CP1E CPU Unit Instructions Reference Manual(W483)
15
C: #
DMPX(077) finds the
leftmost ON bits.
15 14 13 12 11 10
S: 100
101
102
Digits
15
R: D100
0
15
S
S+1
S+2
S+3
7
4
3
0
Digit 1
Digit 0
15
12
Digit 3
R
0
7
4
3
0
Digit 1
Digit 0
12 11
8
7
4
3
0
0
2
1
9
8
7
6
5
4
3
2
1
1
1
1
3
2
1
0
12 11
8
7
4
3
2
A
5
C: #0030
0
11
8
7
4
3
0
Digit 2
Digit 1
Digit 0
2 Instructions
0
0
Starting digit
(Digit 1)
0
C: #0013
15
S
S+1
15
12
11
8
7
4
3
R
Digit 3
Digit 2
Digit 1
Digit 0
2
0
0
2-199

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents