The GOSUB command transfers control to a subroutine. Variable arguments can be passed to the subroutine from the mainline code using $ARG local variables (if applicable). The values in the $ARG points replace their respective point values.

When the subroutine processing is complete, program control is transferred back to the GOSUB statement by the RETURN command. The automation station then continues processing at the next sequential line number.

For information on transferring control to a subroutine, see the GOSUB and RETURN topics.