( Hans Wedemeyer http://home.swbell.net/hans_w ) ( Example using variables and calling subroutines ) ( Note! M0 can't be called in subroutine ) ( In this example the Z axis is operated manually, because the mill only has ( X,Y control and no Z. Z axis RSN ! ) ( Notice the variable V1 is changed between calls to the ( Circle subroutine. Remember this is an example, subroutines can save a lot ) ( of repetitive code, although here it looks like a waste... ) V1=0.5 ( Variable V1 is 0.5 ) F5.0 ( feed rate ) ( First Circle ) G22 P1 ( Call Subroutine #1 ) M0 ( Lower Z axis to depth ) G22 P2 ( Call Subroutine #2 ) M0 ( Raise Z to safe height ) ( Second Circle ) V1=1.0 ( new value for V1 ) G22 P1 ( Call Subroutine #1 ) M0 ( Lower Z axis to depth ) G22 P2 ( Call Subroutine #2 ) M0 ( Raise Z to safe height ) ( Third Circle ) V1=1.5 ( new value for V1 ) G22 P1 ( Call Subroutine #1 ) M0 ( Lower Z axis to depth ) G22 P2 ( Call Subroutine #2 ) M0 ( Raise Z to safe height ) M30 ( End of Program ) ( Subroutines go after M30 statement ) ( Subroutine Name starts with a $ ) $1 ( move to XY ) G00 XV1YV1 M2 $2 ( cut a circle ) G03 XV1YV1I-0.25J0.0 M2