Topic: DMD0509

Help File Version: 2.9.4.37

SGDIVRG - Jump to Multiple Stages


The Jump to Multiple Stages (SGDIVRG) instruction, aka "Stage Diverge", is used to transition from one stage to multiple stages by disabling the stage which contains the Jump to Multiple Stages instruction and enabling all of the target stages that are specified in the instruction.

 

 

The effect of this instruction will occur the next time the affected stages are normally processed as part of the CPU's scan. When a stage becomes disabled, on the next scan the disabled stage executes Termination Logic where Output (OUT) coils are turned OFF and Timers are reset.

 

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.

 

Transition To is the list of target stages for the transitions. The list can only be stages in the same Program; it cannot reference stages in a different Program. The stage references can be entered using their fully qualified names (for example MyProgram.S0 through MyProgram.S127) or simply their stage numbers (for example S0 through S127).

 

Automatically create the SG box for any NEW stage number: if the target Stage number does not exist it can be automatically created.

 

  • Below this rung means the target stage will be created on a new run following this instruction.



  • At end of code-block means the target stage will be created as the last rung of the Program.

 


Status Display:

 

The status display lists each specified stage and whether or not that stage is enabled (ON) of disabled (OFF).

 


See Also:

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 Jump To Multiple Stages Diagram:

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 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.