The address does not update correctly with IR1 in a program using the index register as shown in Figure 1.

Ladder Program Operation Specifications

Before explaining the problems with the ladder program, we will explain the system operation specifications.

*When one of the pushbutton switches from 1 to 32 is pressed, the two words of input data (4-digit BCD data) will be stored in D100 to D131 as shown in the following example.

Programming: CS1/CJ1-series Programmable Controllers

Figure 1

The Problem with the Ladder Program

So what is the problem with the ladder program?

To get to the point, there is a problem in the usage of the auto increment option/,IR1+ in --[MOV 2,IR1+] on rung number 10 of the ladder program.

What is the ,IR1[]+ auto increment option?

,IR[]+: The contents of IR[] will be incremented by 1 immediately after accessing the contents of the address that IR[] points to.

The ladder program in Figure 1 works like this. Immediately after the -- [MOV 2 ,IR+1] instruction on rung 10 is executed, the address in IR[] is incremented by 1. In this program, when the --| |--,IR0+ input condition is OFF, the MOV instruction will not be executed. Therefore the auto-increment process will also not be executed. This is the reason why the address update process using IR1 does not function properly.

Note: This problem will not occur with instructions that are executed each scan regardless of the execution condition, such as with --||-- ,IR0+ or with -- (,IR[]+) OUT (which does not appear here).

Example of Program in Which the IR1 Address Is Updated Every Scan