Technical data

Table Of Contents
S7 Communication
System Software for S7-300/400 System and Standard Functions - Volume 2/2
A5E00739858-01
21-39
21.12 Changing a Remote Device to the STOP State with
SFB 20 "STOP"
Description
If there is a rising edge at control input REQ, SFB 20 "STOP," this activates a
change to the STOP mode on the remote device addressed by the ID. The mode
change is possible when the device is in the RUN, HOLD or STARTUP modes.
If the remote system is a fault-tolerant system, the effect of the restart request
depends on the parameter PI_NAME: the start request is valid either for exactly
one CPU or for all CPUs of this system.
Successful execution of the job is indicated by the status parameter DONE having
the value 1. If any errors occur, they are indicated in the status parameters ERROR
and STATUS.
The mode change can only be started again in the same remote device when the
previous SFB 20 call has been completed.
Parameter Declaration Data Type Memory Area Description
REQ INPUT BOOL I, Q, M, D, L Control parameter request, activates the
SFB at a rising edge
ID INPUT WORD I, Q, M, D,
constant
Addressing parameter ID, refer to Common
Parameters of the SFBs/FBs and SFCs/FCs
for S7 Communication
DONE OUTPUT BOOL I, Q, M, D, L DONE status parameter:
0: Job not started or still running
1: Job has been executed error-free
ERROR
STATUS
OUTPUT
OUTPUT
BOOL
WORD
I, Q, M, D, L
I, Q, M, D, L
ERROR and STATUS state parameters,
error display:
ERROR=0 and STATUS has the value:
0000H: neither warning nor error
<> 0000H: Warning, STATUS supplies
detailed information.
ERROR=1
There is an error. STATUS supplies
detailed information on the type of
error.
PI_NAME IN_OUT ANY I, Q, M, D Pointer to the memory area in which the
name of the program (ASCII code) to be
started is located. This name must not
contain more than 32 characters.
With an S7 PLC, it must be P_PROGRAM.
With an H system, the following names are
possible:
P_PROGRAM (the start job is valid for
all CPUs in the H system.)
P_PROG_0 (the start job is valid for the
CPU in Rack 0 in the H system.)
P_PROG_1 (the start job is valid for the
CPU in Rack 1 in the H system.)