Topic: DMD0508

Help File Version: 2.9.4.37

Review - Steps to Writing Successful Stage Programs


Notice that the same steps are followed in arriving at the solution in each example control problem. The steps will become automatic as more solutions to control problems are worked through. However, it’s helpful to have a checklist as a guide through the problem-solving process. The following steps summarize the stage program design procedure:

 

  1. Write a Text Description of the application.
    Describe all objects and functions of the process. Start by listing the actions in sequential order. If there are too many things happening at once, try dividing the problem into more than one process. Remember, you can still have the processes communicate with each other to coordinate their overall activity.
     

  2. Draw the Block Diagram.
    Inputs represent all the information the process needs for decisions, and outputs connect to all devices controlled by the process. Make lists of inputs and outputs for the process. Assign I/O point numbers (X, Y, WX, & WY) to physical inputs and outputs.
     

  3. Draw the State Transition Diagram.
    The state transition diagram describes the central function of the block diagram, reading inputs and generating outputs. Identify and name the states of the process. Identify the event or events required for each transition between states. Ensure the process has a way to re-start itself, or is cyclical. Choose the power-up state for your process. Write the output equations.
     

  4. Write the Stage Program.
    Translate the state transition diagram into a stage program by making each state a stage. There can be up to 128 stages per Program code block. Remember that the first stage in a Program code block will be the Initial Stage, meaning that it will be automatically enabled at power-up. Place the outputs or actions in the appropriate stages.

 

Notice that Steps 1 through 3 prepare us to write the stage program in Step 4. However, the program practically writes itself because of the preparation beforehand. With practice the ability to start with a word description of an application and create a stage program in a single session will become easy.

 


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

Stage Programming Instructions

JMP - Jump To Stage

JMPI - Indexed Jump
 

SG - Stage
 

SGRST - Disable Stage

SGRSTR - Disable Range of Stages

SGSET - Enable Stage
 

SGDIVRG - Jump to Multiple Stages

SGCONVRG - Converge Multiple Stages to SG