Workcell end instruction selects next workpiece with related program