V and Z hold an offset that is added to a device number: writing D100Z0 accesses the register whose number is D100 plus the value in Z0. That lets one instruction walk across an entire block of data, which is a great convenience for recipe switching, moving multi-axis parameters and table lookups. On the FX series there are normally eight of each, V0 to V7 and Z0 to Z7, all 16-bit, and they are used in pairs for 32-bit operations.
An index register does not alter data, it alters the number of the device being accessed. If Z0 in MOV K10 D0Z0 holds 5, the value is written to D5, not to some bit of D0. Every change in the index value therefore points the same line of program at a different device. Numeric constants K and H cannot be indexed, and the constant part of an instruction is never shifted. Once this is clear, the classic symptom of a wrong index — an action appearing on the wrong station — explains itself.
X inputs are numbered in octal, while Y, M, S, T, C and D are numbered in decimal; indexing a T or C shifts its own device number, with the contact and the time base following along, rather than shifting its present value. Digit-designated bit groups such as K1X0 and K4Y0 can be indexed too, and it is the head number that moves. The result must land inside the valid range of that device; when it does not, behaviour is model dependent — an operation-error flag may be set, or invalid data may be read — so work out the upper and lower limits first.
A 16-bit instruction uses one index register, but a 32-bit instruction such as DMOV or DADD treats V and Z together as a 32-bit pair. Which of the two holds the high word, and how the numbers correspond, is not written identically in every manual, so check the manual for the model at hand rather than relying on memory. Once the pair is in use for a 32-bit value, neither half can be used independently for 16-bit indexing without the two pieces of logic interfering with each other.
The legal range of the index value is set by the device being indexed: D can run from 0 up to the highest D number of that model, and the same applies to M and Y. Loops, accumulators and table scans must clamp the index between an upper and a lower limit with comparison instructions, or wrap it with modulo arithmetic, so that an overflow cannot escape into the neighbouring area. An index register is not reset when a program block ends, so a value left behind by earlier logic is carried forward; clear it when it is no longer needed, or write an explicit preset before use.
Recipe switching is the most common one: multiply the recipe number by the words per recipe, put the result in Z, and a single MOV picks up the first register of that recipe group, so changing recipes means changing one number. The second is table lookup: put the lookup value in Z and read the matching entry straight out of the table, far shorter than a chain of comparisons. The third is moving multi-axis parameters: put the axis number in Z, align the parameter blocks to a fixed length, and one BMOV transfers a whole set into the positioning module.
| Device | Example | What is actually accessed | Number base and rule | Typical use |
|---|---|---|---|---|
| D data register | D100Z0 | The register numbered 100 plus Z0 | Decimal, must not pass the last number | Recipe switching, table lookup |
| M internal relay | M50Z0 | The bit numbered 50 plus Z0 | Decimal | Addressing status bits by number |
| Y output | Y10Z0 | The output after a decimal offset | Decimal; note that X is octal | Selecting station outputs |
| X input | X0Z0 | The input after an octal offset | Octal, counted in points | Scanning inputs across stations |
| T timer | T0Z0 | The timer at the shifted number | Contact and time base shift together | Batch timer parameters |
| C counter | C0Z0 | The counter at the shifted number | Keep 16-bit and 32-bit numbering apart | Multiple counting channels |
| Digit bit group | K4Y0Z0 | A 16-bit group from the shifted head | The offset moves the head number | Digit display, output word |
| Constants K and H | Not indexable | Cannot be offset | The constant part is fixed | Route through a data register |
| 32-bit pair | DMOV D0Z0 D100 | Two words accessed with a 32-bit offset | V and Z paired; check the manual for order | 32-bit counts and position values |
| Positioning module buffer | TO with an index | Data taken from the shifted block | The offset must stay inside the parameter table | Moving multi-axis parameters |
Indexing pays off when the same sequence of actions has to be repeated over many data sets. Once the data is arranged as equal-length, consecutive blocks with aligned heads, one indexed instruction replaces dozens of copied rungs. The price is readability: the specific device number is not visible on screen, and to find out where a line currently points you have to read the index value in monitor mode. If the table structure ever changes, every program block that depends on the offset has to change with it, so write the block length and head as constants or in the comments.
The number, width and combination rules of index registers with instruction operands form part of the programming system definition; see GB/T 15969.3 and IEC 61131-3 on directly represented variables and indirect addressing, with the exact device ranges as given in the Mitsubishi programming manual for the model concerned. Device numbering and graphical symbols follow GB/T 4728. Connection, protection and earthing of the PLC and its circuits follow GB 5226.1 and IEC 60204-1; general equipment requirements are given in GB/T 15969.2.
Any index that can influence an output, a position or a safety action must be range-checked before use, and on an out-of-range value the fault bit should be set and the related action stopped. When commissioning indexed logic, first run it with a fixed offset to confirm the pointers, then let the loop run free. Record the table head, length and step in both the program comments and the drawings so that someone changing the table later does not forget to change the offset.