243
CHAPTER 5 DEVICES
5
5.2 Internal User Devices
5.2.10 Timer (T, ST)
(g) When using multiple timers
When using multiple timers, provide the timers from the last one to be measured because current value of the
timers are updated upon execution of OUT T or OUT ST instruction.
Creating an on/off ladder using two timers
Ex.
Ex.
Measures for one second after T0 is turned on.
Coil of T1 is turned on for one scan after T0 is turned on.
Measures for one second when T1 is off.
Alternates on and off once every second.
[Correct program example]
Coil of T0
OUT T1
OFF
OFF
00 0 1
1s
1s
910 100
00 0 1 9 10 10 0
OFF
OFF
ON
ON
OFF
ON
OFF
OFF
OFF
ON
OUT T0
END processing
OUT T1
OUT T0
END processing
OUT T1
OUT T0
END
processing
OUT T1
OUT T0
END processing
OUT T1
OUT T0
END processing
OUT T1
OUT T0
END
processing
OUT T1
OUT T0
END processing
Contact
of T0
Current
value of T0
Coil of T1
Contact
of T1
Current
value of T1
Coil of T1 is turned on for one scan after T0 is turned on.
Measures for 1 second when T1 is off.
Measures for 1 second after T0 is turned on.
Alternates on and off every second.
[Incorrect program example]
Coil of T0
OUT T0
OFF
OFF
00 0 1
1s
900ms
910 100
01 1 2 9 10 10 0
OFF
OFF
ON
ON
OFF
ON
OFF
OFF
OFF
ON
OUT T1
END processing
OUT T0
OUT T1
END processing
OUT T0
OUT T1
END processing
OUT T0
OUT T1
END processing
OUT T0
OUT T1
END
processing
OUT T0
OUT T1
END processing
Contact
of T0
Current
value of T0
Coil of T1
Because current value is updated in a scan where T0 is timed out,
the count starts from 1 or larger value.
Contact
of T1
Current
value of T1