Hello Guest it is April 27, 2024, 07:16:13 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 - Bill_O

271
Mach4 General Discussion / Re: Mach4 laser on CNC router setup questions
« on: August 14, 2020, 12:02:53 PM »
Raptor,

Thank you for the information

Bill

272
Mach4 General Discussion / Re: Mach4 laser on CNC router setup questions
« on: August 13, 2020, 05:22:05 PM »
Did you ever get the macros done?
I would like to see the code for the head shift if you do not mind.

273
Mach4 General Discussion / Re: message box with yes or no
« on: August 11, 2020, 12:20:13 PM »
Swifty,

Worked great.
I had tried some code similar to what you showed but was missing a few little things.
Thanks for the help.

Bill

274
Mach4 General Discussion / message box with yes or no
« on: August 11, 2020, 10:57:50 AM »
I found some old threads about different message boxes.
I could use one with a yes or no option.
When I did any option for the message box it gave me an error.
Why is this code not working?

Code: [Select]
--------------------------------------
--test
---------------------------------------
function Test()
inst = mc.mcGetInstance()
rc = wx.wxMessageBox("Testing yes no box",2)
if (rc == 2) then
wx.wxMessageBox("Yes was pressed")
elseif (rc == 8) then
wx.wxMessageBox("No was pressed")
else
wx.wxMessageBox("Did not work")
end
end
---------------------------------------------------------------


Thanks,
Bill

275
Mach4 General Discussion / Re: load g code
« on: August 10, 2020, 11:49:44 AM »
Swifty,

I did not notice that.

Thanks,

Bill

276
Mach4 General Discussion / Re: load g code
« on: August 10, 2020, 10:03:34 AM »
Here is the code I ended up with.
At the end is some code that pops up a message box to let the operator know that the file is outside the machine limits if they set Home All.

Code: [Select]
---------------------------------------------------------------
-- Load file function.
---------------------------------------------------------------
function LoadCCIFile()

inst = mc.mcGetInstance();
-- create the wxFrame window
mainframe = wx.wxFrame( wx.NULL,          -- no parent
wx.wxID_ANY,          -- whatever for wxWindow ID
"DummyFrame", -- frame caption
wx.wxDefaultPosition, -- place the frame in default position
wx.wxDefaultSize,      -- default frame size
wx.wxDEFAULT_FRAME_STYLE ) -- use default frame styles

-- create a panel in the frame
panel = wx.wxPanel(mainframe, wx.wxID_ANY)
--We are not going to show it but we need to have this to use the File dialog

local file = wx.wxFileDialog(panel, "Select Cutting File", "", "", "All files (*.*)|*.*|CNC files (*.cnc)|*.cnc|Tap files (*.tap)|*.tap|Text files (*.txt)|*.txt",
wx.wxFD_SAVE,wx.wxDefaultPosition,wx.wxDefaultSize, "File Dialog" );
if(file:ShowModal() == wx.wxID_OK)then
local path = file:GetPath()   
mc.mcCntlLoadGcodeFile(inst, path);
--regenerate toolpath
mc.mcToolPathGenerate(inst)
end
--if machine homed check if file larger than soft limits
hregMHmd = mc.mcRegGetHandle(inst, 'iRegs0/MachHmd')
valMHmd = mc.mcRegGetValue(hregMHmd)
if (valMHmd == 1) then
MaxX = mc.mcAxisGetSoftlimitMax(inst, 0)
MaxY = mc.mcAxisGetSoftlimitMax(inst, 1)
hregPathXMax = mc.mcRegGetHandle(inst, 'core/inst/PathXmax')
PathXmax = mc.mcRegGetValue(hregPathXMax)
hregPathYMax = mc.mcRegGetHandle(inst, 'core/inst/PathYmax')
PathYmax = mc.mcRegGetValue(hregPathYMax)

MinX = mc.mcAxisGetSoftlimitMin(inst, 0)
MinY = mc.mcAxisGetSoftlimitMin(inst, 1)
hregPathXMin = mc.mcRegGetHandle(inst, 'core/inst/PathXmin')
PathXmin = mc.mcRegGetValue(hregPathXMin)
hregPathYMin = mc.mcRegGetHandle(inst, 'core/inst/PathYmin')
PathYmin = mc.mcRegGetValue(hregPathYMin)

if (PathXmax >= MaxX) or (PathYmax >= MaxY) or (PathXmin <= MinX) or (PathYmin <= MinY) then
wx.wxMessageBox("Cut file is outside cut area.\nContinuing may damage machine.")
end
end


end


277
Mach4 General Discussion / Re: load g code
« on: August 10, 2020, 08:55:51 AM »
Craig,

Thank you.

Bill

278
Mach4 General Discussion / load g code
« on: August 07, 2020, 10:20:39 AM »
The Load G Code button brings up a screen to select the file. (Gcode Load action)
I want to do the same thing using Lua script.
The mc.CntlLoadGcodeFile requires the file name.

Bill

279
Mach4 General Discussion / Re: Mach4 Lua for Dummies
« on: August 06, 2020, 01:09:05 PM »
Programmable Logic Control
In Mach4 it is a program that runs constantly in the background.
I think I explained it correct.

280
Mach4 General Discussion / Re: spindle dwell before run
« on: August 04, 2020, 12:21:51 PM »
devinw,

This might help in the understanding.
Go to the bottom to get the newest version.


https://www.machsupport.com/forum/index.php?topic=43260.msg279695#msg279695