Hello Guest it is April 25, 2024, 04:04:30 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 - DazTheGas

171
Mach4 General Discussion / Re: Jogging while doing a tool change?
« on: October 24, 2017, 04:10:42 PM »
A simpler way would be to go into the tooltable and add 2 user fields ie XProbe and YProbe and make these integers, you can then call these like

Code: [Select]
local xpos = mc.mcToolGetDataExInt(inst, selectedtool, XProbe)
local ypos = mc.mcToolGetDataExInt(inst, selectedtool, YProbe)
mc.mcCntlGcodeExecuteWait(inst,"G90 G53 G0 Z0.0 \n X"..xpos.." Y"..ypos)

obviously you would have to populate the table for all tools which should be straight forward.

DazTheGas

172
Mach4 General Discussion / Re: Jogging while doing a tool change?
« on: October 24, 2017, 03:48:32 PM »
Anything is possible, I will take a look as the tooltable is now very customisable.

DazTheGas

173
Mach4 General Discussion / Re: Jogging while doing a tool change?
« on: October 23, 2017, 05:37:49 AM »
Hi,
its not quite as straight forward as you might think.

Actually its very easy to do by adding an if statement to change coordinates as per tool IE

Code: [Select]
wx.wxMessageBox("Please change to tool number "..selectedtool.." "..changetoo.." and press ok to continue")
if (selectedtool == 6) then
   mc.mcCntlGcodeExecuteWait(inst,"G90 G53 G0 X14 Y30")
elseif (selectedtool == 7) then
mc.mcCntlGcodeExecuteWait(inst,"G90 G53 G0 X20 Y40")
elseif (selectedtool == 8) then
mc.mcCntlGcodeExecuteWait(inst,"G90 G53 G0 X10 Y40")
end

DazTheGas

174
Mach4 General Discussion / Re: How to use G28.1 on Mach4?
« on: October 20, 2017, 03:09:01 PM »
Off the top of my head as not near machine at moment but I kind of remember me and Andy from Warp9 trying this and refallhome not working whilst gcode is running as a safety measure.

DazTheGas

175
This should get you going, just tried on my machine and works fine.

Code: [Select]
function m4()
local inst = mc.mcGetInstance();
   
mc.mcSignalSetState (mc.mcSignalGetHandle (inst, mc.OSIG_SPINDLEON),0)
mc.mcSpindleSetDirection(inst, mc.MC_SPINDLE_REV)
    wx.wxSleep(10) -- Change to how many seconds you require
end

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

DazTheGas

176
Have you thought about putting a short delay in the script to counteract the short signal.

DazTheGas

177
Mach4 General Discussion / Re: Lexical scope and Global Variables in Lua
« on: October 02, 2017, 10:54:35 AM »
Mach4 uses 2 states/chunks  of lua and cannot share variables between them.1 is for the GUI and the other for the interpretor. An idea would be to populate a register which can be read or written be both lua states.

DazTheGas

178
Mach4 Toolbox / Re: MACH4 tool change
« on: August 22, 2017, 12:04:50 PM »
That has been run from the screen_load_script.

From the menubar click on operator and then screen editor.
Once in the screen editor you will need to highlight the top of tree in the top left of the screen then click on the lighting bolt icon in the box below it, you should now see the screen load scipt.
you will find the part of the script that is doing the msg box on line 58 if you are using the stock wx4 screenset.

DazTheGas

179
To set the counts per unit you would need to use mcMotorSetInfoStruct, there is no mcLua bindings for this and can only be used from a plugin. Although I did do this a long while ago and I will see if I can find it, by writting to the profile then reloading the profile.

DazTheGas

180
Mach4 Plugins / Re: mcX360 Plugin for Lua
« on: August 13, 2017, 04:04:52 AM »
You seem to be missing the function GetXin

DazTheGas