Read a control sequence. Compare rules. Verify in PLAY.
Pick an industrial cell example, inspect how works and interlocks are written, toggle two control rules, and send the draft straight into DS Studio PLAY.
Your first source walkthrough#
- Select a cell example (battery pack, body welding, or clean optical inspection) and read the five station works inside the controller flow.
- Trace the sequence arrows (=>) to see how each station step calls its equipment API in order.
- Toggle the mutual-exclusion (<|>) and re-arm (=|>) switches below to watch the exact line change in place without affecting any machine.
- Copy the modified source or open it in a new PLAY tab. The link loads an unverified draft — click Apply in PLAY to run current compiler checks and 3D preview.
- Record the PLAY engine version and observed diagnostics, then compare expected versus observed timing separately before any equipment trial.
These are educational DS2 v2 cell examples with illustrative cycle times. Switching rules below edits source text only — it does not run a machine or certify functional safety. PLAY runs on dualsoft.ai as a separate service.
Choose an example#
How to read the example syntax
ds2 v2;- Declares the DS2 syntax version at the top of the process file.
work- A named shop-floor task unit (such as Press, Fasten, or Inspect) with tracked state and completion.
<|>- A mutual-exclusion interlock preventing two conflicting operations (such as press and fastener) from running at once.
=|>- A transition that resets (rearms) the previous work's completion marker while starting the next step.
api- Exposes a named span of works so an upstream controller can invoke a sub-equipment operation cleanly.
Toggles highlight modified lines in place. Copy the edited source or launch it straight into PLAY to inspect current diagnostics. This page edits text only.
| Example | Work declarations | Control patterns |
|---|---|---|
| Battery Pack Cell | 15 | <|> · =|> · api |
| Body Framing Weld Cell | 16 | <|> · =|> · api |
| Clean Optical Inspection Line | 15 | <|> · =|> · api |
Battery Pack Cell
Infeed -> Servo Press <|> Nutrunner Fasten (press/fasten interlock) -> Optical Vision =|> Palletizer
ds2 v2;
project Battery_Pack_Cell {
active Cell_Controller;
// Grid(1,2) Model:b01-02-roller-conveyor :: Battery module tray infeed
system Infeed_Conveyor {
flow Main {
work Feed { duration 1200ms; }
work Stop;
Feed =|> Stop;
}
api Transfer = Main.Feed .. Main.Feed;
}
// Grid(2,2) Model:a04-04-servo-press :: 1.8s controlled press and force check
system Servo_Press {
flow Main {
work Press { duration 1800ms; }
work Return;
Press =|> Return;
}
api Press_Op = Main.Press .. Main.Press;
}
// Grid(3,2) Model:a04-05-nutrunner-spindle :: Busbar torque fastening
system Nutrunner_Fastener {
flow Main {
work Fasten { duration 1600ms; }
work Retract;
Fasten =|> Retract;
}
api Fasten_Op = Main.Fasten .. Main.Fasten;
}
// Grid(4,2) Model:a05-02-inspection-station :: Optical polarity inspection
system Vision_Inspector {
flow Main {
work Inspect { duration 1100ms; }
work Clear;
Inspect =|> Clear;
}
api Inspect_Op = Main.Inspect .. Main.Inspect;
}
// Grid(5,2) Model:a01-06-palletizing-robot-4axis :: Finished pack palletizing
system Palletizer_Robot {
flow Main {
work Palletize { duration 1900ms; }
work Home;
Palletize =|> Home;
}
api Palletize_Op = Main.Palletize .. Main.Palletize;
}
system Cell_Controller {
flow Main_Sequence {
work S1_Infeed { Infeed_Conveyor.Transfer; }
work S2_Press { Servo_Press.Press_Op; }
work S3_Fasten { Nutrunner_Fastener.Fasten_Op; }
work S4_Vision { Vision_Inspector.Inspect_Op; }
work S5_Palletize { Palletizer_Robot.Palletize_Op; }
S1_Infeed => S2_Press;
S2_Press => S3_Fasten;
S3_Fasten => S4_Vision;
S4_Vision =|> S5_Palletize;
S2_Press <|> S3_Fasten;
}
api Run_Cycle = Main_Sequence.S1_Infeed .. Main_Sequence.S5_Palletize;
}
}
Showing the original cell example. Toggle either control rule above or launch PLAY to run diagnostics.
Observation questions & interpretation guide#
- Predict before toggling
- Before turning off S2_Press <|> S3_Fasten or changing S4_Vision =|> S5_Palletize to =>, predict which two works lose explicit mutual-exclusion protection and which completion marker stops re-arming for the next cycle.
- Works & markers to watch
- Track request acceptance and running state for S2_Press and S3_Fasten, plus S4_Vision's completion marker (WorkBit) when S5_Palletize starts.
- When a difference appears
- Because S2_Press => S3_Fasten already orders a clean single pass, removing <|> matters under an overlapping or duplicate request targeting both works; replacing =|> with => matters on a second cycle when S4_Vision must clear before re-starting.
- If two runs look identical, check first
- First check whether S2_Press => S3_Fasten already prevented overlap in a single normal run, and test a repeat cycle or overlapping request condition in PLAY diagnostics.
- Verification boundary
- Static guidance only (PLAY run on edited variants: NOT_RUN on this site). Apply the draft separately in DS Studio PLAY (dualsoft.ai) and record the engine version and observed state.
Body Framing Weld Cell
Infeed -> Clamp Jig -> Left <|> Right Spot Welder (dual-gun interlock) -> Optical Check =|> Release
ds2 v2;
project Body_Framing_Weld_Cell {
active Line_Controller;
// Grid(1,2) Model:b01-02-roller-conveyor :: Body frame carrier infeed
system Body_Infeed {
flow Main {
work Feed { duration 1000ms; }
work Reset;
Feed =|> Reset;
}
api Transfer = Main.Feed .. Main.Feed;
}
// Grid(2,2) Model:a04-02-pneumatic-linear-clamp-jig :: Datum fixture clamp and release
system Clamp_Jig {
flow Main {
work Clamp { duration 800ms; }
work Unclamp { duration 600ms; }
Clamp <|> Unclamp;
Clamp =|> Unclamp;
}
api Hold = Main.Clamp .. Main.Clamp;
api Release = Main.Unclamp .. Main.Unclamp;
}
// Grid(3,1) Model:a03-03-servo-spot-welding-gun :: Upper zone spot welding unit
system Left_Spot_Welder {
flow Main {
work Weld { duration 2000ms; }
work Open;
Weld =|> Open;
}
api Weld_Op = Main.Weld .. Main.Weld;
}
// Grid(3,3) Model:a03-03-servo-spot-welding-gun :: Lower zone spot welding unit
system Right_Spot_Welder {
flow Main {
work Weld { duration 2000ms; }
work Open;
Weld =|> Open;
}
api Weld_Op = Main.Weld .. Main.Weld;
}
// Grid(4,2) Model:a05-02-inspection-station :: Weld bead optical check
system Vision_Inspector {
flow Main {
work Inspect { duration 1100ms; }
work Clear;
Inspect =|> Clear;
}
api Inspect_Op = Main.Inspect .. Main.Inspect;
}
system Line_Controller {
flow Framing_Flow {
work S1_Infeed { Body_Infeed.Transfer; }
work S2_Clamp { Clamp_Jig.Hold; }
work S3_Weld_L { Left_Spot_Welder.Weld_Op; }
work S3_Weld_R { Right_Spot_Welder.Weld_Op; }
work S4_Inspect { Vision_Inspector.Inspect_Op; }
work S5_Release { Clamp_Jig.Release; }
S1_Infeed => S2_Clamp;
S2_Clamp => S3_Weld_L;
S2_Clamp => S3_Weld_R;
S3_Weld_L => S4_Inspect;
S3_Weld_R => S4_Inspect;
S4_Inspect =|> S5_Release;
S3_Weld_L <|> S3_Weld_R;
}
api Run_Cell = Framing_Flow.S1_Infeed .. Framing_Flow.S5_Release;
}
}
Showing the original cell example. Toggle either control rule above or launch PLAY to run diagnostics.
Observation questions & interpretation guide#
- Predict before toggling
- Notice S2_Clamp branches to both S3_Weld_L and S3_Weld_R. Predict how removing S3_Weld_L <|> S3_Weld_R changes concurrent eligibility of the two weld works, and how replacing S4_Inspect =|> S5_Release with => affects S4_Inspect on a repeat cycle.
- Works & markers to watch
- Compare active states of S3_Weld_L and S3_Weld_R right after S2_Clamp completes, and observe whether S4_Inspect's completion marker clears as S5_Release begins.
- When a difference appears
- Unlike a linear chain, S3_Weld_L and S3_Weld_R share predecessor S2_Clamp, so turning <|> off allows both weld branches to contend concurrently; replacing =|> with => becomes visible when re-entering S4_Inspect in a follow-up cycle.
- If two runs look identical, check first
- Confirm that S2_Clamp actually completed before checking S3_Weld_L / S3_Weld_R concurrency, and run through a second cycle after S5_Release to inspect S4_Inspect re-arm behavior.
- Verification boundary
- Static guidance only (PLAY run on edited variants: NOT_RUN on this site). Apply the draft separately in DS Studio PLAY (dualsoft.ai) and record the engine version and observed state.
Clean Optical Inspection Line
Parts Buffer -> SCARA Load <|> Stage Clamp (robot/clamp interlock) -> Surface Scan =|> Outfeed
ds2 v2;
project Clean_Optical_Inspection_Line {
active Line_Controller;
// Grid(1,2) Model:b04-01-parts-buffer :: Clean substrate parts buffer
system Parts_Buffer {
flow Main {
work Supply { duration 900ms; }
work Lock;
Supply =|> Lock;
}
api Feed_Part = Main.Supply .. Main.Supply;
}
// Grid(2,2) Model:a01-02-scara-robot :: Vacuum pick and stage loading
system Loading_Scara {
flow Main {
work PickPlace { duration 1200ms; }
work Return;
PickPlace =|> Return;
}
api Load_Stage = Main.PickPlace .. Main.PickPlace;
}
// Grid(3,2) Model:a04-02-pneumatic-linear-clamp-jig :: Stage lock during optical scan
system Stage_Clamp {
flow Main {
work Clamp { duration 800ms; }
work Release { duration 500ms; }
Clamp <|> Release;
Clamp =|> Release;
}
api Lock_Stage = Main.Clamp .. Main.Clamp;
api Unlock_Stage = Main.Release .. Main.Release;
}
// Grid(4,2) Model:a05-02-inspection-station :: Surface defect optical scan
system Optical_Inspector {
flow Main {
work Scan { duration 1100ms; }
work Reset;
Scan =|> Reset;
}
api Inspect_Surface = Main.Scan .. Main.Scan;
}
// Grid(5,2) Model:b01-01-belt-conveyor :: Approved part clean outfeed
system Outfeed_Conveyor {
flow Main {
work Outfeed { duration 1000ms; }
work Stop;
Outfeed =|> Stop;
}
api Discharge = Main.Outfeed .. Main.Outfeed;
}
system Line_Controller {
flow Clean_Line {
work S1_Supply { Parts_Buffer.Feed_Part; }
work S2_Load { Loading_Scara.Load_Stage; }
work S3_Clamp { Stage_Clamp.Lock_Stage; }
work S4_Scan { Optical_Inspector.Inspect_Surface; }
work S5_Discharge { Stage_Clamp.Unlock_Stage; Outfeed_Conveyor.Discharge; }
S1_Supply => S2_Load;
S2_Load => S3_Clamp;
S3_Clamp => S4_Scan;
S4_Scan =|> S5_Discharge;
S2_Load <|> S3_Clamp;
}
api Run_Line = Clean_Line.S1_Supply .. Clean_Line.S5_Discharge;
}
}
Showing the original cell example. Toggle either control rule above or launch PLAY to run diagnostics.
Observation questions & interpretation guide#
- Predict before toggling
- Before toggling S2_Load <|> S3_Clamp or S4_Scan =|> S5_Discharge, predict which robot-versus-clamp guard is removed and whether S4_Scan stays marked complete after S5_Discharge starts.
- Works & markers to watch
- Watch S2_Load and S3_Clamp for mutual-exclusion blocking and inspect S4_Scan's completion marker as S5_Discharge unlocks the stage and discharges.
- When a difference appears
- A normal single cycle already orders S2_Load => S3_Clamp, so removing <|> shows up when an abnormal or concurrent request targets both works; switching =|> to => affects whether S4_Scan is cleared before the next substrate cycle.
- If two runs look identical, check first
- Check first whether S2_Load => S3_Clamp already separated their normal timing in one pass, then check S4_Scan's completion state entering a second cycle in PLAY.
- Verification boundary
- Static guidance only (PLAY run on edited variants: NOT_RUN on this site). Apply the draft separately in DS Studio PLAY (dualsoft.ai) and record the engine version and observed state.
Check the result in the tool#
This page prepares and transports source text; it does not run the compiler. After opening PLAY, click Apply, inspect diagnostics for errors or interlock conflicts, and compare expected sequence order against observed simulation steps.
Scope and deliverables are agreed together before any customer data is handled.
