hexagon logo

End Routine

What is the purpose of the End Routine command I sometimes see on programs that I didn't write?
  • ROUTINE/END forces the measuring routine to cancel execution. I have mainly seen it used with flow control commands the stop the execution after some condition is met.

    For example, where I work, we have an IF statement near the beginning of all of our measuring routine to check if the part temperature is within 68+/-2degF. If the part temperature is outside of this range an operator comment pops up to say the part is too hot or cold. If the operator clicks OK and tries to resume the program from that point there is a ROUTINE/END command right after it that forces the program to stop.

    I have also used it in conjunction with test points at the beginning of a measuring routine to check that a temporary part locator has been removed, check that a clamp has been positioned right, make sure the right part is loaded, that sort of thing.
  • So there's not really any reason to have it at the very end of the program? I see that a lot with our old programs that were written way before me. The previous programmer must have thought that it was necessary to put that at the end of each program. I don't know why.
  • So there's not really any reason to have it at the very end of the program? I see that a lot with our old programs that were written way before me. The previous programmer must have thought that it was necessary to put that at the end of each program. I don't know why.


    That IS weird. They might have been using it as some sort of workaround that I'm unaware of. But more likely they may have mistakenly thought it was necessary. Maybe they used to use a different CMM software that did require some sort of command at the end of a measuring routine.
  • I oftentimes use a flow control command and name it END_PGM, have it placed at the bottom of all my code, so the routine will immediately terminate if operator screws up prompts enough, or selects something they shouldn't have (like our QUAL variants, where i add an additional full-screen Yes/No prompt warning that they are running a QUAL and not production output, ask if they still want to continue).
    But have never used the ROUTINE/END
  • The label at the end of my programs is "H3LL"

    I always chuckle when I see GOTO/H3LL commands