Omron CP1E CPU UNIT SOFTWARE User Manual page 64

Cp1e cpu unit software
Table of Contents

Advertisement

4 Understanding Programming
Examples:
10.0 [2]
10.02
Offset (decimal value)
Start bit address
(bit address in I/O memory)
10.00 [W0]
10.02
Offset when W0 = &2
(word address in I/O memory)
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
Offset
Start Word Address
It is possible to specify the start word address with a word address or with a symbol (except the
NUMBER data type cannot be used).
Offsetting is possible only for addresses in the Holding, Word, and DM Areas.
The I/O comment for the start bit address is displayed.
When specifying symbols, make the symbol table setting as the array variation. The number of
arrays will be the maximum number of offset + 1 word at least.
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 or symbol is specified, the contents of the specified word is used as the offset.
If the offset exceeds bit 15 in the specified word, offsetting will continue from bit 00 in the next word.
If the offset is specified indirectly, make sure that the final bit address does not exceed the upper
limit of the memory area by using input comparison or other instruction.
Examples:
D0[2]
D2
Offset (decimal value)
Start word address
(word address in I/O memory)
D0
[W0]
D2
Offset; W0 = &2
(word address in I/O memory)
Start bit address
(bit address in I/O memory)
4-20
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
Bit 15 14 13 12 11 10 9 8 7 6 5
Word
A
+n
a [2]
D2
Offset (decimal value)
Start word address;
symbol a (one-word symbol) = D0
a [b]
D2
Offset;
symbol b(one-word symbol) = &2
Start word address;
symbol a (one-word symbol) = D0
4 3 2 1
CP1E CPU Unit Software User's Manual(W480)
0

Advertisement

Table of Contents
loading

Table of Contents