5 Understanding Programming
5-96
CJ2 CPU Unit Software User’s Manual
z Word Addresses
The word address is offset by the amount specified by n (number of offset words) from A (start word
address).
Start Word Address
It is possible to specify the start words address with a word address or with a symbol (except for
STRING or NUMBER data types). Offsetting is possible only for addresses in the H, W, DM, and EM
Areas. I/O comments indicate the I/O comments for this start word address.
Offset
The offset can be specified as a decimal constant, word address (but CIO Area addresses cannot
be specified), or one-word symbol (i.e., symbols with the following data types: INT, UINT, WORD,
CHANNEL). If a word address is specified, the contents of the specified word is used as the offset.
If the offset is specified indirectly, make sure that the final bit address does not exceed the upper
limit by using input comparison or other instruction.
If the number of offset words exceeds the memory area of the start word address, the final word
address will be in the next memory area in the order determined by the actual PLC memory
addresses. (For information on the arrangement of area in the memory map, refer to A-4 Memory
Map of PLC Memory Addresses.
! Caution
Program so that the memory area of the start address is not exceeded when a symbol or
address is used to specify the offset directly in a ladder program.
If an indirect specification causes the address to exceed the memory area of the start
address, the system will access data in the next area, and unexpected operation may occur.
10.0[2]
10.02
a[2]
10.02
10.0 10.02
a[b]
10.02
Offset (decimal value)
Examples:
[W0]
Start bit address
(bit address in I/O memory)
Start bit address
(bit address in I/O memory)
Start bit address; symbol a = 10.0 (bit
symbol named a)
Offset (decimal value)
Offset when W0 = &2
(word address in I/O memory)
Offset; symbol b = &2
Start bit address; symbol a = 10.0
Word
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+n
A[n]
Start word address A
Bit
Number of offset words
D0[2]
D2
a[2]
D2
D0[ ]
D2
a[b]
D2
Examples:
W0
Offset (decimal value)
Start word address
(word address in I/O memory)
Offset (decimal value)
Start word address; symbol a (one-word
symbol) = D0
Offset; W0 = &2 (word address in I/O
memory)
Start word address
Offset; variable b (one-word symbol) = &2
Start word address; symbol a (one-word symbol) = D0