Technical data

Table Of Contents
SFCs and SFBs for Updating the Process Image and Processing Bit Fields
System Software for S7-300/400 System and Standard Functions - Volume 1/2
14-10
A5E00709327-01
14.7 Implementing a Sequencer with SFB 32 "DRUM"
Description
SFB 32 "DRUM" implements a sequencer with a maximum of 16 steps. You
specify the number of the first step with the DSP parameter and the number of the
last step with the LST_STEP parameter.
During each step, all 16 output bits OUT0 to OUT15 and the output parameter
OUT_WORD (in which the output bits are collected together) are written. An output
bit is assigned either the corresponding bit of the OUT_VAL array that you specify
or the output bit is assigned the value of the corresponding output bit of the
previous step. Which value is assigned depends on how you set the mask bits in
the S_MASK parameter (see following table).
Note
The default setting for the mask bit is 0. If you want to change the current setting of
one or more mask bits, make this change in the instance DB.
SFB 32 "DRUM" switches to the next step when there is a rising edge at the JOG
input compared with the previous SFB call. If the SFB has already reached the last
step, a rising edge at JOG sets the variables Q and EOD; DCC has the value 0;
and the SFB remains in the last step until 1 is set at the RESET input.
You can also assign parameters so that switching to the next step is time
dependent. To do this, you must set the DRUM_EN parameter to 1. The sequencer
then switches to the next step when:
The event bit EVENT is set for the current step and
The time programmed for the current step has expired.
This time is the product of the DTBP time base and the time factor valid for the
current step (from the S_PRESET array)
Note
The execution time remaining in the current step (DCC) is only reduced when the
corresponding event bit EVENT is set.
If a 1 is set at the RESET input when the SFB is called, the sequencer goes to the
step you assigned to the DSP input.
Note
If you set a 1 for DRUM_EN, you can achieve the following special situation:
Purely time-dependent enabling of the steps by selecting EVENT = 1
where DSP <
i < LST_STEP.
Purely event-dependent enabling of the steps using the event bits EVENT by
setting 0 at DTBP.
You can also move on to the next step in the sequencer at any time (even if
DRUM_EN=1) via the JOG input.