Indexed adressing mode

The former one with the # indicates indexed addressing. Without seeing the whole instruction that contains it, I can't tell much more than that.

Also, please specify the processor you're working with. I think there are variations in some of the details of how indexed addressing is handled among ab processors.
 
basic idea: in Allen-Bradley PLC/SLC addresses, the “#” (pound sign) character means that we’re talking about a “file” ... it helps for beginners to interpret the “#” as meaning “start here” ...



and so ... the address that you gave basically means “start here at N10:14 - and continue on from there” ... how far do we continue? ... that depends on the “Length” parameter that gets entered into the instruction ...



going further: slightly beyond beginner level, we could say that the “#” character represents “indexed addressing” ... (not to be confused with “indirect addressing - which uses the “[]” characters) ... and “indexed addressing” makes use of the “offset” value which is contained in location S:24 ... and so ... suppose that the value of S:24 just happens to be “3” ... in that case, the address that you gave would be interpreted as N10:17 ... specifically, the “base” address is N10:14 ... and 14 (the base) plus 3 (the offset) equals 17 ...



in practice, when an instruction uses “indexed addressing” it automatically manipulates/changes the value stored in S:24 ... but it changes the value so quickly that you won’t be able to see the number incrementing on the screen ...



is that enough information to get you going? ...



secret handshake: “#” means “start here” ...
 
Last edited:
An address like N7:5 is a fixed address and it refers to only one spot. Like a house address such as 1755 Maple Lane.



An address like N7:[N7:0] is an indirect address and it relates to the file boundaries. N7:0 is 5 then it would be like the fifth house from the end of Maple Lane.



An address like #N7:5 (indexed address) is an address related to another address. If S:24 is 1 then it would be like the house right after 1755 Maple Lane, or if it’s a -1 it would be the house right before 1755 Maple lane.
 
Just a little addition to what Ron said.

Indexed addressing is valid in most (if not all) instructions. Like Ron said, there are several 'file' oriented instructions that modify the value of S:24 on their own. The COP (copy) instruction is one of them.

However, a standard move instruction (MOV) will accept indexed addresses also. However, the MOV instruction does not babysit S:24 on it's own. The programmer needs to do this.

The moral of the story is, be careful using indexed addressing in non-file oriented instructions as S:24 can be changed without your knowledge in other parts of the program.

Keith
 
Follow up question ...

I've noticed that RSLogix will display the # for you in some instructions.

Is that an accurate indication that you don't have to manipulate the S:24 register externally? I mean is RSLogix accurate in that respect, only displaying the # by default when "it's already taken care of" and can I trust that when I program?

BTW those three explanations of indexed and indirect addressing together are the best I've ever read. Good teamwork.
 

Similar Topics

Could someone shed a little more light on the subject of indexed or indirect addressing? If I wanted to utilise the above method to enable recipe...
Replies
5
Views
4,580
The System I am currently working on has a AB SLC 504. It also has a 4 station index dial. Each tooling nest has 2 sensors mounted in it they are...
Replies
9
Views
4,915
I have upgraded an old RS500 project to Studio 5000, it has thrown multiple errors which I am currently working through. I have looked through...
Replies
8
Views
1,724
Hello guys, I use Tia Portal V16. What is the best way to change the indexed HMI tags when I change the format of an Udt in my plc program...
Replies
0
Views
1,308
Hello, I am doing a PLC5 to 1756 L81 conversion. I have an issue with what looks like an indexed array bit in the PLC 5 that I am unsure of how...
Replies
1
Views
1,272
Back
Top Bottom