41
Mach4 General Discussion / Re: Need help with tool offset
« on: May 28, 2019, 12:43:09 PM »
Drill heads, two spindels and also horizontal drills
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.
first need to understand which cadcam you use and how you define there the material
because normally in that kind of controller (gcode like mach) the system not real interesting about yours material thickness
only date its need what z need go down and which tool
in europe cnc its generaly come with cadcam that calculate this ,so first explain how you want to work on this cnc
and which cadcam you plan to use
You're asking how to specify the work piece position, then saying it's always in the same place?
I'd set the origin in the CAM software to match your pin locations, which should be set by your home switches.
Hi,QuoteI am an novice at programming with lua but i have experience with c an c++
If you can program in C and C++ then Lua will be a walk in the park. You could write scripts in C but you would
have to compile, edit and debug outside of Mach. Don't waste your time.
Mach4's latest builds have migrated to Lua 5.3 which has a few subtle variations on 5.2:
https://www.lua.org/manual/5.2/
I notice you are using an Io? I assume that the CSMIO plugin has registered the Io you are addressing?
You cannot register an Io object from a script, registering an Io object is done by a plugin and the object is 'owned'
by the plugin. I don't think that your string correctly addresses the object, assuming it exists.
May I suggest you use a regular output. Output #5 for instance.
function m(126)
local inst=mc.mcGetInstance()
local hsig=mc.mcSignalGetHandle(inst,mc.OSIG_OUTPUT5)
mc.mcSignalSetState(hsig,1)
end
Assign a pin of your controller to Mach's output in the controller plugin and your done. This is how I would address an output
of my ESS for instance.
Note the I chose Output5 with malice aforethought because there is an LED for it in the outputs section of the
Machine Diagnostics tab. Allows you to see what you are doing.
Craig