You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

Reply
 
Thread Tools Display Modes
Old November 25th, 2021, 01:08 PM   #1
woodward_uk
Lifetime Supporting Member
United Kingdom

woodward_uk is offline
 
woodward_uk's Avatar
 
Join Date: Mar 2006
Location: Hinckley, Leicester
Posts: 35
RSLogix 5000 Indirect Addressing

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.
  Reply With Quote
Old November 25th, 2021, 01:17 PM   #2
drbitboy
Lifetime Supporting Member
United States

drbitboy is online now
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 3,853
http://www.plctalk.net/qanda/whereis...ogix&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].
__________________
i) Take care of the bits, and the bytes will take care of themselves.
ii) There is no software problem that cannot be solved with another layer of indirection.

Last edited by drbitboy; November 25th, 2021 at 01:35 PM.
  Reply With Quote
Old November 25th, 2021, 01:40 PM   #3
drbitboy
Lifetime Supporting Member
United States

drbitboy is online now
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 3,853
Whoa, check this out: http://www.plctalk.net/qanda/showthr...323#post740323

Specifically near the end:

Quote:
Originally Posted by skyfox View Post
...

So in a nutshell.....

Data[IDX[5,1]] ' Does not work ' IDX = Multi-dimensional array
Data[IDX[5]] ' Does not work ' IDX = One-dimensional array
DATA[x] ' X works. X= Tag
DATA[X*A+B] ' Works X, A, & B = Tags (or can be constants)
(emphasis added).
__________________
i) Take care of the bits, and the bytes will take care of themselves.
ii) There is no software problem that cannot be solved with another layer of indirection.
  Reply With Quote
Old November 26th, 2021, 05:10 AM   #4
woodward_uk
Lifetime Supporting Member
United Kingdom

woodward_uk is offline
 
woodward_uk's Avatar
 
Join Date: Mar 2006
Location: Hinckley, Leicester
Posts: 35
Thanks drbitboy

I hadn't used a 2D array before, did some research and tested and it worked perfectly.



Steve
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
quick question about indirect addressing in rslogix 500 TL140 LIVE PLC Questions And Answers 13 August 15th, 2017 09:07 PM
Studio 5000 Logix Emulate - Is this a free software with RS Logix 5000 or support ? Baker in Virginia LIVE PLC Questions And Answers 33 June 8th, 2017 03:58 PM
How To Enter Rslogix 5000???? sundar_scada LIVE PLC Questions And Answers 14 April 2nd, 2016 05:50 PM
RSLogix Emulate 5000 Sakubh LIVE PLC Questions And Answers 3 March 6th, 2015 12:52 PM
RsLogix Emulate 5000 Controler Not listed in RsLogix 5k ahenry2005 LIVE PLC Questions And Answers 2 December 4th, 2013 12:59 PM


All times are GMT -4. The time now is 08:15 PM.


.