(* ------- checking for new M-functions -------- *)
IF (NOT
DB1_NC2SPS_MFKT_STROBE_BIT
AND
DB1_SPS2NC_MFKT_QUITT_BIT
) THEN
CASE (
DB1_NC2SPS_MFKT_W
) OF
0:
M_M0_bit := TRUE;
(* feedstop *)
1:
M_M1_bit := DB1_NC2SPS_WAHLWEISE_HALT_BIT; (* optionally stop *)
14:
M_M14_bit := TRUE;
(* tool down *)
15:
M_M15_bit := TRUE;
(* tool up *)
30: M_M30_bit := TRUE;
(* end of program *)
ELSE
mfkt_dw:=DB1_NC2SPS_MFKT_W;
SPSERROR(F_UNKNWON_MFCT_KI, 1, 'M-Fct: %lu', ADR(mfkt_dw));
END_CASE
END_IF
(* ------- executing of the M-functions ------- *)
(* feedstop *)
IF (M_M0_bit) THEN
IF (START_STOP.TRIG_STARTBUTTON.Q
OR START_STOP.TRIG_STOPBUTTON.Q)
THEN
M_M0_bit := FALSE;
END_IF
END_IF
(* optionally stop *)
IF (M_M1_bit) THEN
IF (START_STOP.TRIG_STARTBUTTON.Q
OR START_STOP.TRIG_STOPBUTTON.Q)
THEN
M_M1_bit := FALSE;
END_IF
END_IF
db2_hint_optionallystop_active_bit
:= M_M1_bit;
84 / 97
Upon the recognition that the new M-function is M14 or M15, the follow-up program part
is jumped to
M14:
The output O_ToolDown is set and a timer of 5s is started. If input I_ToolDown is set
after max. 5s, the function is switched, otherwise an error message occurs. The error mes-
sage is made via the function SPSERROR that opens an error screen in the StdHMI via the
error number (F_TOOL_UP_KI).