Topic: DMD0504 Stage Transition Instructions |
|
|
|
Using a "Jump" Operation to Transition Between StagesThe previous examples have used the Jump to Stage (JMP) instruction to transition between stages. Recall that the Jump to Stage (JMP) instruction does two things: it deactivates the stage in which the instruction occurs, and activates the stage referred to in the Jump to Stage (JMP) instruction.
Please Read This Carefully &endash; The functionality of the Jump to Stage (JMP) instruction can be easily misunderstood. The term ”jump” sounds like the instruction would function like a GOTO instruction when executed, that is, processing would immediately begin at the target of the "jump" &endash; this is wrong! Here are some general rules to keep in mind when dealing with the Jump to Stage (JMP) and Jump to Multiple Stages (SGDIVRG) instructions:
Refer to the two-stage program examples below. Here’s how the Jump to Stage (JMP) instruction functions: |
|
This is because stage S1 follows stage S0. |
This is because stage S0 precedes stage S1. |
|
|
Using an "Enable / Disable" Operation to Transition Between Stages
Whereas the Jump to Stage (JMP) and Jump to Multiple Stages (SGDIVRG) instructions enable the target stage and disable the current stage, the Enable Stage (SGSET) and Disable Stage (SGRST) instructions only enable and disable the target stage; they do not necessarily disable the current stage. The Disable Range of Stages (SGRSTR) disables a range of consecutive stages.
A Jump to Stage (JMP) instruction is functionally equivalent to an Enable Stage (SGSET) of the target stage paired with a Disable Stage (SGRST) of the current stage.
|
|
|
|
Using a "Converge" Operation to Transition Between Stages
The instruction is a stage itself (e.g. S7 in pic). In the picture at the right, when stages S1, S2 and S3 are all enabled, and C0 is ON, then stages S1, S2 and S3 are all disabled and stage S7 is enabled. This one instruction is equivalent to using a rung in each of the stages (S1, S2 and S3) that has a normally-open contact C0 turning ON an SGRST disabling themselves, and then using an SGSET enable stage S7.
|
|
|
|
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 Stage Instructions in the Do-more Controller
|
|
|