|
Topic: DMD0509 SGDIVRG - Jump to Multiple Stages |
|
|
|
|
|
The Jump to Multiple Stages (SGDIVRG, "Stage Diverge") instruction is used to transition from one stage to multiple stages by disabling the Stage which contains the SGDIVRG instruction and enabling all of the target Stages that are specified in the SGDIVRG instruction.
When the Jump To Multiple Stages (SGDIVRG) instruction is executed, it does NOT cause an immediate jump to the target Stages, it disables the current Stage and enables the target Stages. The effect of this instruction will occur the next time those Stages are normally processed as part of the controller's scan. This means that any ladder logic instructions between the Jump To Multiple Stage (SGDIVRG) instruction and the end of the Stage will still be executed.
|
|
|
Note: All Stage programming instructions must be entered in a Program code block; Stage instructions cannot be placed in a Task code block.
For a complete discussion on Stage Programming concepts and how to use the Stage programming instructions effectively, refer to the Help Topic on Stage Programming Concepts. Parameters:Note: Use the F9 key (Element Browser) or Down-Arrow key (Auto-Complete) at any time to see a complete list of the memory locations that are valid in the current field of the instruction.
Transition To - designates the list of target Stages for the transitions. The target Stage references can be entered using their fully qualified names - for example MyProgram.S0 through MyProgram.S127 - or simply their Stage numbers - S0 through S127.
Note: To switch between displaying the fully qualified Stage reference ($Main.S0) and the abbreviated name (S0), go to the View-> Options -> Ladder Tab and check the option under the Misc. Options to 'Abbreviate Stage Names (Use S0 over $Main.S0)'.
Note: Stage programming instructions can only reference Stages in the same Program code block, they cannot reference Stages in a different Program code block.
|
|
|
|
|
Status Display:The status display of the Jump to Multiple Stages (SGDIVRG) lists each Stage and whether or not that Stage is enabled.
|
|
|
|
|
See Also:Stage Instructions in the Do-more Controller
|
|
|
|
|
Related Topics:Stage Programming Concepts
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:
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:
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.
|
|
|