Mach Discussion > Mach4 General Discussion
tool height probing
Pedio:
--- Quote from: poppabear on July 06, 2015, 07:41:36 AM ---Look over, and try this one, and see if it works......
Scott
--- End quote ---
--- Quote from: daniellyall on July 06, 2015, 05:34:15 PM ---well it`s still not quite right it comes up with this now
mcLua ERROR: Lua: Error while running chunk
[string "C:\Mach4Hobby\LuaExamples\m1005.mcs"]:27: bad argument #2 to 'tonumber' (base out of range)
stack traceback:
[C]: in function 'tonumber'
[string "C:\Mach4Hobby\LuaExamples\m1005.mcs"]:27: in function 'GetRegister'
[string "C:\Mach4Hobby\LuaExamples\m1005.mcs"]:45: in function 'm1005'
[string "C:\Mach4Hobby\LuaExamples\m1005.mcs"]:112: in main chunk
mcLua ERROR: Lua: Error while running chunk
I changed this
function GetRegister(regname, num)--Added the return type def param
local rc;
local inst = mc.mcGetInstance();
local hreg = mc.mcRegGetHandle(inst, string.format("iRegs0/%s", regname));
local ReturnValue = 0;
if num == 1 then
ReturnValue = tonumber(mc.mcRegGetValueString(hreg));
else
ReturnValue = mc.mcRegGetValueString(hreg);
end
return ReturnValue;
end
back to this
function GetRegister(regname)
local inst = mc.mcGetInstance()
local hreg = mc.mcRegGetHandle(inst, string.format("iRegs0/%s", regname))
return mc.mcRegGetValueString(hreg)
end
and ran through fine but still with the no probe contact error
--- End quote ---
Papa Bear - I tried putting the script into the "left up script" on the auto tool zero button on the Mach4 main screen. Nothing happens
I have the latest PMDX SmartBOB plugin that supports probing. I have assigned the digitizer to pin 15 and attached the touch plate. When I touch the magnet to the plate the probe LED lights.
Not sure if I need to do anything else. I am a newbie so please forgive me of my ignorance.
Pedio:
I quoted the wrong thread - I used the Papa Bear script in the zip file.
dude1:
it`s ok pedio it dont work yet
Navigation
[0] Message Index
[*] Previous page
Go to full version