Hello Guest it is April 19, 2024, 06:38:57 PM

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.


Topics - mark0815

Pages: 1
1
Mach4 General Discussion / M6 macro in 4.2.0-3233
« on: March 03, 2017, 03:32:18 PM »
Hi

I recently updated from Mach4 4.2.0-2914 to 4.2.0-3233 and discovered that my manual tool change macro does no longer work.

The macro looks like this:

function m6()
    local inst = mc.mcGetInstance()
    local selectedTool = mc.mcToolGetSelected(inst)
    local selectedToolDescription = string.format("%d: %s", selectedTool, mc.mcToolGetDesc(inst, selectedTool))
    local currentTool = mc.mcToolGetCurrent(inst)
    local currentToolDescription = string.format("%d: %s", currentTool, mc.mcToolGetDesc(inst, currentTool))
    if selectedTool == currentTool then
        mc.mcCntlSetLastError(inst, string.format("Current tool \"%s\" is selected tool, no change required", currentToolDescription))
    else
        mc.mcCntlSetLastError(inst, string.format("Please insert tool \"%s\" and hit cycle start", selectedToolDescription))
        mc.mcCntlToolChangeManual(inst, true)
        mc.mcToolSetCurrent(inst, selectedTool)
        mc.mcCntlGcodeExecuteWait(inst, string.format("G43 H%d", selectedTool))
    end
end

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

In Mach4 3233 this macro does no longer work. Symptoms are that the on the first tool change after program start always the selected tool is the current tool. On subsequent tool changes I always need to issue the tool chance to have to right tool set.

Does anybody has an idea what might be the problem?

Thanks in advance
Mark

Pages: 1