Indirect addressing using Logix5000

DairyBoy

Member
Join Date
Jun 2007
Location
UK
Posts
393
Good day all. I think I've got it but please put me right if not. (More than likely). If I set up an integer (call it "array") with a non-zero value in dimension 0, can I use a pointer in an indirect move instruction to read/write to/from Array[0], Array[1], etc in the tag directory? is it that simple?

Thanks.
 
Thanks. Now I'm getting greedy: I can see the effect of making DIM1 "2" and figure that my indirect address would still work up to the end of the first "half" (Array[0,n] but how to access the "Array[1,n] data? Is this "multiple" indexing?
 
Movin' on... In RSL500, if I want to enable a single bit in say, a B3 group via indirect addressing, I'll use an unconditionally enabled coil and address it B3:[N7:0] but I've tried the "equivalent" with an integer tag in square brackets following a BOOL32 tag and the RSL5000 editor won't allow more than one tag in the address field for the coil instruction. Is this format permitted in 5000?
 
DairyBoy....

An array in Logix5000 can have 1 to 3 dimensions.

Any and every dimension index can be another tag, it can even be an expression....

e.g. suppose you have a 2-dimensional array called Data[x,y]

You can use...

Data[5,8]
Data[tagA,tagB]
Data[tagA+3,tagB*2]
Data[tagA,tagB-tagA]

Just about anything you want, so long as the expressions keep the calculated indices within the array dimension boundaries.....
 
Not sure I understand your last post - are you trying to create a 2-dimensional BOOL array ?
 
daba, In RS500 style: -----(B3:[N7:0])- so that if N7:0 is holding a value of 5, then B3:0/5 will be enabled.
So I've got a BOOL32 tag called "STEP" which represents STEP[0] to STEP[31] and an integer called "STEP_NUMBER". What I'm aiming to do is replicate the RS500 coil addressing above as: ---(STEP[0][STEP_NUMBER])- Is this appropriate?
 
Last edited:
OK, I don't understand what a BOOL32 tag is, but.....

If I understand correctly you want to turn on a single BOOL element of a BOOL array tag ?

Tag STEP; Data-Type BOOL[32]
Tag STEP_NUMBER; Data-Type DINT

If STEP_NUMBER = 15

Then OTE STEP[STEP_NUMBER] will turn on STEP[15]


Addendum : Use DINTs in preference to any other integer data-type, even if you only want to hold a number value 0-31. It may seem excessive, but the processor will only have to convert SINTs or INTs to DINTs to use them, and the smaller data-types still occupy 32 bits of memory anyway.
 
Last edited:
Almost there but getting a compile error. Looks ok to me though... EDIT: I missed the third index value. In this case it's a zero. Oops! Time for bed.

screenshot.jpg
 
Last edited:
DairyBoy....Just about anything you want, so long as the expressions keep the calculated indices within the array dimension boundaries.....
Take heed of this statement, else you will have trouble..

OK, I don't understand what a BOOL32 tag is,
Addendum : Use DINTs in preference to any other integer data-type, even if you only want to hold a number value 0-31. It may seem excessive, but the processor will only have to convert SINTs or INTs to DINTs to use them, and the smaller data-types still occupy 32 bits of memory anyway.
Someone has said to me that you can see the memory that each tag has, is this possible?
 
Lostcontrol, Re Take heed: I triple-check for this one these days. Crashed a whole plant running from one plc when I was forced to reduce the size of some data tables in an slc504 to accommodate prog mods. Live and learn!
 

Similar Topics

So I have a problem that I am trying to overcome. I have X amount of motors (I'm trying to make the program scaleable). Let's say that a system...
Replies
5
Views
2,010
I remember a while back somebody asking about how to Indirect address a Logix tag using a string. It is possible. I just stumbled across this tech...
Replies
0
Views
2,468
Hi, Im new to SCL, but decided to start learning it - if only to be able to do some simple jobs such as indirect addressing. got some simple...
Replies
3
Views
6,901
I've got a rung that uses the first pass bit to initiate a For argument. In the Routine named 'Alarm' I have something like this...
Replies
15
Views
9,978
So far all the code i've written for PLC's has been simple ladder logic and I'm sure this will be simple once i know how. I have an s7-300 setup...
Replies
9
Views
13,848
Back
Top Bottom