Mitsubishi Electronics E60 Video Game Controller User Manual


 
OUT C
- 57 -
Program example
(1) Program to turn Y30 ON when X0 turns ON ten times, and to turn Y30 OFF when X1 turns ON.
Coding
No. of
steps
Com-
mand
Device
10 LD X0
11 OUT C10 K10
14 LD C10
15 OUT Y30
16 LD X1
C10
Y30
X0
C10 K10
10
14
16
X1
RST C10
17 RST C10
19
(2) Program to set C10 setting value to 10 when X0 turns ON, and to 20 when X1 turns ON.
X3
C10 D0
X0
10
14
Y30
C10
18
MOV K10
D0
X1
MOV
K20 D0
22
10 is stored in D0 when X0 turns ON.
C10 counts the data stored in D0 as the setting value.
Y30 turns ON when C10 counts up.
20 is stored in D0 when X1 turns ON.
Coding
No. of
steps
Com-
mand
Device
10 LD X0
11 MOV K10 D0
14 LD X1
15 MOV K20 D0
18 LD X3
19 OUT C10 D0
22 LD C10
23 OUT Y30
24