3. Instructions
212
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Example 2: Two-stage Counter
When an SV higher than 9999 is required, two counters can be combined as shown in the following
example. In this case, two CNT instructions are combined to make a BCD counter with an SV of
20,000.
Example 3: ON/OFF Delay
In this example two TIM timers are combined with KEEP(011) to make an ON delay and an OFF delay.
CIO 5.00 will be turned ON 5.0 seconds after CIO 0.00 goes ON and it will be turned OFF 3.0 seconds
after CIO 0.00 goes OFF.
0.00
0.02
0.02
2.03
0.01
(100 times)
(200 times)
Instruction Operands
0.00
0.01
0.02
C0001
C0002
1
#0100
C0001
0.02
2
#0200
C0002
2.03
LD
LD
LD
AND
OR
OR
CNT
OUT
CNT
LD NOT
LD NOT
0.00
5.00
5.0 s 3.0 s
1
#0050
5.00
0.00
2
#0030
T0001
T0002
5.00
LD
LD
LD
LD
KEEP(011)
TIM
TIM
LD NOT
0.00
0.00
5.00
5.00
0.00
Instruction Operands