4 Understanding Programming
4-28
CP2E CPU Unit Software User’s Manual(W614)
The input condition is OFF (P_Off is the Always OFF Flag), so the SET instruction is not exe-
cuted. Therefore, IR0 is not incremented and the value stored in IR0 remains PLC memory
address CIO 0.1
3
.
• The following instructions are executed even when the interlock is active. Therefore, when indi-
rect memory addresses are specified using auto-incrementing or auto-decrementing (,IR+ or
,IR-) in an operand of any of these instructions, the value in the Index Register (IR) is
refreshed each cycle regardless of the input condition (increases or decreases one every
cycle). This must be considered when writing a program.
Precautions for Correct Use
Precautions for Correct Use
• When Index Registers IR0 to IR15 are used within function blocks, using the same Index Reg-
ister within other function blocks or in the program outside of function blocks will create compe-
tition between the two instances and the program will not execute properly. Therefore, when
using Index Registers (IR0 to IR15), always save the value of the Index Register at the point
when the function block starts (or before the Index Register is used), and when the function
block is completed (or after the Index Register has been used), incorporate processing in the
program to return the Index Register to the saved value.
• Always set the value before using Index Registers. Operation will not be stable if Index Regis-
ters are used without the values being set.
Precautions for Correct Use
Precautions for Correct Use
Precaution for Indirect Register Addressing with Index Registers
Do not use indirect register addressing to access areas outside of the I/O memory or areas
reserved by the system. An Illegal Access Error will occur if access is attempted.
Refer to
A-4 Memory Map of PLC Memory Addre
for details on the limits of PLC memory
addresses.
Instruction group
Instructions
Sequence output instructions
OUT, OUT NOT
Timer and counter instructions
TIM/TIMX, TIMH/TIMHX, TMHH/TMHHX, and
TIML/TIMLX
IR0
IR0
IR0
P_On
P_On
Example: Starting function block (or before using Index Register):
1.
Save the value of IR (e.g., A).
V
alue A
V
alue A
Within function block:
2.
Use IR.
At start of function block (or before Index Register is used):
3.
Return IR to saved value (e.g., A).
V
alue A
V
alue A
V
alue B
Symbol for saving]
[MO
V
L IR0
Symbol for saving IR0]
[MO
V
L
Содержание SYSMAC CP Series
Страница 1: ...USER S MANUAL Cat No W614 E1 01 SYSMAC CP Series CP2E E D CP2E S D CP2E N D CP2E CPU Unit Software ...
Страница 3: ......
Страница 32: ...1 Overview 1 4 CP2E CPU Unit Software User s Manual W614 ...
Страница 44: ...3 CPU Unit Operation 3 8 CP2E CPU Unit Software User s Manual W614 ...
Страница 116: ...6 I O Allocation 6 8 CP2E CPU Unit Software User s Manual W614 ...
Страница 144: ...7 PLC Setup 7 28 CP2E CPU Unit Software User s Manual W614 ...
Страница 170: ...10 Interrupts 10 14 CP2E CPU Unit Software User s Manual W614 ...
Страница 200: ...11 High speed Counters 11 30 CP2E CPU Unit Software User s Manual W614 ...
Страница 272: ...12 Pulse Outputs 12 72 CP2E CPU Unit Software User s Manual W614 ...
Страница 278: ...13 PWM Outputs 13 6 CP2E CPU Unit Software User s Manual W614 ...
Страница 460: ...18 Programming Device Operations 18 28 CP2E CPU Unit Software User s Manual W614 ...
Страница 576: ...Revision 2 CP2E CPU Unit Software User s Manual W614 ...
Страница 577: ......