(* Sorting conveyor. *) (* Start and Stop run the belt, with a seal-in. Parts arrive on their own. At the pusher station a photo-eye sees every part and an inductive sensor sees only metal ones: push the metal parts into the reject bin and let the plastic parts ride to the end. Ten in a row with no mistakes passes. *) VAR_GLOBAL Start_PB AT %IX0.0 : BOOL; (* Start pushbutton, normally open *) Stop_PB AT %IX0.1 : BOOL; (* Stop pushbutton, normally closed, 1 when healthy *) PE_Entry AT %IX0.2 : BOOL; (* Photo-eye at the feeder, 1 when a part is there *) PE_Pusher AT %IX0.3 : BOOL; (* Photo-eye at the pusher station, sees every part *) Metal_Sensor AT %IX0.4 : BOOL; (* Inductive sensor at the pusher station, sees metal parts only *) Belt AT %QX0.0 : BOOL; (* Conveyor motor contactor *) Pusher AT %QX0.1 : BOOL; (* Reject pusher solenoid valve, 1 extends *) END_VAR PROGRAM Main (* Write the logic here. *) END_PROGRAM