MLS/MLR , For/Next , (orout) , D0-06's

OK

Does the MLS and MLR in AD need to be nested to work?
Don`t think so it says can be nested up to 7 deep I have both AB and AD books open and like the denist said the other day that was doing a root canal on ME LOOK`S LIKE IT SHOULD WORK
 
Billy,

Lucky for you I happen to be working today. You are correct. The MLS/MLR combo can be nest but do not have to be. If nested though, the constant (K value) has to be incremented for every MLS and Decremented for every MLR.

Example:

Code:
|              K1   |
|--| |--------(MLS)-|
|                   |
+-|    Some         |
  |    code         |
  |            K0   |
+-+-----------(MLR)-|
|                   |
|              K1   |
|--| |--------(MLS)-|
|                   |
+-|    Some more    |
  |    code         |
  |            K0   |
+-+-----------(MLR)-|
|                   |

OR

|              K1   |
|--| |--------(MLS)-|
|                   |
+-|    Some         |
  |    code         |
  |            K2   |
  |--| |------(MLS)-|
  |                 |
  +-|   Some        |
    |   code        |
    |          K1   |
  +-+---------(MLR)-|
  |                 |
  |            K0   |
+-+-----------(MLR)-|
|                   |

These can be nested up to 7 levels deep. You can have as many combinations that you want. Everything that is going to be controlled by a MLS/MLR pair has to be within them.

I hope this helps.

Bob
 
Billy, do you have the same output (ie, y21) as the result of more than one rung of logic. It became apparent to me, as stated previous, that you can not do this. Even if the location of that output is in a MLS/MLR section that is 'off'.

It does not work properly. Had to use 'orout' for my particular project to work.

Someone may know if it works for A/B PLC's, maybe that was already answered.

Johnny
 
In the past I was a big advocate of NEVER double-coiling (using the same output in more than one place in the program). Since I have been using Block/Stage programming (AD), this does not always hold true anymore. If you plan on using the same output in multiple stages, as long as no more than one stage that contains the output is active, then it is okay. This is because only the active stages are processed. Inactive stages are ignored.

Block/Stage programming, if done right, can have a dramatic impact on your scan times (if this is important to you).

Just my $0.02

Bob
 
Johnny,

If that is you in Post #11, then, I think you're gonna go far in this game...

...you already seem to have the "thousand-yard-stare" down pretty good.

Now, if your co-workers walk by shaking their heads as you are sitting down somewhere, elbows on your knees, your hands moving this way and that (apparently sending sign-language to someone... in a parallel universe, maybe?), then I can say that I believe you are on the right path and you are on your way!
 
Got an error 451 says bad mls/mlr Must be in accending order. Well I am mls--ing k1 then mlr--ing k0. The mext set is k2 mls then k1 mlr. I do this accending order for 5 more times.. in different parts of the program. As I go from top to bottom I am adding these functions. Any Clue???

Thanks
 
If you are not nesting MLS K2/MLR K1 within your first MLS K1/MLR K0, then you may have an issue.

If you are not nesting these, you will only use MLS K1/MLS K0. Just keep repeating those values.

I think.

Johnny
 
Last edited:
bbseay said:
Got an error 451 says bad mls/mlr Must be in accending order. Well I am mls--ing k1 then mlr--ing k0. The mext set is k2 mls then k1 mlr. I do this accending order for 5 more times.. in different parts of the program. As I go from top to bottom I am adding these functions. Any Clue???
Thanks

Look in my example in Post #17. You only use K2/K1, K3/K2, etc. combinations if the MLS/MLR are nested. If you "open" an MLS with K1 and "close" it with K0 without opening another one in between then the next MLS/MLR pair will be K1/K0.

edit; looks like you beat me to it johnny.
 
Last edited:
Thanks for the info. I will continue following your advice and keep you updated. There are 7 different MLS/MLR none are nested, So I should only use the MLS k1/MLR k0?
 

Similar Topics

I've got this start screen where the user has to enter their username and password. The username and password feature works fine. However, I want...
Replies
7
Views
1,477
Anyone know what the little green triangle on SCREEN 3 means ? See picture Thanks
Replies
2
Views
473
What do you guys think of this representation for on/off contacts? C003 is on, then others are off. I have never seen the logic represented in...
Replies
5
Views
1,809
Is it possible to get a report about used digital inputs on GE Proficy? I want to set what inputs are available.
Replies
3
Views
1,112
Hello PLCS.net! Link here: https://www.rockwellautomation.com/en-us/products/software/factorytalk/whats-new.html Seems like Rockwell is actually...
Replies
33
Views
22,471
Back
Top Bottom