Detailed Description
2.11 Subroutine call with M, T, and D functions
Mode Group, Channel, Program Operation, Reset Response (K1)
Function Manual, 08/2005 Edition, 6FC5397-0BP10-0BA0
2-157
2.11.5 Properties of replacement subroutines
General rules for replacement subroutines
• Like any other subroutine, a replacement subroutine can contain a PROC statement.
• If the replacement subroutine is called from ISO mode, the PROC statement of the
replacement subroutine causes an implicit switchover to the standard language mode.
• However, no transfer parameters can be defined. The transfer of data to the replacement
subroutine always occurs via a system variable.
• The PROC statement enables program attributes such as SBLOF and DISPLOF to be
programmed.
• The replacement subroutine behaves like any other subroutine with respect to SBLOF in
active single block mode:
– Return jump with M17: Stop at end of subroutine
Note: Depending on MD20800 $MC_SPF_END_TO_VDI Bit0, the M function
is output to the PLC.
– Return jump with RET: No stop at end of subroutine
• If the replacement cycle has the DISPLOF attribute, the program line that has resulted in
the replacement cycle call is displayed as the current block in the block display.
• With DELAYFSTON and DELAYFSTOF, areas or even the entire replacement cycle can
be protected against interruptions such as NC Stop, read-in disable, etc.
References: Programming Guide, PGA "Conditionally interruptible program sections".
• Replacements do not occur recursively, i.e., the function that has led to the replacement
subroutine call is no longer replaced if it is programmed again in the replacement
subroutine.
Note
The following applies in general to replacements
In the case of replacements that are called due to programmed auxiliary functions, the
replacement subroutine call does not result in any output of the auxiliary function to the
PLC. The auxiliary function is only output if it is programmed again in the replacement
cycle.