Topic: DMD0513

Help File Version: 2.9.4.37

SGRSTR - Disable Range of Stages


The Disable Range of Stages (SGRSTR) instruction is used to disable all of the Stages between the specified Start Stage and the End Stage. If the current Stage is within the specified range of Stages, when the Disable Stage instruction is executed, it does NOT cause an immediate jump to the next Stage that is enabled, it only disables the target Stages. This means that any ladder logic instructions between the Disable Range of Stages instruction and the end of the Program code block will still be executed.

 

 

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.

 

Start Stage is the beginning Stage in the range to disable. The Start 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).

 

End Stage is the last Stage in the range to disable. The End 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).

 

Note: The reference numbers for Start Stage and End Stage must be in ascending order, that is Start Stage reference must always the be less than the End Stage reference.

 


Status Display:

 

The status display shows whether or not the Start and End stages are enabled (ON) or 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 Disable Range of Stages Diagram:

Below is a stage diagram of a sequence control that branches out into 4 simultaneous independent sequences that would fill a vessel with product, cook its contents and stir it all at the same time until completion, while monitoring for an emergency abort.

 

Each parallel sequence independently ends itself. When stages 'Fill', 'Cook' and 'Stir' are complete and there was no abortion, the process converges to one stage in order to drain. Once the product is completely drained it is stopped.

 

If during this parallel process the Abort button is pressed, then transition is made to stage 'Drain' immediately.

 

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, 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', 'Cook', 'Stir', 'Filled', 'Done', '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', 'Stir' and 'Monitor' so that Rungs 4-13 will be executed.

 

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

 

Stage 'Fill' will turn Pump ON in order to fill the vessel with product (while it is also being cooked, stirred and monitored). When Full comes ON (indicating the vessel is filled with product) the JMP (Jump To Stage) instruction is executed. The JMP instruction disables stage 'Fill' and enables stage 'Filled'. When stage 'Fill' is disabled Pump will go OFF.

 

Stage 'Cook' will turn Oven ON in order to cook the product in the vessel (while it is also being filled, stirred and monitored) and also start the cook timer (CookTime) for 30 minutes. When CookTime.Done comes ON (indicating 30 minutes has passed) the JMP (Jump To Stage) instruction is executed. The JMP instruction disables stage 'Cook' and enables stage 'Done'. When stage 'Cook' is disabled Oven will go OFF.

 

Stage 'Stir' will turn Paddle ON in order to stir the product in the vessel (while it is also being filled, cooked and monitored) and also starts the stir timer (ConsistTime) for 40 minutes. When ConsistTime.Done comes ON (indicating 40 minutes has passed) the JMP (Jump To Stage) instruction is executed. The JMP instruction disables stage 'Stir' and enables stage 'Finish'. When stage 'Stir' is disabled Paddle will go OFF.

 

Stages 'Filled', 'Done' & 'Finish' are dummy stages. There is nothing to do in these stages except wait on the other stages to complete so that all 3 stages can be converged for the draining stage.

 

Stage 'Monitor' is enabled to run in parallel with stages 'Fill', 'Cook' and 'Stir'. Therefore if during any of this time the Abort button is pressed (e.g. because of an emergency) the SGRSTR (Disable Range of Stages) is executed. The SGRSTR instruction will disable all stages from stage 'Start' to 'Finish'. In order for this to work, all the stages named in its range must be consecutive. Thus stages 'Start', 'Fill', 'Cook', 'Stir', 'Monitor', 'Filled', 'Done' and 'Finish' (being consecutive in this example) are all disabled. The JMP instruction also enables stage 'Drain'.

 

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', 'Finish' and 'Monitor' are all enabled (the dummy stages as described above and stage 'Monitor'), this instruction enables itself to run (stage 'Drain' = ON) and all the other stages in its From Stages list are disabled (stages 'Filled', 'Done', 'Finish' & 'Monitor').

 

Stage 'Drain' will turn Valve 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'. When stage 'Drain' stage is disabled Valve 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.