Petri Net — Level Crossing Interlock
Interlock model of an automatic half-barrier crossing where the protecting signal can only clear once the barriers are proved down and the crossing is proved clear.
Make it your own.
title Automatic half-barrier crossing interlock
place trainApproach tokens 1 "Train on the approach circuit"
place roadOpen tokens 1 "Barriers up, road open"
place crossingClear tokens 1 "Crossing proved clear"
place barriersDown tokens 0 "Barriers proved down"
place signalClear tokens 0 "Protecting signal cleared"
place crossingOccupied tokens 0 "Train on the crossing"
transition strike "Approach treadle struck"
transition clearSignal "Clear the protecting signal"
transition occupy "Train enters the crossing"
transition restore "Train clear, raise barriers"
trainApproach -> strike
roadOpen -> strike
strike -> barriersDown
barriersDown -> clearSignal
crossingClear -> clearSignal
clearSignal -> signalClear
signalClear -> occupy
occupy -> crossingOccupied
crossingOccupied -> restore
restore -> roadOpen
restore -> crossingClear