Hello Guest it is April 24, 2024, 08:54:58 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.


Messages - ysymidi

Pages: « 1 2 3 4 5
41
Mach4 General Discussion / Re: M6 Doesn't work...
« on: February 07, 2018, 02:00:51 PM »
In the mach4 config/tools section, have you set this to T on M6 line is tool to use??

DazTheGas


DAZ,

I you almost solved the problem. ;)

Now I got a Macro that perfectly works..
This is almost the same as the code I followed to your Video Part2.

But.. I don't still understand why the code in Part3 doesn't work....

Code: [Select]
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
    return
    mc.mcCntlSetLastError(inst, "Toolchange Activated")
    else
    mc.mcCntlGcodeExecuteWait(inst,"G90 G53 G00 Z0.000")
    mc.mcCntlGcodeExecuteWait(inst,"G90 G53 G00 X25.000")
    mc.mcCntlGcodeExecuteWait(inst,"G90 G53 G00 Y352.500")
    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 X25.000")
    mc.mcCntlGcodeExecuteWait(inst, "G90 G53 G00 Y352.500")
    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, "G90 G00 Y"..ystart)
    mc.mcCntlGcodeExecuteWait(inst, "G90 G00 X"..xstart)
    mc.mcToolSetCurrent(inst, selectedtool)
mc.mcCntlSetLastError(inst, "Toolchange Finished")
    --wx.wxMessageBox('Toolchange Finished')
end
   
end


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

end

42
Mach4 General Discussion / Re: M6 Doesn't work...
« on: February 07, 2018, 01:42:26 PM »
I changed the setting as you told me but still nothing happens.
(I closed M4 and re-started it to make it sure the new configuration applied.)



43
Mach4 General Discussion / M6 Doesn't work...
« on: February 07, 2018, 11:47:11 AM »
Hello Members,

I so much appreciate your help. ;)
I have almost no chance to get a help like this in my country...

I'm trying to run a manual tool change macro in Mach4.

I use ESS + MB2(ver2.0) + 4 step motors(Y axis has 2 motors, I configured B as Y-Slave in ESS plugin, so MACH4 doesn't know there is a slaved motor.)


When I put "T3 M6" in MDI and click on Cycle Start, nothing happens....
And I captured log as below.


Quote
2018-02-08 01:19:05.002 - API: mcCntlMdiExecute(inst = 0, commands = 't2 m6') (Mach4GUI)
2018-02-08 01:19:05.104 - Attempt transition from "Idle" on event "MDI Start" Controller.cpp:1875
2018-02-08 01:19:05.104 - S_IDLE_on_exit
2018-02-08 01:19:05.104 - ACTION_start_mdi
2018-02-08 01:19:05.104 - S_MDI_RUNNING_on_entry
2018-02-08 01:19:05.104 - S_MDI_RUNNING2_on_entry
2018-02-08 01:19:05.105 - Signal id 1114, (Gcode Running), changed from LOW to HIGH.
2018-02-08 01:19:05.115 - Signal id 1121, (Tool Change), changed from LOW to HIGH.
2018-02-08 01:19:05.116 - >>>>> ESS received a Tool Change Required notification.

2018-02-08 01:19:05.120 - >>>>> ESS received a Tool Change Done notification.

2018-02-08 01:19:05.121 - Signal id 1121, (Tool Change), changed from HIGH to LOW.
2018-02-08 01:19:05.121 - >>>>> ESS received a Tool Change Done notification.

2018-02-08 01:19:05.241 - Attempt transition from "MDI Running" on event "Stop" GcodeExec.cpp:1179
2018-02-08 01:19:05.241 - S_MDI_RUNNING2_on_exit
2018-02-08 01:19:05.241 - Signal id 1114, (Gcode Running), changed from HIGH to LOW.
2018-02-08 01:19:05.241 - S_MDI_RUNNING_on_exit
2018-02-08 01:19:05.241 - ACTION_stop
2018-02-08 01:19:05.265 - S_IDLE_on_entry


Following is the code that I want to use with my machine. But nothing happens...
(I got it from DAZ part3 code, and only modified XY position and Spindle On/Off)
Code: [Select]
function M6()
    local inst = mc.mcGetInstance();
    local selectedtool = mc.mcToolGetSelected(inst)
    local currenttool = mc.mcToolGetCurrent(inst)
    local xstart = mc.mcAxisGetPos(inst,0)
    local ystart = mc.mcAxisGetPos(inst,1)

    if selectedtool == currenttool then
    return
    mc.mcCntlSetLastError(inst, "ToolChange Activated But Not Required")
    else
    mc.mcCntlGcodeExecuteWait(inst,"G90 G53 G0 Z0.0 \n X25.0 Y352.5")
--    wx.wxMessageBox("Please turn off spindle and click ok to continue") --can be removed if required
    RunProbe(currenttool)
    local toolz = mc.mcAxisGetPos(inst,2)
    mc.mcCntlGcodeExecuteWait(inst,"G90 G53 G0 Z0.0")
    local changetoo = mc.mcToolGetDesc(inst,selectedtool)
    wx.wxMessageBox("Please change to tool number "..selectedtool.." "..changetoo.." and press ok to continue")
    mc.mcCntlGcodeExecuteWait(inst,"G90 G53 G0 X25.0 Y352.5")
    RunProbe(selectedtool)
    mc.mcAxisSetPos(inst, 2 , toolz)
    mc.mcCntlGcodeExecuteWait(inst,"G90 G53 G0 Z0.0")
--    wx.wxMessageBox("Please turn on spindle and click ok to continue") --can be removed if required
    mc.mcCntlGcodeExecuteWait(inst,"G90 G0 X"..xstart.." Y"..ystart)
    mc.mcToolSetCurrent(inst, selectedtool)
    mc.mcCntlSetLastError(inst, "ToolChange Finished")
    end
end

function RunProbe(tool)
    local inst = mc.mcGetInstance()
    toollen = mc.mcToolGetData(inst, mc.MTOOL_MILL_HEIGHT, tool)
    if toollen == 0 then toollen = 50 end -- User Preference
    mc.mcCntlSetLastError(inst, "Changing to Fallback Length")
    local probestart = -60 + toollen
    mc.mcCntlGcodeExecuteWait(inst,"G90 G53 G0 Z"..probestart.."\nG91 G31 Z-60 F100")
end

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





I don't think Mach4 correctly recognizes selectedtool and currenttool.
So... if I just get rid of the lines concerning selectedtool and currenttool from the code. M6 works...
But it always say... "Please change to tool number 2 and press OK to continue." always... number 2...... I don't know why...
This is always the same whatever tool number I put, such as T3, T4, T5.....

Code: [Select]
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
--return
mc.mcCntlSetLastError(inst, "Toolchange Activated")
--else
    mc.mcCntlGcodeExecuteWait(inst,"G90 G53 G00 Z0.000")
    mc.mcCntlGcodeExecuteWait(inst,"G90 G53 G00 X25.000")
    mc.mcCntlGcodeExecuteWait(inst,"G90 G53 G00 Y352.500")
    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 X25.000")
    mc.mcCntlGcodeExecuteWait(inst, "G90 G53 G00 Y352.500")
    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, "G90 G00 Y"..ystart)
    mc.mcCntlGcodeExecuteWait(inst, "G90 G00 X"..xstart)
    mc.mcToolSetCurrent(inst, selectedtool)
