Omron CJ2 CPU UNIT SOFTWARE User Manual page 188

Cj2 cpu unit software
Hide thumbs Also See for CJ2 CPU UNIT SOFTWARE:
Table of Contents

Advertisement

5 Understanding Programming
Examples:
10.0[2]
Start bit address
(bit address in I/O memory)
[W0]
10.0
Start bit address
(bit address in I/O memory)
Word Addresses
The word address is offset by the amount specified by n (number of offset words) from A (start word
address).
A[n]
Start word address A
Number of offset words
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.
Examples:
D0[2]
D0[
W0
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.
5-96
10.02
Offset (decimal value)
10.02
Offset when W0 = &2
(word address in I/O memory)
Bit
15
Word
+n
D2
Offset (decimal value)
Start word address
(word address in I/O memory)
]
D2
Offset; W0 = &2 (word address in I/O
memory)
Start word address
! Caution
a[2]
10.02
Offset (decimal value)
Start bit address; symbol a = 10.0 (bit
symbol named a)
a[b]
10.02
Offset; symbol b = &2
Start bit address; symbol a = 10.0
14
13
12
11
10
9
8
7
6
D2
a[2]
Offset (decimal value)
Start word address; symbol a (one-word
symbol) = D0
a[b]
D2
Offset; variable b (one-word symbol) = &2
Start word address; symbol a (one-word symbol) = D0
5
4
3
2
1
0
CJ2 CPU Unit Software User's Manual

Advertisement

Table of Contents
loading

Table of Contents