Hello Guest it is May 31, 2023, 05:41:12 AM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - ysymidi

Pages: 1 2 3 4 5 »
Mach4 General Discussion / Re: I can't set Gage Block Height value.
« on: March 08, 2023, 06:22:40 AM »
Found the answer.

Screens fron very Old versions are not compatible with corrent version of M4. ;(
(I just copied the scrips from current version and replaced the old. Now it works.)

Mach4 General Discussion / I can't set Gage Block Height value.
« on: March 08, 2023, 01:12:51 AM »
Hello dear members,

I got recently attacked by a ransomeware and cleared all my PCs including Mach 4 setups...

I installed Mach 4 4809 + ESS283

And I copied screen from my backup.

But I can't set Gage Block Height. When I enter a value(like 15.0) and click on "Set Z" button, the value is turned to 10.4529.
I don't know where the value 10.4529 came from. ;(

Here is the linked script of "droGageBlock"

local inst = mc.mcGetInstance()

local val = scr.GetProperty("droGageBlock", "Value")
mc.mcProfileWriteString(inst, "PersistentDROs", "droGageBlock", string.format (val)) --Create a register and write to it

--local val = scr.GetProperty("droGageBlock", "Value")
--mc.mcProfileWriteString(inst, "OffsetsSettings", "GageBlock", tostring(val))
--mc.mcCntlSetLastError(inst, "Offsets: Fixture Z Gage block updated")

What should I do to solve this?

Daniba, I'm not telling that your way is wrong. I also agree on your opinion. Once Mach4 has got the tool height(length) info, then it should not measure it again. This will give a wrong result in case the tool is broken... And it's time consuming.

I'm just looking for a way to organize the process. ;)

Hello Daniba

I think you are getting the wrong point.
The point of this thread is not about measuring tool length before tool change, but about more accurate measuring with very low feed rate but at the same time minimizing time needed.

Measuring length before changing is not the topic. ;)

can you kindly make a video of how the sequence happens?
topic may interest many people.
thank you!

I took a video but could not upload here.

It's simple. This is to reduce time for tool change.

As for now,

my spindle goes down "G0" to the "Safe" height, and then start probing with F300, when it touches the probe, it takes back in 2mm and starts probing again for getting the height.

To apply this, one should understand how manual tool change works. Youtube videos from DazTheGas will be a great help.

If you fully understand it, you can just imagine how the code above will work. ;)

Thank you GOOMBA,

With your help I could tune my script. ;)
I made some modifications from yours. Without your help I couldn't make it at all. ;)

Now my machine works perfectly as I want it to do.


i thank you guys who give tons of help. ;)

With help from Daz, I've been able to run M6 so far.

But I'd like to shorten the time needed for tool change.

What code should I insert to probing twice?
(First with relatively fast feed(I think F300 would be enough), the second with slow/precise probing feed(F50 will do))

I think I need to back off about 2mm when the first probing is done. then the second probing starts.

Here is my M6 code I have used so far.

What should I add to the red below?


function m6()
    local inst = mc.mcGetInstance();
    local xstart = mc.mcAxisGetPos(inst,0)
    local ystart = mc.mcAxisGetPos(inst,1)
    local guesslen = -100
    local selectedtool = mc.mcToolGetSelected(inst)
    local currenttool = mc.mcToolGetCurrent(inst)
    local toollen = mc.mcToolGetData(inst, mc.MTOOL_MILL_HEIGHT, currenttool)
    if toollen == 0 then toollen = 50 end
    local probestart = guesslen + toollen

   if selectedtool == currenttool then   
   mc.mcCntlSetLastError(inst, "Selected Tool = Current Tool")


    mc.mcCntlGcodeExecuteWait(inst,"G90 G53 G00 Z0.000")
    mc.mcCntlGcodeExecuteWait(inst,"G90 G53 G00 X1.700 Y1.100")

    mc.mcCntlGcodeExecuteWait(inst,"G04 P4000")
    mc.mcCntlGcodeExecuteWait(inst,"G90 G53 G00 Z"..probestart)

    mc.mcCntlGcodeExecuteWait(inst,"G91 G31 Z-60 F100")
      local toolz = mc.mcAxisGetPos(inst,2)


    mc.mcCntlGcodeExecuteWait(inst, "G90 G53 G00 Z0.000")
   local changetoo = mc.mcToolGetDesc(inst, selectedtool)
   wx.wxMessageBox("Please change to tool number "..selectedtool.." "..changetoo.." and press OK to continue")
    currenttool = selectedtool
    toollen = mc.mcToolGetData(inst, mc.MTOOL_MILL_HEIGHT, currenttool)
    if toollen == 0 then toollen = 50 end
    probestart = guesslen + toollen
    mc.mcCntlGcodeExecuteWait(inst, "G90 G53 G00 X1.700 Y1.100")
    mc.mcCntlGcodeExecuteWait(inst, "G90 G53 G00 Z"..probestart)
    mc.mcCntlGcodeExecuteWait(inst, "G91 G31 Z-60 F100")
    mc.mcAxisSetPos(inst, 2 , toolz)
    mc.mcCntlGcodeExecuteWait(inst, "G90 G53 G00 Z0.000")
--    mc.mcCntlGcodeExecuteWait(inst,"M03")
--    mc.mcCntlGcodeExecuteWait(inst, "G90 G00 X"..xstart)
--      mc.mcCntlGcodeExecuteWait(inst, "G90 G00 Y"..ystart)
    mc.mcCntlGcodeExecuteWait(inst, "G90 G00 X"..xstart.." Y"..ystart)
--    mc.mcCntlGcodeExecuteWait(inst,"G04 P3000")

    mc.mcToolSetCurrent(inst, selectedtool)
   mc.mcCntlSetLastError(inst, "Toolchange Finished")
    --wx.wxMessageBox('Toolchange Finished')

if (mc.mcInEditor() == 1) then


try here

its a mach4 video by mach4 Brianna

Thank you so much my SAVIOR! ;)
I made it!


I've been struggling with soft limits.

Before I updated my Mach4, soft limits were on when Mach4 started up.
(Of course, I can click on the soft limit button and turn it off if I need it.)

I just want my recently updated Mach4 to work the same way.

What would be the simplest way to make it? ;)

P.S. Of course, I do "Axis referencing" before machining parts.

Mach4 General Discussion / Re: auto soft limits again
« on: February 08, 2021, 11:05:55 AM »
Hi Colten,

Thank you for the tip I need. ;)

Would you let me know what exactly "Add this in the section that loads required modules."? Which file or script, and where should I open?

Pages: 1 2 3 4 5 »