7 Configuring example
11.03
7.3 Safety Integrated with SPL
© Siemens AG 2003 All Rights Reserved
7-396
SINUMERIK 840D/SIMODRIVE 611 digital SINUMERIK Safety Integrated (FBSI) - Edition 11.03
//
L 1
// Load 1
T
MB 194
// Transfer marker byte 194
//
QUI1: UN M 218.3; // Withdraw NCK acknowledgment
SPB QUI2;
//
L 0;
// Load 0
T MB 194;
// Transfer marker byte 194
//
QUI2: NOP 0;
//
//
CALL FC 21 (
Enable
:= DB18.DBX 70.4,
Funct
:= B#16#4,
S7Var
:= P#M 194.0 BYTE 1,
IVAR1
:= 4,
IVAR2
:= -1,
Error
:= M 218.4,
ErrCode := MW 188);
//
U M 218.3; // Withdraw acknowledgement NCK
U DB18.DBX 70.1;
// Acknowledgment EMERGENCY STOP-
PLC o.k.
UN DB18.DBX 110.1; // No difference between NCK/PLC
UN M 218.4; // No error during transfer
R DB18.DBX 70.4;
// Acknowledge EMERGENCY STOP PLC
R M 218.3; // Reset: Withdraw acknowledgement NCK
R M 211.0; // Start monitoring time of 8 hours
After the PLC has started the automatic acknowledgement, the EMERGENCY
STOP on the PLC side is acknowledged using the SPL marker
"SPL".QUIT_MARKER/ DB18.DBX70.4. When acknowledgement is started, an
S7 variable (MB194) is transferred using FC21 with a value of "1" and is then
evaluated by the NCK-SPL in lines N100 to N105.
The PLC (FC 21) can only transfer data to the NC with a minimum length of
one byte. This byte can be read in the synchronous actions by system variable
$A_DBB[n]. However, the binary logic operations "AND" and "OR" cannot
combine a bit with a byte so that the byte sent ($A_DBB[4]) must be converted
to a bit ($A_MARKERSI[3] / QUIT_REQUEST) (lines N100/N101).
As a result of lines N102 to 105, automatic acknowledgment is only permitted if
the "1" signal level of the NCK EMERGENCY STOP input is not interrupted for
longer than 400 ms. In order to check this time, a timer is started (line N103)
when the signal level changes from "1" to "0" at the EMERGENCY STOP input.
This is checked when automatic acknowledgment is to be made. An
acknowledgment is only issued if the time is < 400 ms. Otherwise an attempt to
automatically acknowledge an EMERGENCY STOP will be prevented. This
additional safeguard is necessary because at this point EMERGENCY STOP is
acknowledged using a single-channel by the PLC in both SPL programs.
The acknowledgement request on the NCK side
(QUIT_REQUEST/QUIT_MARKER) and the PLC side ("SPL".QUIT_MARKER)
are located at different SPL markers (MARKERSI[3,4,5]) in order to detect the
error that each acknowledgement request has the static status "1".
DEFINE QUIT_PLC AS $A_DBB[4]
;
; -------------------------------------------------------
; --------------------- EMERGENCY STOP ------------------
; -------------------------------------------------------
Description
Program