13.07.2015 Views

CJ2 CPU Unit Software User's Manual - CIP ETI

CJ2 CPU Unit Software User's Manual - CIP ETI

CJ2 CPU Unit Software User's Manual - CIP ETI

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

6 I/O Memory Areas6-18 Index RegistersThe sixteen Index Registers (IR0 to IR15) are used for indirect addressing. Each Index Register canhold a single PLC memory address, which is the absolute memory address of a word in I/O memory.These are different from the I/O memory area addresses in the CIO Area, DM Area, etc. They are thecontinuous RAM addresses.Index Registers can be used either independently in each task or shared by all the tasks.The user cannot directly input PLC memory addresses in the Index Registers. Use MOVR(560) to converta regular data area address to its equivalent PLC memory address and write that value to the specifiedIndex Register. (Use MOVRW(561) to set the PLC memory address of a timer/counter PV in anIndex Register.)Additional InformationRefer to A-4 Memory Map of PLC Memory Addresses for more details on PLC memoryaddresses. Indirect AddressingWhen an Index Register is used as an operand with a “,” prefix, the instruction will operate on theword indicated by the PLC memory address in the Index Register, not the Index Register itself. Basically,the Index Registers are I/O memory pointers.• All addresses in I/O memory (except Index Registers, Data Registers, and Condition Flags) canbe specified seamlessly with PLC memory addresses. It isn’t necessary to specify the data area.• In addition to basic indirect addressing, the PLC memory address in an Index Register can be offsetwith a constant or Data Register, auto-incremented, or auto-decremented. These functionscan be used in loops to read or write data while incrementing or decrementing the address by oneeach time that the instruction is executed.With the offset and increment/decrement variations, the Index Registers can be set to base valueswith MOVR(560) or MOVRW(561) and then modified as pointers with each instruction execution.For pointer operation, either special instructions that can directly specify Index Registers(MOVR(560), MOVRW(561), increment instructions, decrement instructions, or math instructions)are used, or indirect offsets, auto-incrementing, or auto-decremented is used.66-18 Index RegistersI/O MemorySet to a base valuewith MOVR(560) orMOVRW(561).PointerYou can set the PLC to use index registers independently in each task or to share them between alltasks.Index registers are cleared at the following times:• When the operating mode is changed between PROGRAM or MONITOR mode and RUN mode• When the power supply to the PLC is turned ON• When a fatal error occurs (except for fatal errors created with FALS(007)<strong>CJ2</strong> <strong>CPU</strong> <strong>Unit</strong> <strong>Software</strong> User’s <strong>Manual</strong>6-35

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!