Hello!
This is the code (very simple):
--Measure
inst = mc.mcGetInstance()
local rc
function GCodeExecute(GCode)
local rc = mc.mcCntlGcodeExecuteWait(inst, GCode)
if rc ~= mc.MERROR_NOERROR then
return 'Error', false
else
return 'OK', true
end
end
local a, b
a, b = GCodeExecute('G0 G53 Z0 X-200 Y-300')
if b == true then
mc.mcCntlSetLastError(inst, 'test move.')
else
mc.mcCntlSetLastError(inst, a)
end
At this time I'm using simulation device for motion tests. The code is executed on button "LeftUp" event.
Denis