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 #179 background imageLoading...
Page #179 background image
5-87
5 Understanding Programming
CJ2 CPU Unit Software User’s Manual
5-7 Index Registers
5
5-7-2 Using Index Registers
• Instructions for Direct Addressing of Index Registers:
BINARY ADD (+L), BINARY SUBTRACT (−L), DOUBLE INCREMENT BINARY (++L),
DOUBLE DECREMENT BINARY (−−L)
The example given above shows how an Index Register in a program loop can replace a long series of
instructions. In this case, instruction A is repeated n+1 times to perform some operation such as read-
ing and comparing a table of values.
Precautions for Correct UsePrecautions for Correct Use
The following instructions are executed even when the input conditions are OFF. 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 regard-
less of the input condition (increases or decreases one every cycle). This must be considered when
writing a program.
The following ladder programming examples show how the index registers are treated.
Example 1
Ladder Program:
LD P_Off
OUT, IR0+
Operation: When the PLC memory address CIO 0.13 is stored in IR0.
Classification Instructions
Sequence input instructions LD, LD NOT, AND, AND NOT, OR, OR NOT, LD TST(350), LD
TSTN(351), AND TST(350), AND TSTN(351), OR TST(350), OR
TSTN(351)
Sequence output instructions OUT, OUT NOT, DIFU(013), DIFD(014)
Sequence control instructions JMP(004), FOR(512)
Timer and counter instructions TIM/TIMX(550), TIMH(015)/TIMHX(551), TMHH(540)/TMHHX(552),
TIMU(541)/TIMUX(556), TMUH(544)/TMUHX(557),
TTIM(087)/TTIMX(555), TIML(542)/TIMLX(553),
MTIM(533)/MTIMX(554), CNT/CNTX(546), CNTR(012)/CNTRX(548)
Comparison instructions Symbol comparison instructions (LD, AND, OR =, etc.(function codes:
300, 305, 310, 320, and 325))
Single-precision floating-point math
instructions
Single-precision floating-point data comparison (LD, AND, OR = F,
etc.(function codes: 329 to 334))
Double-precision floating-point math
instructions
Double-precision floating-point data comparison (LD, AND, OR = D,
etc.(function codes: 335 to 340))
Block programming instructions BPPS(811), BPRS(812), EXIT(806), EXIT(806) NOT, IF(802), IF(802)
NOT, WAIT(805), WAIT(805) NOT, TIMW(813)/TIMWX(816),
CNTW(814)/CNTWX(818), TMHW(815)/TMHWX(817), LEND(810),
LEND(810) NOT
Text string processing instructions STRING COMPARISON (LD, AND, OR = $, etc. (function codes: 670
to 675))
Instruction A m
Instruction A m+1
Instruction A m+n
MOVR(560) m IR0
Instruction A ,IR0+
Stores the PLC memory
address of m in IR0.
Repeats the process
in a loop such as
FOR-NEXT.
Example:

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