News:

  • April 16, 2026, 02:35:57 AM

Login with username, password and session length

Author Topic: Stage programming - rungs not in a stage  (Read 5376 times)

RaymondC

  • Full Member
  • ***
  • Posts: 27
Stage programming - rungs not in a stage
« on: August 17, 2020, 06:54:15 PM »
What if you want some rungs in a program to be run every scan and not be in a stage. It looks like you can put rungs above the first stage label in a program. But not below the last stage since all the rungs that are below a stage label belong to that particular stage until another stage label is encountered. I guess there is no sort of "end stage" instruction? Or could you put all the instructions you want to always run in a separate stage and have that stage always enabled? I assume you can have multiple stages active in one program?

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6154
  • Yes Pinky, Do-more will control the world!
Re: Stage programming - rungs not in a stage
« Reply #1 on: August 17, 2020, 07:58:11 PM »
What if you want some rungs in a program to be run every scan and not be in a stage. It looks like you can put rungs above the first stage label in a program. But not below the last stage since all the rungs that are below a stage label belong to that particular stage until another stage label is encountered. I guess there is no sort of "end stage" instruction? Or could you put all the instructions you want to always run in a separate stage and have that stage always enabled? I assume you can have multiple stages active in one program?

Correct on all points.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3803
    • Host Engineering
Re: Stage programming - rungs not in a stage
« Reply #2 on: August 18, 2020, 09:14:12 AM »
What if you want some rungs in a program to be run every scan and not be in a stage. It looks like you can put rungs above the first stage label in a program. But not below the last stage since all the rungs that are below a stage label belong to that particular stage until another stage label is encountered. I guess there is no sort of "end stage" instruction? Or could you put all the instructions you want to always run in a separate stage and have that stage always enabled? I assume you can have multiple stages active in one program?

Stage Programming is based on IEC 61131-3 Sequential Function Charts.  Although not as extensive, Stage supports basic flow, which includes
  • Simple Transition from Stage to Stage (most common)
  • Setting (Enable) a Stage (so that the "enabling" stage still remains active, in addition to the one being enabled)
  • Resetting (Disable) a Stage or range of stages (common for "shut down" type behavior)
  • Divergence - transitioning from 1 stage to many stages; common in Batch systems where there is a separate sequence for delivering each raw ingredient, e.g. sequence for delivering proper water amount vs delivering proper corn amount
  • Convergence - synchronizing transitioning from many stages back to 1 stage
  • Branching - switch statement or if/elseif/elseif/else type behavior

JMP
SGSET
SGRST/SGRSTR
SGDIVRG
SGCONVRG
JMPI - (Indexed Jump; branching can also be done with multiple contact/JMP rungs)

Here is an SFC example from Wikipedia that can easily be done using Do-more Stage Program code block:


It would be very easy to take that diagram and then enter it in ladder.  Putting the proper Nicknames on each Stage makes it very powerful.  Attached is the first few stages of the above SFC diagram in Do-more Stage.  It uses Do-more SG, JMP, SGDIVRG instructions for the first few "steps" in the SFC diagram.

If you draw out the flow on paper FIRST, THEN write the ladder logic, it makes it much easier.  The SFC flow is basically the DESIGN.  The Stage program translates the DESIGN pretty well, especially if you use nicknames.

RaymondC

  • Full Member
  • ***
  • Posts: 27
Re: Stage programming - rungs not in a stage
« Reply #3 on: August 18, 2020, 06:18:16 PM »
Thanks. It helps a lot to see sample Stage programs. I got my first program working!