Hello Guest it is May 06, 2021, 09:51:53 PM

Author Topic: Mach4 freezes while executing mcCntlGcodeExecuteWait  (Read 1681 times)

0 Members and 1 Guest are viewing this topic.

Offline KMX

*
  •  12 12
    • View Profile
Mach4 freezes while executing mcCntlGcodeExecuteWait
« on: October 19, 2016, 04:53:11 PM »
Hello!

I am trying to do tool length probing button script, but have some problems with mcCntlGcodeExecuteWait function. The function executes, but in the mean time Mach4 freezes and position DROs are not updating.

How to solve it?

Regards, Denis

Offline DazTheGas

*
  •  753 753
  • DazTheGas
    • View Profile
Re: Mach4 freezes while executing mcCntlGcodeExecuteWait
« Reply #1 on: October 19, 2016, 05:18:03 PM »
Post the code to check, but does sound like you have an infinite  loop somewhere

DazTheGas
Theres always time for a choccy biccy

Offline KMX

*
  •  12 12
    • View Profile
Re: Mach4 freezes while executing mcCntlGcodeExecuteWait
« Reply #2 on: October 20, 2016, 01:48:06 AM »
Hello!

This is the code (very simple):

Code: [Select]
--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
« Last Edit: October 20, 2016, 01:49:46 AM by KMX »

Offline KMX

*
  •  12 12
    • View Profile
Re: Mach4 freezes while executing mcCntlGcodeExecuteWait
« Reply #3 on: October 20, 2016, 03:34:02 AM »
I have just tried to do it as Macro script and there is no problem with freezing...

Denis

Offline GerdS

*
  •  42 42
    • View Profile
Re: Mach4 freezes while executing mcCntlGcodeExecuteWait
« Reply #4 on: November 05, 2016, 08:23:21 AM »
Hello Denis,
i also had this problems. It looks like there is a problem ore a new behavior of the mcCntlGcodeExecuteWait() function.
Try to use mcCntlGcodeExecute() instead of mcCntlGcodeExecuteWait() when ever possible.
I used the whole day yesterday  to debug an fix most of problems after update to newest mach4 version.
Now it works so far.