Indirect Addressing

aretstudent

Member
Join Date
Oct 2011
Location
Minneapolis
Posts
11
I am trying to understand some indirect addressing. I understand that everything in the brackets must equal a number but how do I interpret this one? What do I do with the comma in this case?

COMP_FR[COMP_N201_0, 58]
 
COMP_FR is a two dimensional array. That is, it's not just an array like so:
Code:
COMP_FR[0]; COMP_FR[1]; COMP_FR[2]; COMP_FR[3]; COMP_FR[4]
...it's an array like so:
Code:
COMP_FR[0,0]; COMP_FR[0,1]; COMP_FR[0,2]; COMP_FR[0,3]; COMP_FR[0,4]
COMP_FR[1,0]; COMP_FR[1,1]; COMP_FR[1,2]; COMP_FR[1,3]; COMP_FR[1,4]
COMP_FR[2,0]; COMP_FR[2,1]; COMP_FR[2,2]; COMP_FR[2,3]; COMP_FR[2,4]
COMP_FR[3,0]; COMP_FR[3,1]; COMP_FR[3,2]; COMP_FR[3,3]; COMP_FR[3,4]
COMP_FR[4,0]; COMP_FR[4,1]; COMP_FR[4,2]; COMP_FR[4,3]; COMP_FR[4,4]
Three dimensional arrays are also possible.

So in your case, one dimension of the array is variable (COMP_N201_0), and the other is fixed (58). If the value of COMP_N201_0 is e.g. 17, your final address is COMP_FR[17, 58]

Don't you just love projects that have been converted from RS500 and had all the data register arrays kept intact? ;)
 
Last edited:

Similar Topics

Howdy folks, I am an Allen Bradley guy currently living in an Emerson world. Working with Rx3i on PacSystems Machine Edition v. 9.6? i think...
Replies
3
Views
620
Hello, I'm very new to programming with absolutely zero schooling in this field and pretty hands off training in my new role, it's been fun...
Replies
4
Views
668
Hello Friends, I am trying to index M Bits, however GX Works2 is not allowing it with following message. https://ibb.co/zPcqj6M...
Replies
3
Views
1,380
Hi All, which the best way to do the indirect addressing in an optimize DB? Ccurrently this is my partial code inside an FB...
Replies
7
Views
2,273
Hey everyone, Just used the PLC5/Logix migration utility to convert a program, and while addressing the PCEs, I noticed a lot of errors for "XIC...
Replies
12
Views
1,978
Back
Top Bottom