Mitsubishi MELSEC-A Series Programming Manual page 147

Type acpu/qcpu-a (a mode)
Hide thumbs Also See for MELSEC-A Series:
Table of Contents

Advertisement

6. BASIC INSTRUCTIONS
Program Examples
X008
0
=
9
X007
X007
0
X008
6
11
=
INC
Program which outputs the present value of counters C0 to C20 in BCD to Y30 to 3F
each time X8 turns on.
(When the present value < 9999)
P
Z
BCD
C0
INC
K
21
Z
RST Z
• Coding
0
LD
X008
1
BCDP
C0Z
K4Y030
6
INCP
Z
9
LD=
K21
Z
14
OR
X007
15
RST
Z
18
END
DEC
Down counter program.
P K
MOV
100
M38
P
DED
K
0
D8
• Coding
0
LD
X007
1
MOVP
K100
D8
6
LD
X008
7
ANI
M38
8
DECP
D8
11
LD=
K0
D8
16
OUT
M38
17
END
K4
The present value of C(0+Z) is output to the Y30 to 3F in BCD.
Y030
P
Z + 1 is executed
Z
Z is set to 0 when Z = 21 or by X7 (reset input).
D8
When X7 turn on, 100 is transferred to D8.
When M38 is off, D8 – 1 is executed if X8 turns from
D8
off to on.
(
M38
)
When D8 = 0, M38 turns on.
6 − 35
MELSEC-A

Advertisement

Table of Contents
loading

This manual is also suitable for:

Acpu-common-p-e13j741AcpuQcpu-a

Table of Contents