mc.mcCntlSetLastError(inst, "Toolchange Finished")
    --wx.wxMessageBox('Toolchange Finished')
end
   
--end


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

end



What should I do....?
I'm desperately hopeless.... ;(

44
Mach4 General Discussion / Re: How can I edit lua script?
« on: February 06, 2018, 05:27:21 AM »
Thank you DAZ and Craig,

I could finally find where the script is.

I could hardly think that the Title of the Screen... "WX4" would include the script....



Thank you~ ;)

45
Mach4 General Discussion / Re: How can I edit lua script?
« on: February 05, 2018, 11:55:39 PM »
As you told me, I had thought I could have find the script among screen editor...

But I could not find it...

I think this is because M6 command is not performed via Click Button on the screen but manual input command in MDI.
So... it's natural that I could not find the script where I can edit to eliminate the msg box.



The second way you told me is the same I check on "Don't show me again" box on the pop up message.
This just doesn't show the box, but I still have to click "Cycle start" again.


This is the problem... because if I put in MDI as follows, tool change does not start, but jump to the next command.


T2 M6
G0 Z0


If it works properly, Mach4 should run toolchange then g0 z0, but now Mach4 just G0 Z0 then shows me the message box(or shows nothing(just hiding the box... like... there is an invisible box.... still have to cycle start once more...)

46
Mach4 General Discussion / Re: How can I edit lua script?
« on: February 05, 2018, 10:23:43 AM »
Hi DAZ,

What I exactly want to do is, to eliminate the highlighted part in the screen capture image.
(Or if there is no problem, I just want to eliminate from line 68 to 78.
I have my own M6 macro in my profile / Macro folder.
(I could do it with your video help. ;))

But I can't find where I should go and edit....


When I enter "T#(2,3....) M6" in the MDI, I always have to press Cycle Start MDI once more...
Mach pops up a message window, but I think this should not be popped up to run M6 in actual G-code.


47
Mach4 General Discussion / How can I edit lua script?
« on: February 05, 2018, 08:18:04 AM »
Hello everyone,

I've recently got into M4.
I studied for a couple weeks to customize M4.

I found something to change in lua script, but I can't edit it.
I could just VIEW it.... ;(

It's the script in the menu ---  "Operator > Lua Script"

What shall I do to edit this script?

I searched all in Mach4 directory... but in vain...

I absolutely need your help.....


48
Mach4 Plugins / Re: mcX360 Plugin for Lua
« on: January 17, 2018, 08:47:47 AM »
Hi Daz,

I'm watching your mcx360 yutube part1 and following your code.

But I got stuck...

When I move any AXIS to negative direction, it stuck.

I can't find what's wrong... I do that same as in the video...

I used the latest plugin you posted (dated, 2017-11-11)

Would you please take a look?
(Script, attached)

And... do you have some full fledged mcx360 script?
For me, scripting from null is too hard.... it would be a great help if I have a complete script that I can modify myself.


49
Appreciate your GREAT job!!!

Pages: « 1 2 3 4 5