EasyManuals Logo

Omron CJ2 CPU UNIT SOFTWARE User Manual

Omron CJ2 CPU UNIT SOFTWARE
670 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #180 background imageLoading...
Page #180 background image
5 Understanding Programming
5-88
CJ2 CPU Unit Software User’s Manual
The input condition is OFF (P_Off is the Always OFF Flag), so the OUT instruction sets CIO 0.13,
which is indirectly addressed by IR0, to OFF. The OUT instruction is executed, so IR0 is incre-
mented. As a result, the PLC memory address CIO 0.14, which was incremented by +1 in the IR0, is
stored. Therefore, in the following cycle the OUT instruction turns OFF CIO 0.14.
Example 2
Ladder Program:
LD P_Off
SET, IR0+
Operation: When the PLC memory address CIO 0.13 is stored in IR0.
The input condition is OFF (P_Off is the Always OFF Flag), so the SET instruction is not executed.
Therefore, IR0 is not incremented and the value stored in IR0 remains PLC memory address CIO
0.13.
Precautions for Correct UsePrecautions 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.
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).
Value A
Value 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).
Value A
Value A
Value B
Symbol for saving] [MOVL IR0
Symbol for saving IR0] [MOVL

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Omron CJ2 CPU UNIT SOFTWARE and is the answer not in the manual?

Omron CJ2 CPU UNIT SOFTWARE Specifications

General IconGeneral
BrandOmron
ModelCJ2 CPU UNIT SOFTWARE
CategorySoftware
LanguageEnglish

Related product manuals