Omron CJ - INSTRUCTIONS REFERENCE MANUAL 07-2009 Reference Manual page 247

Programmable controllers
Hide thumbs Also See for CJ - INSTRUCTIONS REFERENCE MANUAL 07-2009:
Table of Contents

Advertisement

3. Instructions
Indirect Addressing of Timer/Counter Numbers
• Timer and counter numbers can be indirectly addressed using Index Registers. When Index
Registers will be used for indirect addressing, use MOVRW(561) (MOVE TIMER/COUNTER PV TO
REGISTER) to set the PLC memory address of the desired timer or counter's PV to the desired Index
Register.
• The following timers and counters can be indirectly addressed using Index Registers: TIM,
TIMX(550),
TIMW(813), TIMWX(816), TMHW(815), TMHWX(817), CNT, CNTX(546), CNTR(012), CNTRX(548),
CNTW(814), and CNTWX(818). (These are the timers and counters that use timer and counter
numbers.)
• The timer or counter instruction will not be executed if the PLC memory address in the specified
Index Register is not the address of a timer or counter PV.
• Using Index Registers to indirectly address timers and counters can reduce the size of the program
and increase flexibility. For example, common subroutines can be created.
Example :
0010
D100
...SV for TIM0000
0100
D101
...SV for TIM0001
0050
D102
...SV for TIM0002
0999
D199
...SV for TIM0099
P_On
(Always ON Flag)
,IR2
,IR1+
P_On
(Always ON Flag)
210
TIMH(015),
TIMHX(551),
MOVRW
T0000
IR0
MOVR
T0000
IR1
MOVR
2000.00
IR2
MOV
&100
D0
FOR
&100
TIM
,IR0+
@D0
,IR2+
++
D0
NEXT
TTIM(087),
TTIMX(555),
• The following example shows a program section
that uses indirect addressing to define and start
100 timers with SVs contained in D100 through
D199. IR0 contains the PLC memory address of
the timer PV and IR1 contains the PLC memory
address of the timer Completion Flag.
1
1.
MOVRW(561)
address of the PV for timer T0000 to IR0. After-
wards IR0 can be used in place of the timer
number.
2
2.
MOVR(560) moves the PLC memory address
of the Completion Flag for timer T0000 to IR1.
3.
MOVR(560) moves the PLC memory address
3
of CIO 2000.00 into IR2.
4.
MOV(021) moves &100 into D100 for indirect
addressing of the timer SVs.
5.
The content of IR0, IR1, IR2, and D0 are incre-
4
mented by 1 each time as this loop is executed
100 times, starting timers T0000 through
T0099.
The loop in the program above has 4 input parame-
ters which are used to start all 100 timers with this
common subroutine.
IR0
The PLC memory address of the timer's PV
5
IR1
The PLC memory address of the timer's
Completion Flag
IR2
The PLC memory address of the timer's exe-
cution condition
D0
The DM address of the word containing the
timer's SV
CS/CJ/NSJ Series Instructions Reference Manual (W474)
TMHH(540),
TMHHX(552),
moves
the
PLC
memory

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the CJ - INSTRUCTIONS REFERENCE MANUAL 07-2009 and is the answer not in the manual?

Questions and answers

Table of Contents