Indirect Addressing in Studio 5000

Frinehart

Member
Join Date
Jul 2018
Location
Ohio
Posts
21
All,

I have a question on Indirect addressing, is it possible to use two bits to indirectly address in Studio5000 or do you have to use multiple bits to make this work? I know that you can do it in older processors, I am currently converting a PLC-5 to ControlLogix.
 
Previous program has an N[N7:52]:[N7:54] as the indirect address calling a different N bit. Once converted the bits change to N[N7_52][N7_54] and the value comes in as ?? for it not being found.
 
Not to be a pedantic jerk, but please realize when referencing an "N" register in a PLC5 that is not a bit. A bit is boolean or binary, a 0 or 1. An "N" is a collection of 16 bits, commonly called a word or an INT in Studio5k.
This might sound like useless trivia but there is definite value in familiarizing yourself with data types.
 
Not to be a pedantic jerk, but please realize when referencing an "N" register in a PLC5 that is not a bit. A bit is boolean or binary, a 0 or 1. An "N" is a collection of 16 bits, commonly called a word or an INT in Studio5k.

I understand it is a register just using bit as a generic term.
 
Sadly, the 5000 implementation is actually indexed addressing. There is no pointer data type that would allow true indirect addressing, referring to pointers in Step 7.
 
You can do this in RSLogix 5000, but, if I remember right, you can only have one indirection per tag reference.

So in your case of file and word indirection you would be best served by making use of 2 dimensional arrays and improve the tag name scheme while you're at it.
 
. Once converted the bits change to N[N7_52][N7_54]

I can't tell if you or the conversion program has the typo (probably you since you keep insisting on calling words "bits"), but the data structure should be N[N7_52, N7_54]

The problem you're going to have is that, if N7:52 (AKA N7[52], which is probably referenced by an alias tag "N7_52") has a value of '100', the conversion program would have created an N100, but it will not be linked to the two-dimensional array "N" that was also created.

If you have logic that references any N100[x] addresses, they won't manipulate the data in the N[x,y] array.

The conversion program is OK, but there's only so much that it can do, The PLC-5 / SLC just think differently than the CLX / CPX processors.

Okie gave you the best advice -- rewrite this section of logic from scratch, and improve the naming convention while you're at it.
 

Similar Topics

Can someone explain to me the AND-16, and the AND 15 part of this indirect addressing? Thank you for any input. B18[(N57_34 AND -16)/16].[N57_34...
Replies
3
Views
1,781
I would appreciate some help understanding some code from the RSLogix 500 days. I'm trying to convert a Studio and I get a PCE for the following...
Replies
9
Views
2,227
🙃 I have been scratching my head for a couple of days on this issue. I am in the process of converting a program from rs500 to Studio 5000...
Replies
7
Views
5,595
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
577
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
649
Back
Top Bottom