
Tom@Pton (Customer) asked a question.
Skipping Rungs in a subroutine
What is the best way to skip several rungs in a CLICK subroutine? An instruction at the start of each seems excessive. I would prefer to skip rungs 7 through 24, for example, with one pair if possible.
An example or link would be fine. (I haven't managed to word my search correctly.)
I would have used JMP and LBL in RsLogix.
Anything similar?
A false instruction at the beginning of a rung doesn't skip it. It is evaluated as false. Standard outputs get turned off. Math instructions are not executed.
If you wish to actually skip the evaluation of the rungs then the JMP/LBL pair as suggested will accomplish that but realize that any outputs in the skipped rungs will stay in their last scanned state. Just understand the consequences of your choice.
I've used JMP/LBL frequently in RsLogix with AB products.
My project is with a CLICK.
So far, I've only been able to skip/ignore rungs with conditional instructions on each.
I can ignore subroutines by placing a conditional instruction ahead of the Call.
I can understand wishing to skip rungs in the old days of slow CPU scan rates but what is the advantage now? With today's Click Plus, 1K of boolean scans at less than 1ms.
I'm asking to expand my coding knowledge.
It’s not for processor speed. More for my lack of skills and future knowledge. This project has had multiple changes and Under certain conditions, xx number of rungs don’t pertain. Instead of a conditional instruction on each rung, two would do. Stuff changes and instead of starting over, a couple added rungs in an existing subroutine will work.
Could you duplicate the subroutine, and then activate one versus the other based on the certain said conditions?
If you are in the design phase of your project, and if no other specs require the Click, I would suggest moving to a PLC that supports the Stage programming, such as the Direct Logic D0-06's, or the D2-262, or better yet, the Do-more PLC's, such as the H2-DM1's, or my favorite now, the BRX PLC's. In my opinion, for any type of sequential control/ machine control, the ease-of-use of the Stage programming far exceeds the cost differential of the Click.
If #LD and #SFC had a baby, it would be #Stage programming in Do-more.
Sequences - piece of cake.
Asynchronous transitioning when completed OnSuccess or OnError - built-in
Branching - supported using multiple JMPs within a Stage (Step), even an Indexed Jump (JMPI) to simplify branching
Divergence/Convergence for more advanced parallel programming - it's there if you need it
Multiple Stage Diagrams - just another Program code-block with its own set of independent Stages (Steps)
Live Stage Flow Status for each Diagram - built-in to the Project Browser View's Control Logic tree
It's been there for 5 years. The millwrights couldn't see daylight for most of it. Their head was in a dark spot. We tried to make things work via logic but could not. Total physical redesign and maybe it works this time