G-Code

This AeroScript program uses standard G-codes mixed with AeroScript functions.

// G-Code Example:
// Demonstrates common G-code commands mixed with the AeroScript API.

program

	var $xStart as real
	var $yStart as real

	// Set the start positions.
	$xStart = 10
	$yStart = 15

	// Enable and home the axes.
	Enable([X, Y])
	Home([X, Y])

	// Change to English units.
	G71

	// Change to minutes time mode.
	G75

	// Set the move targets to absolute mode.
	G90

	// Set the G0 speed on each axis in English units per minute
	// (typically inches/minute).
	XF100
	YF100

	// Make a rapid point to point move to positions stored in AeroScript variables.
	G0 X$xStart Y$yStart

	// Change to Metric units.
	G70

	// Change to seconds time mode.
	G76

	// Set the move targets to incremental mode.
	G91

	// Perform coordinated moves at various speeds with a small dwell (G4)
	// between the moves.
	// The move targets and speeds are specified in Metric units and Metric units per second
	// (typically mm and mm/second, or µ and µ/second).
	G1 X5.0 Y2.0 F5.0
	G4 P1.0
	G1 X3.0 Y8.0 F15.0
	G4 P1.0

	// Change to English units.
	G71

	// Change to minutes time mode.
	G75

	// Set the move targets to absolute mode.
	G90

	// Return to the start positions using a rapid point to point motion and absolute mode.
	G90 G0 X$xStart Y$yStart

	// Disbale the axes.
	Disable([X, Y])

end