Program Control Instructions
Statement List (STL) for S7-300 and S7-400 Programming
10-22
A5E00706960-01
10.17 )MCR End MCR
Important Notes on Using MCR Functions
Format
)MCR
Description
)MCR (end an MCR area) removes an entry from the MCR stack and ends an MCR
area. The last MCR stack location is freed up and set to 1. The instruction MCR(
must always be used in combination with the instruction )MCR. Execution of an
)MCR instruction with the stack empty produces a MCR Stack Fault (MCRF).
Status word
BR CC 1 CC 0 OV OS OR STA RLO /FC
writes: - - - - - 0 1 - 0
Example
STL Explanation
MCRA //Activate MCR area.
A I 1.0
MCR( //Save RLO in MCR stack; open MCR area. MCR = "on" when RLO=1 (I 1.0 ="1");
MCR = "off" when RLO=0 (I 1.0 ="0").
A I 4.0
= Q 8.0 //If MCR = "off", then Q 8.0 is set to "0" regardless of I 4.0.
L MW20
T QW10 //If MCR = "off", then "0" is transferred to QW10.
)MCR //End MCR area.
MCRD //Deactivate MCR area.
A I 1.1
= Q 8.1 //These instructions are outside of the MCR area and are not dependent upon
the MCR bit.
Comments to this Manuals