Setting the end positions of a valve interlock