Logix500 indirect adressing

spaderkung

Member
Join Date
Aug 2007
Location
South Sweden
Posts
389
Hi

In a program i'm addig code to, the following is found to compare a constant to a value stored in N51

EQU #N51:[N51:0] 14

What use is the #?
From my guess of the intention and what i understand from the manual I would have written it without the #.

Thanks in advance
 
We would have to see the rest of the program ( .RSS file). Is there something writing to status S:24 in the program. See exert from the help file for "index addressing"/ "indirect addressing" below.

Indexed indirect address

An indexed-indirect address specifies a combination of indirect and indexed addressing. The processor first resolves the indirect portion of the address and then adds the offset from the Index Register S:24 to come up with the final address.
For example:
#N7:[N10:3] where N10:3 = 20 and S:24 = 15.
The actual address used by the instruction is N7:35.
 
Thanks, so it could be a bit more complicated, but at least the implication is clearer now. N51 holds recipe instructions. [0] is the current step nbr and [1..50] is the instruction to perform. But the recipe in N51 is dedicated to one resource (the others have their own Nx), so I don't see the clever use of # (too see the recipe for another unit).

I have to ask before posting the program, so I'll have to manage with what you can give me based on the little info I can provide.

Is the S:24 usually modified intentionally (no hits on 'find all')?
 
Is the S:24 usually modified intentionally (no hits on 'find all')?
It can be but it not always written to directly. See pdf below for a more detailed explanation from the manual.
 
I can find nothing in that publication that leads me to believe that S:24 can be set to a useful value by "some other means". It is usually just left at a value by a previous "indexed" instruction.....

Caution: The # symbol is also required for addresses in file instructions which also make use of word S:24 to store an offset value. If you are using file instructions in your program as well as indexed addressing, make sure that you load the correct offset value in S:24 prior to using an indexed address that follows a file instruction. Otherwise, unpredictable operation could occur, resulting in possible personal injury and/or damage to equipment.
I tend towards agreement with the O.P., and that the original programmer has included the leading # in ignorance, especially since there are no search results for S:24.

Having said that, I will reserve final judgement until I have seen the program, if that is possible.

spaderkung, am I right in thinking that the program is currently working correctly?
 
I tracked down the original programmer who wrote it 10 yrs ago and he agreed that the indexation did not seem to serve any purpose and that it could have been a copy paste error, but since the program is working correctly I will follow the example.

Saw that adresses entered in a COP automatically gets the # (so a copy of the adress to another instruction may be the cause). Is it common practice to make sure S:24 is cleared before every "normal" COP, or just cleared after an indexed COP?
 
Is it common practice to make sure S:24 is cleared before every "normal" COP, or just cleared after an indexed COP?
No, you will nearly never see S:24 manipulated by ladder logic in any way. The only times I can think of would be when indexed indirect addressing is called for or when you want to 'roll your own' loop. One reason might be to step backward through a file.
 

Similar Topics

I'm converting a Logix500 program from a Micrologix 1400 to Logix5000 on a CompactLogix 1769-L30ER. The Logix500 appears to use indirect...
Replies
8
Views
2,618
Hey All, I have: COP Source #L[N60:4]:[N60:2] Dest #L30:0 Length 4 When I compile the project, I get: WARNING: File number doesn't point to...
Replies
4
Views
1,694
Good day all, I would like to know if it is possible to use a counter' accumulator value as an indirect address. So it would look something like...
Replies
8
Views
4,192
Hello all, I am programming with indirect addressing in SLC 5/05 using RSlogix500 software. Sometimes processor get faulted with error code...
Replies
2
Views
3,333
So basically i have 2 queries : 1. I have a program file of S7-300 PLC which i want to migrate in RSLogix500.In short i want to convert my simatic...
Replies
14
Views
169
Back
Top Bottom