RSLogix 5000 Indirect Addressing

woodward_uk

Lifetime Supporting Member
Join Date
Mar 2006
Location
Hinckley, Leicester
Posts
42
Hi there

I'm currently converting an RSLogix500 program that I wrote 20 years ago into RSLogix5000 for an SLC to CompactLogix upgrade.

The program uses indirect addressing, I have figured out how to address the required words within an array. For example my original N16:[N44:15] is now N16[Pointer2], where Pointer2 is an INT that contains the value of the array word I wish to reference.

The problem comes when I try to reference the same word position in different arrays. The original software used N[N9:40]:6 to point to word 6 in different data files, but I can't find a way of achieving this in Logix5000.

I've searched the forum without success, any help would be gratefully received.

Thanks.
 
http://www.plctalk.net/qanda/whereisit.shtml?cx=010759363700548729232%3Asbguabkbras&cof=FORID%3A10%3BNB%3A1&ie=UTF-8&q=two+dimensional+arrays+rslogix&sa=Search

Try to find some documentation of how to create and use two-dimensional arrays.

You could also create a UDT that comprises the elements of a 1D array, and then create an array of those UDTs, and access them like this: udt[N9_40_pointer].row_array[6]

You could also create a 1D array and have it emulate a 2D array. E.g. say you wanted to emulate a 10x10 2D array:

  • Create a 1D 100-element array
  • 1D elements [0..9] correspond to elements [0,0..9] in the emulated 2D array
  • 1D elements [10..19] correspond to element [1,0..9] in the emulated 2D array
  • ...
  • 1D elements [90..99] correspond to element [9,0..9] in the emulated 2D array
  • So to access emulated 2D element [ROW,COLUMN], you access 1D element [(10*ROW)+COLUMN] in the 1D array.
    • So the emulated element at row 3 (of rows 0..9) column 4 (of columns 0..9) in the emulated 2D array corresponds to indirect address 34.
It's basically bookkeeping. I think RSLogix 5000 allows some arithmetic in the brackets, e.g. maybe twod_array[row10+column] where row10 = row * 10, but probably not twod_array[row*10 + column].
 
Last edited:

Similar Topics

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
662
I’m working with indirect addressing and trying to make an HMI where each Rectangle Object has a tag of “A[0-127]” with a correlating Push Button...
Replies
15
Views
4,191
Hello, I'm trying to create IO tags that will allow I/O to be changed via the HMI once the system is deployed, and without needing to connect via...
Replies
3
Views
2,783
I need some help with Indirect Addressing where I used the conversion tool to convert an RSLogix-5 program to an RSLogix-5000 program.
Replies
31
Views
7,915
Back
Top Bottom