MCS and MCSCLR are used to conditionally execute rungs in a ladder. Rungs between MCS x and MCSCLR x are executed only when the input to MCS x is ON. If the input to MCS x is OFF, the rungs between MCS x and MCSCLR x will not be executed. Using this command, an block of Ladder Logic can be conditionally executed.
In the example above, when M0 turns ON, the rungs between MCS 0 and MCSCLR are executed normally. If M0 is OFF, P5 and P6 will not be processed.
MCS numbers can be assigned from 0 to 7. MCS numbers should be used incrementally from 0 to 7. MCS 1 must be nested inside MCS 0 and MCS 2 must be nested inside MCS 1. When MCS 0 is OFF, none of the MCS's nested inside of MCS 0 will be executed.
When the input to an MCS is OFF, all outputs within that MCS block will turn OFF, timers withing the MCS block will be reset, and counters within the MCS block will stop counting.
The following table describes the behavior of various commands nested within an MCS block.
|Command||When MCS is ON||When MCS is OFF|
|SETOUT||Normal Operation||State is retained|
|RSTOUT||Normal Operation||State is retained|
|Timer||Normal Operation||Reset to default value|
|Counter||Normal Operation||State is retained, but counting is stopped|
|Other Commands||Normal Operation||Not executed|
The following example shows MCS 1 nested within MCS 0.
MCS numbers can be used repeatedly, but cannot be nested within one another.