Host Engineering Forum

General Category => Do-more CPUs and Do-more Designer Software => Topic started by: RaymondC on August 17, 2020, 06:54:15 PM

Title: Stage programming - rungs not in a stage
Post by: RaymondC 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?
Title: Re: Stage programming - rungs not in a stage
Post by: BobO 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.
Title: Re: Stage programming - rungs not in a stage
Post by: franji1 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

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:
(https://upload.wikimedia.org/wikipedia/commons/1/14/Basic_Batch_SFC.jpg)

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.
Title: Re: Stage programming - rungs not in a stage
Post by: RaymondC on August 18, 2020, 06:18:16 PM
Thanks. It helps a lot to see sample Stage programs. I got my first program working!