[Basic Example 2] Opposing Motion & Full-Mode Operating Condition (<|> · interlock)
Hands-On Exercise 2 (
ds2 v2;) · Demonstrates the opposing-motion guard (<|>) that prevents simultaneous cylinder advance/retract outputs and the full-mode operating condition (interlock) that blocks unsafe manual jogs and homing.
1. Two Layers of Machine Safety
- Block Opposing Cylinder Motions ([[op:mutex]]
<|>): Prevents advance and retract coils from energizing together across Auto, Manual Jog, and Homing while preserving peer completion reset and unlatch (MutexSafe). *(To cap concurrent access across a shared workspace without resetting peers, declarezone_mutexShared Zone — likewise enforced asZoneSafein Manual Jog.)* - Block All Modes When the Safety Cover Opens (
interlock): When the cover is open, stops Auto cycle, Manual Jog, and Homing immediately and displays the reason on the operator HMI.
ds2 v2;
project SafetyInterlockExample {
active WorkControl;
system SafetyCover {
flow Monitor {
work ClosedConfirm finished { duration 50ms; }
}
observe CoverClosed = Monitor.ClosedConfirm;
}
system ClampCylinder {
flow Reciprocate {
work ForwardLock { duration 180ms; }
work BackwardRelease finished { duration 160ms; }
ForwardLock <|> BackwardRelease;
}
api ForwardLock = Reciprocate.ForwardLock;
api BackwardRelease = Reciprocate.BackwardRelease;
}
system WorkControl {
origin flow Homing {
work InitialRelease {
interlock (SafetyCover.CoverClosed) "Cannot release origin while safety cover is open";
ClampCylinder.BackwardRelease reuse completed;
}
}
flow Cycle {
work ClampPart finished {
when (SafetyCover.CoverClosed);
interlock (SafetyCover.CoverClosed) "Cannot clamp while safety cover is open";
ClampCylinder.ForwardLock;
}
work AssemblePart {
while (SafetyCover.CoverClosed);
duration 250ms;
}
work ReleasePart {
interlock (SafetyCover.CoverClosed) "Cannot release while safety cover is open";
ClampCylinder.BackwardRelease;
}
ClampPart => AssemblePart =|> ReleasePart;
ReleasePart |> ClampPart;
}
}
}
2. Key Syntax Summary
Syntax · Role
**`ForwardLock <\ · > BackwardRelease;`** · Opposing Motion (MutexSafe): enforces simultaneous-output guard and peer reset/unlatch across Auto, Manual Jog, and Homing (zone_mutex enforces ZoneSafe)
interlock (SafetyCover.CoverClosed) "Reason"; · Operating Condition: blocks hazardous motion across Auto, Manual Jog, and Homing with HMI reason display
origin flow Homing · One-shot homing sequence (=> / > only) that safely retracts the cylinder when Homing is pressed
⚠️ Safety Note: Separate from software interlocks (
<|>,interlock), {{hardware safety wiring::hardwired emergency-stop relays and Safety PLC circuits compliant withISO 13849/IEC 61508}} must always be installed to protect personnel on the shop floor.