Indirect addressing

RobWad

Member
Join Date
Jun 2012
Location
Muskegon
Posts
27
Can anyone help with this indirect addressing? This is what i got on the plc5 to controllogix translation tool. Any help is appreciated.


PLC 5
BTD
Bit Field Distributor

Source
N[N40:47]:[N40:44]
0<
Source Bit


0
Dest


N40:21
0<
Dest Bit


0
Length 8


RS 5000 TRANSLATION

Bit Field Distribute
Source


N40_47
<N40[47]>
44
Source Bit


0
Dest


N40[21]
0
Dest Bit


0
Length 8


 
Last edited:
Sometimes you have to edit the translation and fix the addresses to match the old program.
 
This isn't going to be an elegant translation because of the way Integer files are translated into single-dimensional Arrays.

The PLC-5 BTD instruction allowed you to specify both the Data Table Number and the Data Table Element.

But when each Data Table got converted to an INT[x] single-dimensional array tag, you lost the ability to indirectly address the "Data Table Number".

If you want to retain this sort of indirection, you're going to have to go back and convert the "N40[x]" tag into a two-dimensional array like "NForty[x,y]".

If it were me, I'd use this opportunity to translate the code into something more native and suited to ControlLogix.
 
You will have to create the Source Two-Dimension Array Tag corresponding to the PLC5 N[Nx:y]:[Nz:w], giving it a more meaningful name (you could also rename the Destination while at it) and then deploy the BTD via the "PLC5 Mechanism" which was writing the "old registers" Nx:y and Nz:w while remembering that PLC5 uses INT (16-bit) data structures while Logix Class CPUs are 32-bit (DINT) based.

More information about Logix Data/Tag structure at:

http://literature.rockwellautomation.com/idc/groups/literature/documents/pm/1756-pm004_-en-p.pdf
 
Last edited:
What would be a more suited for controllogix for this? Thanks for your input.

That would depend on what the code is doing and why it needed to change both the data file and the index.

For instance, if the only reason it changed the data file was that one data file was too small to hold all the data (1000 elements in PLC5), then the answer is easy: Just make the array bigger and eliminate the "data file" index and use one index.

If having more than one index makes sense for what you are doing, then go for the array[index1, index2] solution. Either way, definitely use meaningful names instead of N40.

While you are looking at what the code actually does, consider that there may be a much simpler way to do it.
 

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
634
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
673
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,392
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,280
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
2,012
Back
Top Bottom