Sortation Diverter
Ready to build this?
Sign up free — no credit card required. This scenario requires the Basic plan.
Sign up to play this scenario →Already have an account? Log in
Briefing
A material-handling conveyor feeds items through a photoeye at the entry zone. Each item carries an RFID-style tag identifying it as Type A or Type B. When the photoeye pulses, you must sample the TAG_A and TAG_B inputs immediately, then after a 500 ms travel delay energise the correct diverter for 1 s to route the item. An invalid tag combination (both or neither set) latches ERROR_LAMP.
Objectives
- CONVEYOR_RUN must be on whenever STOP_PB is not pressed
- When PHOTOEYE_IN pulses, latch the TAG_A and TAG_B values for the current item
- After ~500 ms, energise DIVERTER_A_ENERGISE for 1 s if the item is Type A
- After ~500 ms, energise DIVERTER_B_ENERGISE for 1 s if the item is Type B
- If both tags or neither tag read, latch ERROR_LAMP (no diverter action)
- ERROR_LAMP stays latched until power-cycle (or STOP_PB clears it in this simulation)
Hints
- Use a ONE_SHOT on PHOTOEYE_IN rising edge to capture tag values into latched bits: ITEM_A and ITEM_B
- Use a TOF or TON timer for the 500 ms travel delay before energising the diverter
- Use a second TON (1 s) to hold each diverter energised: DIVERTER_A_ENERGISE := TON_A.Q
- Validate: ERROR_BIT := (ITEM_A AND ITEM_B) OR (NOT ITEM_A AND NOT ITEM_B) — set on each PHOTOEYE_IN pulse
- STOP_PB de-energises CONVEYOR_RUN and may be used to clear the error latch
I/O Table
Inputs
PHOTOEYE_INPhotoeye pulse — item at entry zone
BOOL · %I0.0
TAG_ATag read: item is Type A
BOOL · %I0.1
TAG_BTag read: item is Type B
BOOL · %I0.2
DIVERTER_A_HOMEDiverter A at home position
BOOL · %I0.3
DIVERTER_B_HOMEDiverter B at home position
BOOL · %I0.4
STOP_PBStop / E-stop push-button
BOOL · %I0.5
Outputs
CONVEYOR_RUNConveyor drive run
BOOL · %Q0.0
DIVERTER_A_ENERGISEDiverter A solenoid (energise to divert A)
BOOL · %Q0.1
DIVERTER_B_ENERGISEDiverter B solenoid (energise to divert B)
BOOL · %Q0.2
ERROR_LAMPError indicator lamp (latching)
BOOL · %Q0.3
Your program will be tested against:
All test cases run automatically when you submit. Assertions are hidden until you pass.
- #1CONVEYOR_RUN asserts when not stopped
With no STOP_PB, CONVEYOR_RUN must be on from the first scan
- #2STOP_PB stops the conveyor
Press STOP_PB; CONVEYOR_RUN must de-energise immediately
- #3Type-A item energises Diverter A
Inject a Type-A item; after photoeye + travel delay, DIVERTER_A_ENERGISE must pulse
- #4Type-B item energises Diverter B
Inject a Type-B item; DIVERTER_B_ENERGISE must pulse
- #5Both tags simultaneously latches ERROR_LAMP
Manually assert PHOTOEYE_IN + TAG_A + TAG_B together; ERROR_LAMP must latch
Related scenarios
Ready to build this?
Sign up free — no credit card required. This scenario requires the Basic plan.
Sign up to play this scenario →Already have an account? Log in