Hi,
Thanks for your reply, tried both solutions, the dobutton(27) also waits for cycle start to be pressed if called from a gcode, the other one works if I run it in the editor, but if called from a gcode it just does not home the axis, but does not wait for cycle start.
Regards Morten