Technical data

Table Of Contents
S7 Communication
System Software for S7-300/400 System and Standard Functions - Volume 2/2
A5E00739858-01
21-43
21.14 Querying the Status of a Remote Partner with SFB 22
"STATUS"
Description
Using SFB 22 "STATUS," you can query the status of a remote communications
partner.
If there is a rising edge at control input REQ, a job is sent to the remote partner.
The reply is evaluated to determine whether problems have occurred. If no errors
occurred, the received status is copied to the variables PHYS, LOG and LOCAL
with the next SFB call. The completion of this job is indicated by the status
parameter NDR having the value 1.
You can only query the status of the same communications partner again after the
last query is 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
NDR OUTPUT BOOL I, Q, M, D, L NDR 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.
PHYS IN_OUT ANY I, Q, M, D Physical status (minimum length: one
byte).
Possible values:
10H functioning
13H service required
LOG IN_OUT ANY I, Q, M, D Logical status (minimum length: one byte).
Possible value:
00H status change permitted
LOCAL IN_OUT ANY I, Q, M, D Status if the partner device is an S7 CPU
(minimum length: two bytes)