You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

Reply
 
Thread Tools Display Modes
Old February 14th, 2020, 09:49 AM   #1
BachPhi
Member
United States

BachPhi is offline
 
Join Date: Dec 2007
Location: Los Alamos
Posts: 491
AOI within an AOI

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?
  Reply With Quote
Old February 14th, 2020, 10:05 AM   #2
mylespetro
Supporting Member
Canada

mylespetro is offline
 
mylespetro's Avatar
 
Join Date: Dec 2015
Location: NS
Posts: 243
Quote:
Originally Posted by BachPhi View Post
What's next? an AOI within AOI within an AOI?
Don't let your dreams be dreams, you can achieve anything!
  Reply With Quote
Old February 14th, 2020, 10:59 AM   #3
MarkNightingale
Lifetime Supporting Member + Moderator
United Kingdom

MarkNightingale is offline
 
Join Date: Sep 2010
Location: In The VAT Shed
Posts: 653
I went to a plant, where I think the main programmer had just learnt about AOI's.

They were 5 deep.

It was such a pain in the a$$.
  Reply With Quote
Old February 14th, 2020, 11:13 AM   #4
DBLD99
Member
United States

DBLD99 is offline
 
Join Date: Oct 2003
Location: USA
Posts: 219
Rockwells own PlantPAX AOIs have AOIs inside of AOIs - It does make sense for certain things.
  Reply With Quote
Old February 14th, 2020, 11:44 AM   #5
mk42
Lifetime Supporting Member
United States

mk42 is offline
 
Join Date: Jun 2013
Location: MI
Posts: 2,521
In most programming environments, that's very common. The number of levels deep you go is often called the "nesting depth".
  Reply With Quote
Old February 14th, 2020, 12:13 PM   #6
Aabeck
Member
United States

Aabeck is offline
 
Aabeck's Avatar
 
Join Date: Feb 2013
Location: Detroit
Posts: 1,860
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.
__________________
Never underestimate the quality of idiots that will be running your machines
http://aabeck.com
  Reply With Quote
Old February 14th, 2020, 01:38 PM   #7
bernie_carlton
Lifetime Supporting Member + Moderator
United States

bernie_carlton is offline
 
bernie_carlton's Avatar
 
Join Date: Apr 2002
Location: Yakima, Washington
Posts: 6,349
Ladder logic Inception!
__________________
Controlling outputs is the PLC's way of getting its inputs to change.

www.thePLCguy.com
  Reply With Quote
Old February 14th, 2020, 02:30 PM   #8
Phrog30
Member
United States

Phrog30 is offline
 
Join Date: Dec 2006
Location: Montgomery, Alabama
Posts: 689
Quote:
Originally Posted by DBLD99 View Post
Rockwells own PlantPAX AOIs have AOIs inside of AOIs - It does make sense for certain things.
Yep.

It's very common and not usual in the least.
  Reply With Quote
Old February 14th, 2020, 03:35 PM   #9
jstolaruk
Lifetime Supporting Member
United States

jstolaruk is offline
 
Join Date: Dec 2004
Location: Detroit, SE Michigan
Posts: 3,539
Quote:
Originally Posted by MarkNightingale View Post
I went to a plant, where I think the main programmer had just learnt about AOI's.

They were 5 deep.

It was such a pain in the a$$.
yeah, more than 2 nested gets hairy. Sounds like a kid with a new toy.
__________________
"You can live to be a hundred if you give up all the things that make you want to live to be a hundred." Woody Allen
  Reply With Quote
Old February 14th, 2020, 04:13 PM   #10
PLCplease
Member
United States

PLCplease is offline
 
Join Date: Dec 2017
Location: Indiana
Posts: 22
I use a timer to start a timer when I'm timing certain times.
  Reply With Quote
Old February 15th, 2020, 06:40 PM   #11
Geospark
Lifetime Supporting Member
Ireland

Geospark is offline
 
Geospark's Avatar
 
Join Date: Feb 2012
Location: Kildare
Posts: 2,934
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
__________________
"A little nonsense now and then is relished by the wisest men".
  Reply With Quote
Old February 16th, 2020, 05:18 AM   #12
drbitboy
Lifetime Supporting Member
United States

drbitboy is offline
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 1,328
Quote:
Originally Posted by Geospark View Post
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"

  Reply With Quote
Old February 16th, 2020, 06:30 AM   #13
jstolaruk
Lifetime Supporting Member
United States

jstolaruk is offline
 
Join Date: Dec 2004
Location: Detroit, SE Michigan
Posts: 3,539
Quote:
Originally Posted by drbitboy View Post
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.
__________________
"You can live to be a hundred if you give up all the things that make you want to live to be a hundred." Woody Allen
  Reply With Quote
Old February 16th, 2020, 06:53 AM   #14
drbitboy
Lifetime Supporting Member
United States

drbitboy is offline
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 1,328
Quote:
Originally Posted by jstolaruk View Post
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.
  Reply With Quote
Old February 16th, 2020, 08:58 AM   #15
BachPhi
Member
United States

BachPhi is offline
 
Join Date: Dec 2007
Location: Los Alamos
Posts: 491
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 by BachPhi; February 16th, 2020 at 09:01 AM.
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
Setting up a MSG in an AOI pierrer LIVE PLC Questions And Answers 7 November 22nd, 2018 04:37 PM
Manipulating Strings in RSLogix 5000 aoi written in ladder Eoghan LIVE PLC Questions And Answers 5 October 17th, 2018 03:17 PM
Programming Exercise: Sorting Algorithm w/Dynamic AOI Results Paullys50 LIVE PLC Questions And Answers 19 January 29th, 2017 05:32 PM
AB AOI design Inputs, Outputs, or InOuts? abishur LIVE PLC Questions And Answers 5 November 16th, 2016 09:55 AM
Add stringtext to multiple AOI local tags. shauntieu LIVE PLC Questions And Answers 1 November 1st, 2011 09:21 PM


All times are GMT -4. The time now is 06:19 AM.


.