Specifying indexed addresses -20, Specifying indexed addresses – Rockwell Automation 1785-Lxxx Enhanced and Ethernet PLC-5 Programmable Controllers User Manual
Page 64

Publication 1785-UM012D-EN-P - July 2005
4-20 Addressing I/O and Controller Memory
Specifying Indexed Addresses
The controller starts operation at the base address plus the offset. Store the
offset value in the offset word in the controller’s status file. You can
manipulate the offset word in your ladder logic.
The indexed address symbol is the
#
character. Place the
#
character
immediately before the file-type identifier in a logical address. Enter the offset
value in the status file S:24. All indexed instructions use S:24 to store an offset.
When you specify indexed addresses, follow these guidelines:
•
Make sure the index value (positive or negative) does not cause the
indexed address to exceed the file-type boundary.
•
When an instruction uses more than two indexed addresses, the
controller uses the same index value for each indexed address.
•
Set the offset word to the index value you want immediately before
enabling an instruction that uses an indexed address.
The following MVM example uses an indexed address in the source and
destination addresses. If the offset value is 10 (stored in S:24), the controller
manipulates the data stored at the base address plus the offset.
ATTENTION
The controller does not check indexed addresses to make
sure that the addresses do not cross data-table file
boundaries (e.g., N7 to F8). You could even modify the
status file, which is physically the last data table file. But if
the indexed address exceeds the data-table area of memory,
the controller initiates a run-time error and sets a major
fault.
ATTENTION
Instructions with a # sign in an address manipulate the
offset value stored at S:24. Make sure you monitor or load
the offset value you want prior to using an indexed address.
Otherwise unpredictable machine operation could occur
with possible damage to equipment and/or injury to
personnel.
Value
Base Address
Offset Address
Source
N7:10
N7:20
Destination N11:5
N11:15
MVM
MASKED MOVE
Source
Mask
#N7:10
00110011
Destination
#N11:5