Hello Guest it is March 28, 2024, 06:47:25 AM

Author Topic: Wx4 Screen Set Tool Change Not Working?  (Read 777 times)

0 Members and 1 Guest are viewing this topic.

Wx4 Screen Set Tool Change Not Working?
« on: April 06, 2022, 06:37:40 AM »
I have my controller and control panel for my mill wired up and working, and I am in the midst of adding the Lua to enable the panel switchgear, and tweaking the screen UI to be a better fit for this mill.

This is mostly self-plagerization from the lathe project, so I got over most of the Lua learning curve a year ago.

I have, however, encountered something odd.

On the lathe, “T0101 M6” halts the program and flashes a UI screen light indicating a pending tool change. Clicking Cycle Start twice (once to acknowledge the tool change, once to resume the program) updates the current tool UI elements and resumes the program.

I have added functions on the lathe to enable the physical cycle start button to do the same thing, plus flash a physical LED while tool change is pending. Works great.

In the mill, I expect “T01 M6” to work the same way - but in the Wx4 screen set, that GCode does nothing. No pause, no UI light flash, no update of tool info - nada.

I have not mucked with any of the tool change elements or backend code. As far as I can tell at the moment, this is default behaviour.

Is Wx4 broken? Known problem?
Re: Wx4 Screen Set Tool Change Not Working?
« Reply #1 on: April 10, 2022, 01:20:02 PM »
So I checked the macros directory on the lathe, and it had something in there, where the macros directory on the mill did not.

Copying the lathe macro over enabled tool change, but it is acting super weird, so I guess I'm going to have to investigate a tool change macro Lua script.
Re: Wx4 Screen Set Tool Change Not Working?
« Reply #2 on: April 10, 2022, 06:24:17 PM »
Can someone explain to me how this code:

Code: [Select]
function m6()     
    local inst = mc.mcGetInstance();
    local rc

    mc.mcCntlToolChangeManual(inst, true);
    local selectedtool
    local currenttool

    selectedtool, rc = mc.mcToolGetSelected(inst)
    currenttool, rc = mc.mcToolGetCurrent(inst)

    mc.mcCntlSetLastError(inst, string.format("Changing tool from: %.4f to: %.4f", currenttool, selectedtool))
   
    if selectedtool == currenttool then
        mc.mcCntlSetLastError(inst, "ToolChange Activated But Not Required")
    else
         
        --local changetoo = mc.mcToolGetDesc(inst,selectedtool)
        --wx.wxMessageBox("Please change to tool number "..selectedtool.." "..changetoo.." and press ok to continue")
        rc = mc.mcToolSetCurrent(inst, selectedtool)
        mc.mcCntlSetLastError(inst, "ToolChange Finished")
    end
end

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

Somehow selected tool 5?
Re: Wx4 Screen Set Tool Change Not Working?
« Reply #3 on: April 12, 2022, 06:02:22 AM »
I'm on Mach 4 V4470 - is that the issue?
Re: Wx4 Screen Set Tool Change Not Working?
« Reply #4 on: April 12, 2022, 07:14:22 AM »
Go to Configure>Control>Tools Tab, and make sure the Tool Change Type is set to "T on M6 line is tool to use".
Re: Wx4 Screen Set Tool Change Not Working?
« Reply #5 on: April 12, 2022, 08:25:56 PM »
Yup, that was it.

Thanks.
Re: Wx4 Screen Set Tool Change Not Working?
« Reply #6 on: April 13, 2022, 12:30:55 AM »
SwiftyJ
there some situation that you cant change this radio button ,do you remember where can change in the file directly?