Omron C20K Video Game Controller User Manual


 
85
In the following example, 0500 would be turned ON 5.0 seconds after 0000
goes ON and then turned OFF 3.0 seconds after 0000 goes OFF. It is neces-
sary to use both 0500 and 0000 to determine the execution condition for TIM
02; 0000 in an normally closed condition is necessary to reset TIM 02 when
0000 goes ON and 0500 is necessary to activate TIM 02 when 0000 goes
OFF, setting 0500 by resetting TIM 01.
0000
0500 0000
TIM 01
TIM 02
0000
0500
5.0 s
3.0 s
Address Instruction Operands
0000 LD 0000
0001 TIM 01
# 0050
0002 LD 0500
0003 AND NOT 0000
0004 TIM 02
# 0030
0005 LD TIM 01
0006 LD TIM 02
0007 KEEP(11) 0500
TIM 01
#0050
TIM 02
#0030
S
R
KEEP(11)
0500
5.0 s
3.0 s
The length of time that a bit is kept ON or OFF can be controlled by combin-
ing TIM with OUT or OUT NOT. The following diagram demonstrates how
this is possible. In this example, 0204 would remain ON for 1.5 seconds after
0000 goes ON regardless of the time 0000 stays ON. This is achieved by
using 1000, activated by 0000, to turn ON 0204. When TIM 01 comes ON
(i.e., when the SV of TIM 01 has expired), 0204 will be turned OFF through
TIM 01 (i.e., TIM 01 will turn ON for an normally closed condition, creating an
OFF execution condition for OUT 0204). TIM 01 will also turn OFF 1000 the
next cycle, resetting the one-shot.
0000
TIM 01
1000
1000
1000 TIM 01
1000
0204
0000
0204
1.5 s
1.5 s
Address Instruction Operands
0000 LD 1000
0001 AND NOT TIM 01
0002 OR 0000
0003 OUT 1000
0004 LD 1000
0005 TIM 01
# 0015
0006 LD 1000
0007 AND NOT TIM 01
0008 OUT 0204
TIM 01
#0015
1.5 s
Example 4:
One-shot Bits
Timer and Counter Instructions Section 5-11