![Allen-Bradley 1747-PT1 Скачать руководство пользователя страница 66](http://html.mh-extra.com/html/allen-bradley/1747-pt1/1747-pt1_user-manual_2900778066.webp)
Chapter 4
Data File Organization and Addressing
4–13
An indexed address is offset from its indicated address in the data table.
Indexing of addresses applies to word addresses in bit and integer data files,
preset and accumulator words of timers and counters, and to the length and
position words of control elements. You can also index I/O addresses.
The indexed address symbol is #. When programming, place it immediately
before the file type identifier in the word address. Examples:
•
#N7:2
•
#B3:6
•
#T4:0.PRE
•
#C5:1.ACC
•
#R6:0.LEN
Offset Value (S:24 Index Register )
An indexed address in a bit or integer data file is offset from its indicated
address by the number of words you specify in word 24 of the status file.
Operation takes place at the address plus the offset number of words. If the
indexed address is word 1 or 2 of a timer, counter, or control element, the
offset value in S:24 is the offset in elements. For example, an offset value of
2 will offset #T4:0.ACC to T4:2.ACC, which is 2 elements (6 words). The
number in S:24 can be a positive or negative integer, resulting in a positive or
negative offset.
You can use more than one indexed address in your ladder program. All
indexed addresses will have the same offset, stored in word S:24. You can
manipulate the offset value in your program before each indexed address is
operated on.
Note that file instructions (SQO, COP, LFL for example) overwrite S:24
when they execute. For this reason, you must insure that the index register is
loaded with the intended value prior to the execution of an indexed
instruction that follows a file instruction.
Example
Suppose that during the operation of the ADD instruction, an offset value of
10 is stored in word S:24. The processor will take the value at N7:12
(N7:2+10) and add it to the value at N10:0. The result is placed at N11:15
(N11:5+10).
ADD
ADD
Source A
#N7:2
Source B
N10:0
Dest
#N11:5
Indexed Addressing SLC 5/02
Processors Only