Number in brackets used as an offset?

macrophobia

Member
Join Date
May 2007
Location
FLA
Posts
7
Hi, I'm a little confused, and hoping to verify what I'm seeing on some of the rungs in this RSLogix 500 program I have open. This will probably be easy for everyone but me.


I am seeing instructions like this for example:
XIC B12:0/[N7:10]



I'm thinking that the brackets indicate a bit address that is variable? I haven't seen this before.

When I look at the current value of N7:10, it is 247. So is that number actually an offset (and not a bit number) from B12:0/0?

Thanks for the help!
 
No, it is not an offset from anything, it is explicit. It is called Indirect Addressing..

At run time, the processor will "evaluate", i.e. reduce to a number, anything that appears in square brackets, and use those values to form the address that is used, the effective address.

In your example, N7:10 = 247
B12:0/[N7:10] reduces to B12:0/247 : bit 247 of Binary File 12.

Up to 2 of the 3 numeric parts of an address can be Indirect, so these are all valid addresses.....

Assuming N10:0 = 15, and N10:1 = 47

N[N10:0]:[N10:1] - the effective address is N15:47

N[N10:0]:30/[N10:1} - addresses N15:30/15

T100:[N10:0].ACC - addresses T100:15.ACC


You can only put a single data-table address inside the square brackets.

If you ever get to work on Logix5000 (ControlLogix, CompactLogix etc.), then it is possible to put arithmetic expressions inside square brackets, instead of a single tag or address, that makes things harder to read/understand, but gives far more flexibility when writing software.



ADDED : In your case N7:10 being 247 when you look at it, could be misleading... it might just be a temporary variable that the programmer has used elsewhere in the program.... to know what it is when the controller looks at it, you have to work backwards through the code from the instruction it is being used on, to find what it will be when executed...
 
Last edited:
Thank you daba! That's a great reply with more useful information that I can use in the future. (y)
Thank you so much!
 

Similar Topics

I am working on a project using a NB screen and NX1P2 PLC. I am having a really hard time getting a real number to properly translate through to...
Replies
3
Views
120
Complete noob here, using a Click C0-02DD1-D to run a test stand. Requirement is to turn on motor run for X seconds, turn off and dwell for X...
Replies
6
Views
1,071
Hi, I have this weird issue whenever I try to change the SNN from a Point IO Im missing the three ... dots to open the pop up and change it...
Replies
4
Views
612
I'm doing my first PanelView 5000 application with Logix View Designer v8, and am of course jumping in headfirst. One thing I don't find is a way...
Replies
4
Views
693
Hi PLCs.net! I was curious: How many axis can a B&R APC910 control? Is there a hard limit like certain AB controllers? I'm new to B&R, so would...
Replies
0
Views
365
Back
Top Bottom