Topic: DMD0511

Help File Version: 2.9.4.37

SGCONVRG - Converge Multiple Stages to SG


The Converge Multiple Stages to SG (SGCONVRG) instruction is used to coordinate the transition conditions from multiple stages. This instruction is itself a stage that is enabled when all of the From Stages are enabled AND the Then converge when parameter is satisfied (i.e. when it is non-zero if numeric location, or when it is TRUE or ON if a bit location); at that point all of the stages in the From Stages list will be disabled.

 

 

This instruction is a 'power-rail' instruction, meaning that it is displayed in the left-most column of the ladder diagram (the power rail). Creating new instances of this instructions is a bit counter-intuitive because they cannot be entered directly on the power rail in the Ladder Editor. The first step is to position the edit cursor in the output column (the far right) of the rung in the ladder logic diagram instead of positioning it against the power rail (the far left). At that point you can enter the instruction's mnemonic or double click on the instruction's name in the Instruction Toolbox. You can also drag / drop the instruction from the Toolbox anywhere on the rung and it will be created in the power rail of that rung.

 

Like all of the other stage programming instructions this one must be placed in a Program; stage instructions cannot be placed in a Task, a Subroutine, or an Interrupt Service Routine. Stage programming instructions can only reference stages in the same Program code block, they cannot reference stages in a different Program code block.

 

To switch between displaying the fully qualified stage reference ($Main.S0) and the abbreviated name (S0), go to the View -> Options -> Ladder Tab -> Misc. Options and check the 'Abbreviate Stage Names (Use S0 over $Main.S0)' option.

 

For a complete discussion on Stage Programming and how to use the Stage programming instructions effectively, refer to the Help Topic on Stage Programming Concepts.

 


Parameters:

Note: Use the F9 key to open the Default Element Selection Tool (the Element Picker or the Element Browser) or use the Down-Arrow key (Auto-Complete) on any parameter field to see a complete list of the memory locations that are valid for that parameter of the instruction.

 

Stage is the reference number of the SGCONVRG stage. The stage can only be a stage in the same Program; it cannot reference a stage in a different Program. The stage reference can be entered using its fully qualified name (for example MyProgram.S0 through MyProgram.S127) or simply its stage number (for example S0 through S127).

 

From Stages is the list of stages that must be enabled before the SGCONVRG stage looks for the Then converge when parameter. The From Stages can only be a stage in the same Program; it cannot reference stages in a different Program. The stage references can be entered using its fully qualified name (for example MyProgram.S0 through MyProgram.S127) or simply its stage number (for example S0 through S127).

 

Then converge when is a parameter that must be ON (if a bit location) or non-zero (if a numeric location) in addition to all enabled stages listed in the From Stages in order for the Stage to be enabled. This can be any readable bit or numeric location.

 


Status Display:

 

The status display lists each stage and whether or not that stage is enabled (ON) or disabled (OFF). It also shows the status or value of the Then converge when parameter. If the stage itself is already enabled, the entire box will be highlighted.

 


See Also:

Stage Instructions in the Do-more Controller

JMP - Jump To Stage

 

JMPI - Indexed Jump

 

SG - Stage

 

SGRST - Disable Stage

 

SGRSTI - Indexed Disable Stage

 

SGRSTR - Disable Range of Stages

 

SGSET - Enable Stage

 

SGSETI - Indexed Enable Stage


SGDIVRG - Jump to Multiple Stages

 

SGCONVRG - Converge Multiple Stages to SG

 


Related Topics:

Stage Programming Concepts

Introduction

 

Example 1 - A Simple 2-State Process

 

Stage Transition Instructions

 

Example 2 - A Lamp On / Off Controller

 

Example 3 - A Garage Door Opener

 

Review - Steps to Writing Successful Stage Programs

 


Example:

Description of a Converge Multiple Stages to SG:

This is a stage diagram of a sequence control that branches out into 3 simultaneous operations that would fill a vessel with product, cook its contents and stir it all at the same time until completion. Each parallel process independently ends itself. When all 3 are complete, the process converges to one stage in order to drain. Once the product is completely drained it is stopped.

 

 

