
20-9
Ladder Logic (LAD) for S7-300 and S7-400
C79000-G7076-C504-02
20.5 Master Control Relay Activate/Deactivate
With the instruction Activate Master Control Relay, you switch on the
MCR-dependency of subsequent commands. After entering this command,
you can program the MCR zones with these instructions (see Section 20.6).
When your program activates an MCR area, all MCR actions depend on the
content of the MCR stack (see Figure B-4).
Table 20-6 Master Control Relay Activate Element
LAD Element
Parameter Data Type Memory Area Description
MCRA
None – – Activates the MCR function
With the instruction Deactivate Master Control Relay, you switch off the
MCR-dependency of subsequent commands. After this instruction, you
cannot program any more MCR zones. When your program deactivates an
MCR area, the MCR is always energized irrespective of the entries in the
MCR stack.
Table 20-7 Master Control Relay Deactivate Element
LAD Element Parameter Data Type Memory Area Description
MCRD
None – – Deactivates the MCR function
The MCR stack and the bit that controls its dependency (the MA bit) relate to
each level and have to be saved and fetched every time you switch to the
sequence level. They are preset at the beginning of every sequence level
(MCR entry bits 1 to 8 are set to 1, the MCR stack pointer is set to 0 and the
MA bit is set to 0).
The MCR stack is passed on from block to block and the MA bit is saved and
set to 0 every time a block is called. It is fetched back at the end of the block.
The MCR can be implemented in such a way that it optimizes the run time of
code-generating CPUs. The reason for this is that the dependency of the
MCR is not passed on by the block; it must be explicitly activated by an
MCR instruction. A code-generating CPU recognizes this instruction and
generates the additional code necessary for the evaluation of the MCR stack
until it recognizes an MCR instruction or reaches the end of the block. With
instructions outside the MCRA/MCRD range, there is no increase of the
runtime.
The instructions MCRA and MCRD must always be used in pairs within your
program.
MCR Activate
MCR Deactivate
Program Control Instructions
Comentários a estes Manuais