Need help - confused/think i am loosing it

It seems hard, but the "indirect address" is the ability of the AB PLCs to use the NUMBER in the "indirect address" as the "real" address. Ron's shortcut for display (haven't tried that, BTW) shows the actual number, which can, and will, change.

If you use the data display, you have two addresses in this example, and per your attachment:

N19:1 has a value of 1.
Your indirect address is used to make a value of N17:1 in this example.

The number used in the indirect address (N19:1) can and will change, and rather than write all new repetitive code, you can re-use the same logic by changing the indirect value.

Look on my website, I have a RSL5000 example that I used for alarming, it is only a few rungs long but can handle hundreds of alarms using indirect addressing. (Actually a LOT of indirect addressing!) There, I used an indirect address as a counter value, each scan through the logic, the indirect address increased by one.
 
Look at direct, indirect and indexed addressing as a street address.

I'll choose Elm street for our example (My grandma lived on Elm street) The houses on Elm street are numbered sequentially, not skipping numbers.

Now lets liken Elm street to a file. Elm street has multiple houses on it, and a file has multple registers in it. Lets simultaneiously look at the house with the address 5 Elm Street, and the register N7:5 (word 5 of file 7). Keep in mind that the file actually starts at address 0.

Direct Addressing:
5 Elm street is one specific house, it cannot be any other.
N7:5 is one specific register, it cannot be any other.

Indexed Addressing, this in the kind of addressing that uses a # before the address.

We do indexed addressing all when giving directions, ie, "My house is the second house after the big ugly green house."

If my index number is 2, then
5 Elm street is the second house after 3 Elm street.
and if the S;24 register in my PLC contains the number 2, then
#N7:3 indexes to the register N7:5, or two registers after N7:3.

Note: I usually try and stay away from indexed addressing, but its important to understand as there are several instructions that use it internally.

Indirect Addressing. This is what the program you posted uses.

We also do indirect addressing all the time when giving directions, ie, "My house is the fifth house on the street."

In indirect addressing we require a pointer. This pointer can be any integer address. Lets use N9:0.
So to point at the house 5 Elm Street, my pointer need to be a 5, or the fifth house on elm street.

And to point at N7:5, I need I need a 5 in N9:0. So I MOV a 5 into N9:0, and N7:[N9:0] points at N7:5, or element number 5 of the file.

Indirect addresses can point to files, words, or bits.
N7:[N9:0] <--indirect address a word.

N7:5/[N9:0] <--indirect address a bit

N7:[N9:0]/[N9:1] <--indirect address a word and a bit.

N[N9:0]:5 <-- indirect address a file, be very careful when using this form

When using indirect addressing you need to make sure you don't address across file boundaries. If N9:0 = 100 but file N7:0 only has 50 elements in it then N7:[N9:0] will get you in trouble. There are ways to allow it, but I don't recommend them and for now lets just leave that for you to learn on your own after you have mastered indirect addressing.


I hope that helps and that it doesn't obfuscate (muddy things up) the differences between addressing methods.
 
Last edited:
if you've read everything that's been posted by my distinguished colleagues then you've probably got a good handle on this by now ... but if a slightly different wording might be helpful, here's a little bit more along the same lines ...

Could someone explain how when i moved the cursor over the top of the N17:1, it showed N17:[N19:1]

actually you didn't move your cursor over N17:1 ... instead you moved your cursor over N17:[1] ... those brackets are important ... they basically tell the processor to "GO LOOK IN A BOX" to get a number ... when the processor looks in the box (in this case the box is N19:1) he sees a number (the number is "1" in this example) ... so the processor substitutes the number "1" into the address ...

and so ... the address ends up being N17:1 ...

note that the screen can display this as N17:[1] to help you (the human) see what's going on - but the processor just interprets it as plain old N17:1 and goes on with his life ...

now (somehow/anyhow) change the number in N19:1 to "2" ...

the next time the processor uses the address N17:[N19:1] then he'll interpret that address as N17:2 ...

in simple terms, you can use indirect addressing to "re-aim" the same instruction to make it access different memory locations ...

if you want some extra help with this, give me a call ... ten minutes should be enough - especially if you have a spare system handy that you can play with ...
 

Similar Topics

Hi all, I'm modifying a system and came across a dint tag used in a way I've never seen before. The tag name is cvProcess yet he has a xic named...
Replies
2
Views
2,647
I have an old Sentry Palletizer (S/O Number 3007 / Serial Number 1172) that has lost its program as the backup battery died years ago. I can...
Replies
0
Views
103
So i've been at this for a long while, i have Citect Scada 2018, i have full access to everything but i can't seem to find any option or...
Replies
0
Views
67
I'm fairly new to Rockwell software, I've had some basic training in the past but nothing too advanced. My company and I use Reliable products for...
Replies
11
Views
377
Hi all, I am having issues accessing my Cimplicity software - the site code changed after re-install and I am no longer able to attain a new key...
Replies
10
Views
194
Back
Top Bottom