Initially stage 'Start' waits for StartButton to come ON. When StartButton comes ON, the process transitions to all three stages ('Fill', 'Cook', 'Stir') using the Stage Diverge (SGDIVRG) instruction.

 

Each parallel process independently ends itself instead of depending on each other. Once all 3 processes have reached stages 'Filled', 'Done' and 'Finish', they converge to one stage in order to drain.

 

Once the draining has completed, the process is stopped.

Ladder Logic for the above Stage Diagram:

This is a ladder logic equivalent to the above stage diagram.

 

 

Once the Program code block containing this stage is first enabled to run, the initial stage 'Start' will be enabled because it is the initial stage (designated by the double border). None of the ladder logic in other stages ('Fill', 'Filled', 'Cook', 'Done', 'Stir', 'Finish', 'Drain', 'Stop') is executed; only Rung 2. Once StartButton comes ON the SGDIVRG (Jump to Multiple Stages) instruction is executed. This instruction disables stage 'Start', and enables stages 'Fill', 'Cook' and 'Stir' so that ladder logic in all three stages is being executed (i.e. Rungs 4-5, 8-9, 12-13).

 

Note: The SG and SGCONVRG instructions have rung numbers but they are hidden behind the SG box.

 

Stage 'Fill' will turn PumpMotor ON in order to begin to fill the vessel with product while the product simultaneously is cooked and stirred. Once the vessel is filled, Full comes ON the JMP (Jump To Stage) instruction is executed. This instruction disables stage 'Fill' and enables stage 'Filled'. When stage 'Fill' is disabled PumpMotor will turn OFF.

 

Stage 'Filled' is a dummy stage. There is nothing to do in this stage except wait on the other 2 parallel stages ('Cook' & 'Stir') to complete so that all 3 stages can be converged for the draining stage.

 

Stage 'Cook' will turn Oven ON in order to begin to cook the product in the vessel simultaneously while it is filled and stirred. Once 30 minutes has passed Time comes ON and the JMP (Jump To Stage) instruction is executed. This instruction disables stage 'Cook' and enables stage 'Done'. When stage 'Cook' stage is disabled Oven will turn OFF and the timer will be reset.

 

Stage 'Done' is a dummy stage. There is nothing to do in this stage except wait on the other 2 parallel stages ('Fill' & 'Stir') to complete so that all 3 stages can be converged for the draining stage.

 

Stage 'Stir' stage will turn StirPaddle ON in order to begin to stir the product in the vessel simultaneously while it is filled and cooked. Once 40 minutes has passed Consistent comes ON the JMP (Jump To Stage) instruction is executed. This instruction disables stage 'Stir' and enables stage 'Finish'. When stage 'Stir' is disabled StirPaddle will turn OFF and the timer will be reset.

 

Stage 'Finish' is a dummy stage. There is nothing to do in this stage except wait on the other 2 parallel stages ('Fill' & 'Cook') to complete so that all 3 stages can be converged for the draining stage.

 

Stage 'Drain' is an SGCONVRG (Converge Multiple Stages to SG) stage. This instruction coordinates the transition conditions from multiple stages. This stage is enabled when all of the stages in its From Stages list are enabled and the Then converge when parameter is true. Since the Then converge when parameter is $On (always TRUE), then whenever stages 'Filled', 'Done' and 'Finish' are all enabled (the dummy stages as described above), this instruction enables itself to run (stage 'Drain' = enabled) and all the other stages in its From Stages list are disabled (stages 'Filled', 'Done' & 'Finish').

 

Stage 'Drain' will turn DrainValve ON in order to begin to drain the vessel of product. Once Empty comes ON the JMP (Jump To Stage) instruction is executed. This instruction disables stage 'Drain' and enables stage 'Stop' ON. When stage 'Drain' is disabled DrainValve will turn OFF.

 

Stage 'Stop' exits this Program code block.

 

In order to rerun this sequence control, this Program code block must be run again.