Indirect Addressing In RSLogix-5000

I haven't had a chance to look at your uploaded programs, but...

PLC/5 type R data elements convert to data elements of type CONTROL in logix5000. Something somewhere else is using r6:0 in the PLC/5 program and manipulating the .pos variable. Chances are in your logix5000 program a tag R6_0 of type control has been created along with a matching instruction. Find it and understand what is controlling it. For indexing the arrays you will use R6_0.POS.
 
Asterof, I think I have the wrong version of Studio 5000 to open your AOI file. I have version 23 and it doesn't recognize it.
 
Not being funny Asterof, but the code you have posted is the precise reason why I wouldn't use the conversion tool.

It is messy and so hard to follow.

Imagine a tech trying to sort that out..........not a chance.

Sorry, but I couldn't put out code like that into a working plant.

Cheers

Mark
 
Not being funny Asterof, but the code you have posted is the precise reason why I wouldn't use the conversion tool.

It is messy and so hard to follow.

Imagine a tech trying to sort that out..........not a chance.

Sorry, but I couldn't put out code like that into a working plant.

Cheers

Mark

Your not hurting my feelings, lol I did not write that ****
Thats why I do manual conversions so it will work exactly the same way it did before. I am the poor guy who must figure that code out when I am hired to upgrade it. I call that "Someone who was trying to prove how good he was at writing code"
instead of keeping it simple.
 
RSLogix-5000

EQU
SOURCE A: N50[R6_000_POS]
0
SOURCE B: N[149_21][R6_000_POS]
0
________________________________

I'm not sure where you got 149_21 (N149:21 in PLC5-speak), it should be N[49_21], but since it isn't going to work anyway, it doesn't matter.

Your N49:21 points to the file that contains your current recipe, and it is 200 INTs long ( !!!see note at the end of this post for details!!! ). There is apparently more than one recipe, and based on the 110 added to N49:7, it would make any valid recipe file number greater than 110.

Looking at your data tables in the PLC5, I see that you have "N" files of 470 integers ranging from file N111 to N130 (inclusive).

It's a pretty safe bet that these are your recipe files, and therefore what you will need to re-create them Logix5K style (a two dimensional array, 20 x 200 would work).

Using Notepad++ I opened your .PC5 file and did some snooping about. I already knew that files N50, N51, and N52 were associated with the recipe routines, so looking in file N50 (line 638 in your .PC5 file), I copied the data associated with words N50:20 to N50:29. This is what I got:

Code:
60   2000      5     30      0      0      0      0      0      0

I pasted that in the search box and asked Notepad++ to find all occurances of this string of data in the program. This is what I got:

Code:
  C:\Users\zzp93j\Desktop\Test Area\17222102 GLATT ROOM 75 VALVE SEQUENCE 11192013.PC5 (3 hits)
	Line 638: % N50:20 %     60   2000      5     30      0      0      0      0      0      0 
	Line 756: % N52:20 %     60   2000      5     30      0      0      0      0      0      0 
	Line 1824: % N127:20 %     60   2000      5     30      0      0      0      0      0      0

So we can see that N50, N52, and N127 are linked together. The same applies to N51 and N113.

That's not to say that the other N files in the N111 to N130 range aren't being used, there is definitely some cross-pollination going on between N115, N117, N118, N129, and N130. Probably even more, but all I have to go on is what your PC5 file had for a data snapshot.

The bottom line is that you will probably need to create an array of arrays (20 x 200) so that you can index through these indirectly in a way that will work for the Logix5k.

More, and different data would be nice. See if you can get your client to load a recipe, allow you to save the program, and then load a different one. Also, see if they will let you put some trap logic in to track what is stored in N49:21 (and any other register of interest).

But it really shouldn't matter since we can be pretty certain where the recipe files are (and how many of them that there is). If you create an array of 20 x 200 (ranging from 0 to 19, and 0 to 199), then you will have to modify your program to index these numbers and not the 111 - 130 that the program is expecting.

Also, N50, N51, and N52 are 570 INTs long. The destination files are 470 INTs long, and the program *seems* to only access 200 INTs (which is why I suggested the 20 x 200 array). But to be safe, I would make my arrays 20 x 470.

P.S. You may want to have your client change their passwords.
 
RSLogix-5 To Studio-5000

Thanks rootboy for your help. I have about two more things that is giving me a problem in the PLC5 conversion to Compact Logix.

1. In that PLC5 program, In the An_Inputs routine, there are a few BTR and BTW instructions. In the Studio 5000 program, it gave me an error saying "No Path Identified". The only thing I could see to select in the configuration browse was the local processor. These BTR and BTW instructions aren't writing to another plc so, I didn't see anything else to select.

2. In the same program in routine REC_EDIT, starting at rung 53, they used an Equal instruction that compares the same files you mentioned in your last post. N49:21 and N50. This instruction is looking at R6:0.POS and during the conversion, Studio 5000 did not it. I'm lost as to how to program the control word that it's looking at.
_______________________________
RSLogix-5

EQU
Source A: N50:[R6:0.POS]
Source B: N[49:21]:[R6:0.POS]
_______________________________

_______________________________
Studio-5000

EQU
Source A: N50[R6_000_POS]
Source B: N[N49_21][R6_000_POS]
_______________________________


