Omron C40K Video Game Controller User Manual


 
128
5-18 Step Instructions
The step instructions STEP(08) and SNXT(09) are used in conjunction to set
up breakpoints between sections in large programs so that the sections can
be executed as units and reset upon completion. A step of program will usu-
ally be defined to correspond with an actual process in the application. (Refer
to the application examples later in this section.) A section is like normal pro-
gramming code except that certain instruction (e.g. IL(02)/ILC(03), JMP(04)/
JME(05)) may not be included.
5-18-1 STEP DEFINE and STEP START – STEP(08)/SNXT(09)
B: Control bit
IR, HR
Ladder Symbols Definer Data Areas
STEP(08) B
STEP(08)
B: Control bit
IR, HR
Ladder Symbol Definer Data Areas
SNXT(09) B
STEP(08) is used with a control bit in the IR or HR area to define the begin-
ning of a section of the program called a step. STEP(08) does not require an
execution condition, i.e., its execution is controlled through the control bit. To
start execution of the step, SNXT(09) is used with the same control bit as the
STEP(08) that defines the beginning of the step. If SNXT(09) is executed
with an ON execution condition, the step with the same control bit is exe-
cuted. If the execution condition is OFF, the step is not executed. The
SNXT(09) must be written into the program before the step it starts. It can be
used at different locations before the step to control the step according to two
different execution conditions (see example 2, below). Any step in the pro-
gram that has not been started with SNTX(09) will not be executed.
Once SNXT(09) is used in the program, step execution will continue until
STEP(08) is executed without a control bit. STEP(08) without a control bit
must be preceded by SNXT(09) with a dummy control bit. The dummy con-
trol bit may be any unused IR or HR bit. It cannot be a control bit used in a
STEP(08). All control bits used to produce steps, however, must be from the
same word and must be used consecutively, and therefore a maximum of 16
steps can be programmed.
Execution of a step is completed either by execution of the next SNXT(09) or
by turning OFF the control bit for the step (see example 3 below). When the
step is completed, all of the IR and HR bits in the step are turned OFF and all
timers in the step are reset to their SV. Counters, shift registers, and bits
used in KEEP(11) maintain status.
More than one step can be programmed in series. Each step must start with
STEP(08) and generally ends with SNXT(09) (see example 3, below, for an
exception). When steps are programmed in series, three types of execution
are possible: sequential, branching, or parallel. The execution conditions for
and positioning of SNXT(09) determine how the steps are executed. The
three examples given below demonstrate these three types of step execu-
tion.
Description
Step Instructions Section 5-18