Specifying Address Offsets; Overview - Omron CJ2 CPU UNIT SOFTWARE User Manual

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

Advertisement

5-8

Specifying Address Offsets

5-8-1

Overview

When an address is specified in an instruction operand, it is possible to change the specified address
by specifying an offset for in brackets after the specified address.
When the start address is
D0.0 and W0 is &2, 2 is
added, resulting in D0.2.
An offset of 4 is added to
the start address of 10.0,
resulting in 10.4.
Bit Addresses
The bit address is offset by the amount specified by n (number of bits) from A (start bit address).
A[n]
Offset (number of bits)
Start bit address
Bit
15
Word
Start Bit Address
It is possible to specify the start bit address with a bit 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 bit 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 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 by using input comparison or other instruction.
If the number of offset bits exceeds the memory area of the start bit address, the final bit 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 Mem-
ory Addresses.
CJ2 CPU Unit Software User's Manual
Examples of Specifying
Bit Address Offsets
Offset (number of bits): n
14
13
12 11 10 9
8
7
6
5 Understanding Programming
When the start address is
D100 and W1 is &3, 3 is
added, resulting in D103.
An offset of 12 is added
to start address of D100,
resulting in D112.
5
4
3
2
1
0
Start bit address: A
Examples of Specifying
Word Address Offsets
5
5-95

Advertisement

Table of Contents
loading

Table of Contents