These are really the only errors that I have left in the program before I download it and start troubleshooting all of the other stuff that might not work.

Thanks,
 
Thanks rootboy for your help. I have about two more things that is giving me a problem in the PLC5 conversion to Compact Logix.

No problem. It was fun! :)


1. In that PLC5 program, In the An_Inputs routine, there are a few BTR and BTW instructions. In the Studio 5000 program, it gave me an error saying "No Path Identified". The only thing I could see to select in the configuration browse was the local processor. These BTR and BTW instructions aren't writing to another plc so, I didn't see anything else to select.

These are going to be replaced with either rack or some sort of remote I/O. Nothing to worry about until you pick what type of I/O you are going to use.


2. In the same program in routine REC_EDIT, starting at rung 53, they used an Equal instruction that compares the same files you mentioned in your last post. N49:21 and N50. This instruction is looking at R6:0.POS and during the conversion, Studio 5000 did not it. I'm lost as to how to program the control word that it's looking at.
_______________________________
RSLogix-5

EQU
Source A: N50:[R6:0.POS]
Source B: N[49:21]:[R6:0.POS]
_______________________________

_______________________________
Studio-5000

EQU
Source A: N50[R6_000_POS]
Source B: N[N49_21][R6_000_POS]
_______________________________

Actually this was where I started with your program last night. The FOR in the Logix5k calls a subroutine instead of executing the next group of rungs, so create a subroutine in your program and call it "REC_EDIT_SUB" if you like.

Then move rungs 43 - 51 (inclusive) to that subroutine. Delete rung 52. Be sure to tell your FOR instruction that it is to call "REC_EDIT_SUB".

You might want/need a RET instruction in your sub, but unless it is part of a label/next (LBL/NXT) combo I don't think that you'll need it. For our purposes, it's just something to hang your label onto...

You have other FOR instructions in the program, the one in Lad 3 uses a label to jump over logic that it doesn't want to execute when the alarm is disabled. You can keep that and the destination label might need a return.

Lad 6 has the same thing but I don't see the need for it. In rung 5 you jump over rung 6 if N16:50 = 0. Why not just make that a NEQ instruction and the move the MOV instruction from rung 6 to just after the NEQ on rung 5 and get rid of the JMP/LBL stuff?


These are really the only errors that I have left in the program before I download it and start troubleshooting all of the other stuff that might not work.

Thanks,

No problem, and keep us posted! :)
 
We avoid all of this by upgrading PLC-5's (and PLC-2's/PLC-3's/SLC-500's) to SoftPLC instead of Compact/ControlLogix.

The programs, including indirect addressing and other things that don't convert to Logix well, import into the SoftPLC CPU with no changes required, especially if the I/O isn't changing. Plus all the documentation converts too.
 
Thanks for the comments rootboy. I have already created the subroutines for all of the FOR statements. That was pretty easy to figure out after I started working on the program. The main things I am still stuck on are the double indirect addressing. In the post I sent yesterday showing the equal instructions for the RSLogix-5 and what the conversion statement changed it to, I am at a loss of what to do there for now. I fully understand what the RSLogix-5 is doing with it but, just don't know at this point how to program it in Studio-5000.

Cody, I appreciate the comments but the customer I have is the one that has selected the processor. I don't really have an option of which one to use. They have these all over their facility. I'm not new to the control logix platform, just never dealt with so much indirect addressing, especially not in control logix.

I have some of the same type conditions in routine 42 starting at rung 60 where they are doing a File Search/Compare. They are using the same index register address and mentioned before. These recipes are going to be an important part of this program is why I'm trying to get help from experts like you guys. It's obvious that you guys are much more knowledgeable than me on this stuff.
 
If anyone out there would like to take a look and give your opinion on what I should do, here is a copy of the PLC5 program that I am working on. The only errors I have left in the program after converting it to Studio-5000 are in Routine 42 REC_EDIT. Starting at rung 53. The indirect addressing for the recipe files is hard for me to figure out in Studio-5000 and make sure it is correct. I really appreciate any help you guys are throwing at me.

Thanks!!!
 
Thanks for the comments rootboy. I have already created the subroutines for all of the FOR statements. That was pretty easy to figure out after I started working on the program. The main things I am still stuck on are the double indirect addressing. In the post I sent yesterday showing the equal instructions for the RSLogix-5 and what the conversion statement changed it to, I am at a loss of what to do there for now. I fully understand what the RSLogix-5 is doing with it but, just don't know at this point how to program it in Studio-5000.

I've attached an example on how you could do it.

First create your UDT, then create a tag that contains 20 of these types (your UDT will now show up as an additional option when you select what data type to make your tag), and then you can access both indexes indirectly as shown in the bottom clip.

Logix5k Double Indirect Addressing.jpg
 
Just a note

Just because it verifies with no errors does not mean it will
work like it used to. And in a conversion that is what you need
so you have little commissioning time. Let us know how it goes
when you actually try and use the code.
 

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
675
Hi there I'm currently converting an RSLogix500 program that I wrote 20 years ago into RSLogix5000 for an SLC to CompactLogix upgrade. The...
Replies
3
Views
2,221
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,221
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,802
when your pointer gets indexed, if your previous reference is true, and your current reference is true before getting indexed, will the...
Replies
13
Views
5,479
Back
Top Bottom