Hello Guest it is April 17, 2024, 10:47:26 PM

Author Topic: tool height probing  (Read 6719 times)

0 Members and 1 Guest are viewing this topic.

Offline dude1

*
  •  1,253 1,253
    • View Profile
Re: tool height probing
« Reply #10 on: July 03, 2015, 03:10:35 AM »
I give up
Re: tool height probing
« Reply #11 on: July 03, 2015, 03:24:40 PM »
local hsig = mc.mcSignalGetHandle(1,inst, ProbeSignal,mc.ISIG_INPUT11)

above line doesn't look right....if you want the handle to ISIG_PROBE is should be:

local hSig = mc.mcSignalGetHandle (inst, mc.ISIG_PROBE)

if mc.mcSignalGetState (hSig) == 1 then do something end


--on a side note, once I finish moving and reassemble my machine and equipment, I'll work on this for you....pending, I can get G31 working for me.

« Last Edit: July 03, 2015, 03:26:38 PM by Screwie Louie »

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: tool height probing
« Reply #12 on: July 06, 2015, 07:41:36 AM »
Look over, and try this one, and see if it works......

Scott
fun times

Offline dude1

*
  •  1,253 1,253
    • View Profile
Re: tool height probing
« Reply #13 on: July 06, 2015, 03:10:34 PM »
thanks scott that was a simple one
« Last Edit: July 06, 2015, 03:16:53 PM by daniellyall »

Offline dude1

*
  •  1,253 1,253
    • View Profile
Re: tool height probing
« Reply #14 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

Offline Pedio

*
  •  200 200
    • View Profile
Re: tool height probing
« Reply #15 on: July 06, 2015, 06:21:38 PM »
Look over, and try this one, and see if it works......

Scott
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

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.

Offline Pedio

*
  •  200 200
    • View Profile
Re: tool height probing
« Reply #16 on: July 06, 2015, 06:23:54 PM »
I quoted the wrong thread - I used the Papa Bear script in the zip file.

Offline dude1

*
  •  1,253 1,253
    • View Profile
Re: tool height probing
« Reply #17 on: July 06, 2015, 06:37:26 PM »
it`s ok pedio it dont work yet