Topic: DMD0515

JMPI - Indexed Jump


The Indexed Jump (JMPI) instruction is used to jump to a specific Stage within a contiguous range of Stages. The instruction uses the Index value to select one of the Stages within that range, and then transition to the selected Stage.

 

The Last/Exception Stage in the defined range is the error handling (exception) Stage. Any time the Index value is not within the defined range of Stages, the Last/Exception Stage will be selected.

 

When the Indexed Jump instruction (JMPI) is executed, it does NOT cause an immediate jump to the selected Stage logic, it only disables the current Stage and enables the selected Stage. The effect of this instruction will occur the next time that Stage is normally processed as part of the controller's scan. This means that any ladder logic instructions between the Indexed Jump (JMPI) 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.

 

Note: Stage programming instructions can only reference Stages in the same Program code block, they cannot reference Stages in a different Program code block.

 

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 (Element Browser) at any time to see a complete list of memory locations that are valid in the current field of the instruction.

 

Index - designates the memory location in the Do-more controller where the Index value is located. This can be any numeric location.

 

First Stage - designates the first Stage in the range of Stages. The First Stage reference can be entered using its fully qualified name - for example MyProgram.S0 through MyProgram.S127 - or simply its local Stage number - S0 through S127.

 

Last/Exception Stage - designates the final Stage in the contiguous range of Stages. The Last/Exception Stage reference can be entered using its fully qualified name - for example MyStage.S0 through MyStage.S127 - or simply its Stage number - for example S0 through S127.

 

For example, if the Index has a value of 7 and First Stage is S12 and Last/Exception is S21, then the instruction would jump to S19 (S12 + 7). If the value in Index had been larger than the range created in the instruction (e.g. value of 11; S12 + 11 = S23) or negative, then the Last/Exception is selected (i.e. S21).

 

 


Status Display:

The Status display of the Indexed Jump (JMPI) instruction contains a more verbose description of how the instruction is configured, and also displays which Stage is selected based on the current Index value.


See Also:

Stage Instructions in the Do-more Controllers

 

 


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 1 of 2:

Description of an Indexed Jump (JMPI) Diagram:

To the right is a stage diagram of a simple sequence control that would utilize a JMPI (Indexed Jump) instruction. This diagram would fill a vessel with a different color of material depending on the Color setting, cook its contents and then drain and repeat if necessary. It is good to imagine the sequence before actually writing the ladder logic.

 

Initially stage 'Start' waits for StartButton to come ON. When StartButton comes ON, the process transitions to either stage 'Blue', 'Red' or 'Green' depending on the value in the Color variable. In the case where the Color is of any other value than 0 or 1, stage 'Green' is assumed.

 

Each color fill stage fills the vessel. Once the vessel is full (Filled = ON), the process transitions to stage 'Cook'.

 

Stage 'Cook' cooks for a period of time. Once the time to cook is complete (Cooked = ON), the process transitions to stage 'Drain'.

 

Stage 'Drain' empties the contents of the vessel. Once the vessel is drained (Empty = ON), the process transitions back to stage 'Start' to repeat as necessary.

 
Ladder Logic for the above Stage Diagram:

To the right 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 is executed; only Rung 2. Once StartButton comes ON the JMPI (Indexed Jump) instruction is executed. This instruction disables stage 'Start', and enables stage 'Blue' or 'Red' or 'Green' depending on the value stored in Color. If Color = 0, stage 'Blue' is enabled. If Color = 1, stage 'Red' is enabled. Any other value for Color will enable stage 'Green'.

 

Note: The SG instructions have rung numbers but they are hidden by the SG box.

 

If stage 'Blue' is enabled, BluePump turns ON to power the pump motor so that blue product will begin to fill the vessel. Once the Filled indicator comes ON, the JMP instruction is executed. This instruction disables stage 'Blue' and enables stage 'Cook'. Also, since stage 'Blue' is now disabled, all OUT coils in that stage will be turned OFF (i.e. BluePump will go OFF).

 

If stage 'Red' is enabled, RedPump turns ON to power the pump motor so that red product will begin to fill the vessel. Once the Filled indicator comes ON, the JMP instruction is executed. This instruction disables stage 'Red' and enables stage 'Cook'. Also, since stage 'Red' is now disabled, all OUT coils in that stage will be turned OFF (i.e. RedPump will go OFF).

 

If stage 'Green' is enabled, GreenPump turns ON to power the pump motor so that green product will begin to fill the vessel. Once the Filled indicator comes ON, the JMP instruction is executed. This instruction disables stage 'Green' and enables stage 'Cook'. Also, since stage 'Green' is now disabled, all OUT coils in that stage will be turned OFF (i.e. GreenPump will go OFF).

 

When stage 'Cook' is enabled, Oven turns ON to power the heaters so that regardless of the color of the product, it will be cooked. CookTime timer also starts timing immediately. When CookTimer cooks for 1 hour the JMP instruction is executed. This instruction disables stage 'Cook' and enables stage 'Drain'. Also, since stage 'Cook' is now disabled, all OUT coils in that stage will be turned OFF (i.e. Oven will go OFF) and all timers will be reset (i.e. CookTime will be reset).

 

When stage 'Drain' is enabled, DrainValve turns ON to open the drain valve at the bottom of the vessel to allow the cooked product to drain. Once the Empty indicator comes ON, the JMP instruction is executed. This instruction disables stage 'Drain' and enables stage 'Start'. Also, since stage 'Drain' is now disabled, all OUT coils in that stage will be turned OFF (i.e. DrainValve will go OFF).

 

Since stage 'Drain' stage loops back to stage 'Start', this process will be repeated until the Program code block running this ladder logic is halted.


Example 2 of 2:


Copyright Host Engineering, Inc. ALL RIGHTS RESERVED