142
The first MOV(030) instruction moves the PC memory address of the PV for tim-
er T0000 ($1000) to IR0. The first MOVR(036) instruction moves the PC
memory address of the Completion Flag for timer T0000 to IR1, and the second
one moves the starting address into IR2. The second MOV(030) instruction
moves the address (00100) of the DM word that contains the SV for timer T0000
to D00000. A50013 is an Always ON Flag.
JME(005) and JMP(004) form a loop in which the content of IR0, IR1, and
D00000 are incremented by one each time the program executes the loop,
successively defining and starting the 100 timers T0000 through T0199. The
loop continues until the content of D00000 is 0200, i.e., until all 100 timers have
been defined and started. A50006 is the Equals Flag.
The subroutine above is equivalent to the 400 instructions below.
00000 LD NOT 200000
00001 TIM 0000
D00100
00002 LD T0000
00003 OUT 200000
00004 LD NOT 200001
00005 TIM 0001
D00101
00006 LD T0001
00007 OUT 200001
00008 LD NOT 200002
00009 TIM 0002
D00102
00010 LD T0002
00011 OUT 200002
00396 LD NOT 200602
00397 TIM 0099
D00199
00398 LD T0000
00399 OUT 200602
InstructionAddress Operands
2000
2000
2000
2006
TIM 0000 D00100
TIM 0001 D00101
TIM 0002 D00102
TIM 0099 D00199
2000
T0000 00
2000
T0001 01
2000
T0000 02
2006
T0099 02
00
01
02
02
5-13-1 TIMER: TIM
TIM N S
S: Set value CIO, G, A, T, C, #, DM, DR, IR
*Refer to page 141 for details on indirectly addressing timers.
N: Timer number #
Operand Data AreasLadder Symbol
Description A timer is activated when its execution condition goes ON and is reset (to SV)
when the execution condition goes OFF. Once activated, TIM measures in units
of 0.1 second from the SV. TIM accuracy is +0.0/–0.1 second.
The timer PV is updated when the TIM instruction is executed, during cyclic re-
freshing, or interrupt refreshing (when the cycle time exceeds 80 ms). Refer to
6-2 Cycle Time
for details.
If the execution condition remains ON long enough for TIM to time down to zero,
the Completion Flag for the timer number used will turn ON and will remain ON
until TIM is reset (i.e., until its execution condition goes OFF or CNR(236) is
executed).
Timer and Counter Instructions Section 5-13