Function Block Applications Guidelines
Note
MOVR(560)
IR@
Index Register
Example: Specifying +5,IR0 using
constant offset specification, not
variable name
Function block
Indirect
specifi-
Instruction
cation
+5,IR0
a
(1) When Index Registers IR0 to IR15 are used within function blocks, using
the same Index Register within other function blocks or in the program
outside of function blocks will create competition between the two in-
stances 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.
Example: Starting function block (or before using Index Register):
1. Save the value of IR (e.g., A).
Value A
Value A
IR0
Within function block:
2.Use IR.
Value B
IR0
At start of function block (or before Index Register is used):
3. Return IR to saved valuev(e.g., A)
Value A
IR0
(2) Always set the value before using Index Registers. Operation will not be
stable if Index Registers are used without the values being set.
Pointer
All I/O memory
areas
Specify address
in IR0
I/O memory
+5 offset
Specify ad-
dress at +5
IR0
offset from
IR0.
Value A
Value A
Section 2-4
47
Need help?
Do you have a question about the CX-PROGRAMMER 5.0-FUNCTION BLOCK OPERATION and is the answer not in the manual?