AOI within an AOI

BachPhi

Member
Join Date
Dec 2007
Location
Los Alamos
Posts
640
I came across an AOI that contain another AOI within. Just so 'interesting', IMHO, if you know what I meant.

Just wonder if you have seen them or your pro and con thoughts.

What's next? an AOI within AOI within an AOI? 🍻🍻
 
In most programming environments, that's very common. The number of levels deep you go is often called the "nesting depth".
 
Same as JRS's in a program or GOSUB's in a computer program.

Just keep going deeper until no-one can possibly find out what you are doing, what you were thinking, or be able to do anything to your program.
 
Rockwell used to say that AOI instructions may be nested up to 16 levels deep, but recommended limiting the level of nesting to eight levels to reduce complexity and make the instruction easier to manage.

Quite sensible, we would agree?...

They then tore up that book of sense at Studio 5000 v27, and "changed" AOI nesting to a maximum of 25 levels, no less.

But just remember kids, play careful now and try not to fall down the rabbit hole.

Regards,
George
 
They then tore up that book of sense at Studio 5000 v27, and "changed" AOI nesting to a maximum of 25 levels, no less.

I dunno if that sounds like a good idea in the real-world, cause-mayhem realm of PLCs, but in the non-real world of procedural languages I am comfortable having an AOI-equivalent call itself to an arbitrary nested depth; that capability is one of the many things that makes these silly computers so durn useful.

I heard that in the dictionary, the definition of recursion says "See recursion"

;)
 
I dunno if that sounds like a good idea in the real-world, cause-mayhem realm of PLCs, but in the non-real world of procedural languages I am comfortable having an AOI-equivalent call itself to an arbitrary nested depth; that capability is one of the many things that makes these silly computers so durn useful.

I heard that in the dictionary, the definition of recursion says "See recursion"

;)

As cool as it is, recursion is caught by the compiler and not allowed in Studio/RSlogix 5K when it comes to AOIs or UDTs. A JSR call to "itself" is allowed but I haven't tried it without a way to "break" the call cycle. I would expect no less that a major fault.
 
As cool as it is, recursion is caught by the compiler and not allowed in Studio/RSlogix 5K when it comes to AOIs or UDTs. A JSR call to "itself" is allowed but I haven't tried it without a way to "break" the call cycle. I would expect no less that a major fault.

Fortran has the same restriction, or at least one of the many incarnations I used once did. However, you could call subroutine A, then have A call subroutine B, and B could call A; let's call it recursion by proxy.

Such a scheme would limit the recursion depth to half the nesting limit, but would the rsl5k compiler catch it as recursion?

If there ever was an actual useful purpose for this (e.g. a FIFO of structures instead of bits), then obviously there would need to be a way to limit the recursion depth, but that is not difficult.

Not exactly on-topic, please excuse the distraction.
 
Keep in mind there are certain instructions not available within AOI. So you are forced to make a 'SMALL' AOI within an AOI. Case in point BitShiftX . Here I am referring to a big/complex AOI within an big, complex AOI.
 
Last edited:

Similar Topics

Hi, all! I have a 1768-L45 CompactLogix PLC with a couple of 4-20 temperature transmitters connected to it. I have the temperature scaling...
Replies
6
Views
443
Hi. Can anyone help me out with this one? This something that I am just having hard time figuring out. I understand and can also follow the run...
Replies
7
Views
2,979
There was a bit of discussion on this in another thread (@Maintenance Man - Going from 500 to 5000). Instead of continuing to hijack the thread...
Replies
17
Views
8,152
Hi everyone, i have an issue with saving a changed value in an AOI, I am using L84E, Everytime i try to save my work to SD card, the program lost...
Replies
1
Views
51
Working with AB/ Rockwell PLCs How do I get certain outputs to show up like the picture ? The one in the picture was made by a manufacturer, but...
Replies
4
Views
190
Back
Top Bottom