if event.type == "train" and atc_arrow then
  if getstate("mary4-testturnout-2") ~= "st" then
    atc_send("BB")
    error("Incorrect turnout position - correct route and test again")
  end
end