Skip to main content

Mach 4 Gems

Mach 4 Gems

These are G code and Lua snippets that have solved some problems in the past that may prove useful or insightful.

Abort a Tool Change if Not Homed
function UserMCodeModule.UserMainToolChangeCycle( tc )
	-- If any enabled axis isn't homed, abort.
	local a,b,c = m.VerifyHoming()
	if not a then
		w.Error('Cannot perform a tool change while any axes are not homed')
	end

	return tc,true,w.FunctionCompleted()
end